Skip to content

Commit

Permalink
working on Goma for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
PhotoNomad0 committed Jan 15, 2023
1 parent dd3ee7c commit 2fa1efc
Show file tree
Hide file tree
Showing 3 changed files with 151 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/development/Electronite/electronite-tools-goma-3.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ rem Base Build script to do one of: getting sources, building Electronite execut
rem
rem Uses Chromium build tools.
rem
rem need to set paths before running this script. cd to the build directory and do:
rem need to set paths before running this script.
rem `set Path=%HOMEDRIVE%%HOMEPATH%\.electron_build_tools\third_party\depot_tools;%HOMEDRIVE%%HOMEPATH%\.electron_build_tools\src;%Path%`
rem
rem to troubleshoot build problems, do build logging by doing `set BUILD_EXTRAS=-vvvvv` before running
Expand Down
72 changes: 72 additions & 0 deletions docs/development/Electronite/meta_builds/build_all_goma_win.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
set BRANCH=%1
set DEST=%2

rem Meta Build script to get sources, and then build for x64, x86, and arm64 by calling build_target_win.bat
rem for each architecture. The dist.zip files are stored at %DEST%
rem
rem Uses Chromium build tools.
rem
rem need to set paths before running this script.
rem `set Path=%HOMEDRIVE%%HOMEPATH%\.electron_build_tools\third_party\depot_tools;%HOMEDRIVE%%HOMEPATH%\.electron_build_tools\src;%Path%`
rem
rem to troubleshoot build problems, do build logging by doing `set BUILD_EXTRAS=-vvvvv` before running
rem
rem Example `build_all_goma_win.bat electronite-v22.0.1-beta results\win\v22.0.1`

echo "Building %BRANCH% to: %DEST%"

if not exist src (
echo "Getting sources from %BRANCH%"
call electronite-tools-goma_3.bat get %BRANCH%
)

set TARGET=x64
set DEST_FILE=%DEST%\%TARGET%\dist.zip
if exist %DEST_FILE% (
echo "Build %TARGET% already exists: %DEST_FILE%"
) else (
echo "Doing Build %TARGET%"
call build_target_goma_win.bat %TARGET% %DEST%
)

if exist %DEST_FILE% (
echo "Distribution %TARGET% built: %DEST_FILE%"
) else (
echo "Distribution %TARGET% failed: %DEST_FILE%"
exit /b 10
)

set TARGET=x86
set DEST_FILE=%DEST%\%TARGET%\dist.zip

if exist %DEST_FILE% (
echo "Build %TARGET% already exists: %DEST_FILE%"
) else (
echo "Doing Build %TARGET%"
call build_target_goma_win.bat %TARGET% %DEST%
)

if exist %DEST_FILE% (
echo "Distribution %TARGET% built: %DEST_FILE%"
) else (
echo "Distribution %TARGET% failed: %DEST_FILE%"
exit /b 10
)

set TARGET=arm64
set DEST_FILE=%DEST%\%TARGET%\dist.zip
if exist %DEST_FILE% (
echo "Build %TARGET% already exists: %DEST_FILE%"
) else (
echo "Doing Build %TARGET%"
call build_target_goma_win.bat %TARGET% %DEST%
)

if exist %DEST_FILE% (
echo "Distribution %TARGET% built: %DEST_FILE%"
) else (
echo "Distribution %TARGET% failed: %DEST_FILE%"
exit /b 10
)

echo "All builds completed to %DEST%"
78 changes: 78 additions & 0 deletions docs/development/Electronite/meta_builds/build_target_goma_win.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
set TARGET=%1
set DEST=%2

rem Build script to do build build and release for %TARGET% if not present at %DEST%
rem
rem Uses Chromium build tools.
rem
rem need to set paths before running this script.
rem `set Path=%HOMEDRIVE%%HOMEPATH%\.electron_build_tools\third_party\depot_tools;%HOMEDRIVE%%HOMEPATH%\.electron_build_tools\src;%Path%`
rem
rem to enable goma, do `set GOMA=cache-only` before running script
rem
rem to troubleshoot build problems, do build logging by doing `set BUILD_EXTRAS=-vvvvv` before running
rem
rem Example `build_target_goma_win.bat x64 results\win\v22.0.1`

echo "Building %TARGET% to: %DEST%"

set BUILD_TARGET=.\src\out\%TARGET%\electron.exe
if exist %BUILD_TARGET% (
echo "Build Target already exists: %BUILD_TARGET%"
) else (
echo "Doing Build %TARGET%"
call .\electronite-tools-goma-3.bat build %TARGET%
echo "Finish Build %TARGET%"
)

if exist %BUILD_TARGET% (
echo "Target built: %BUILD_TARGET%"
) else (
echo "Target failed: %BUILD_TARGET%"
exit /b 10
)

set RELEASE_TARGET=.\src\out\%TARGET%\dist.zip
if exist %RELEASE_TARGET% (
echo "Release Target already exists: %RELEASE_TARGET%"
) else (
echo "Doing Release %RELEASE_TARGET%"
call .\electronite-tools-goma-3.bat release %TARGET%
echo "Finished Release %RELEASE_TARGET%"
)

if exist %RELEASE_TARGET% (
echo "Target released: %RELEASE_TARGET%"
) else (
echo "Target failed: %RELEASE_TARGET%"
exit /b 10
)

set DEST_FOLDER=%DEST%\%TARGET%
if not exist %DEST_FOLDER% (
echo "Creating Destination folder: %DEST_FOLDER%"
md "%DEST_FOLDER%"
)

if not exist %DEST_FOLDER% (
echo "Error Creating Destination folder: %DEST_FOLDER%"
exit /b 10
)

set DEST_FILE=%DEST_FOLDER%\dist.zip
echo "Copy from %RELEASE_TARGET% to %DEST_FILE%"
copy %RELEASE_TARGET% %DEST_FILE%
if not exist %DEST_FILE% (
echo "Error moving dist.zip file to: %DEST_FILE%"
exit /b 10
)

set TARGET_FOLDER=.\src\out\%TARGET%
echo "Remove %TARGET_FOLDER% to free up space for later builds'
rmdir /s /q %TARGET_FOLDER%
if exist %TARGET_FOLDER% (
echo "Error removing %TARGET_FOLDER%"
exit /b 10
)

echo "Done copying build to %TARGET_FOLDER%"

0 comments on commit 2fa1efc

Please sign in to comment.