From 90e204bf99c0f289bdf7cbd43f8ca1a9547f1270 Mon Sep 17 00:00:00 2001 From: asminozhka <41116859+asminozhka@users.noreply.github.com> Date: Wed, 10 Jul 2019 18:33:07 +0300 Subject: [PATCH] Speeded up compilation --- build-linux | 8 ++++---- build-linux-nowebsockets | 8 ++++---- build-nowebsockets.bat | 8 ++++---- build.bat | 8 ++++---- build_templates.bat | 2 +- cmd/query_gen/build.bat | 2 +- cmd/query_gen/run.bat | 2 +- dev-update-linux | 2 +- dev-update-travis | 2 +- dev-update.bat | 2 +- experimental/new-update.bat | 2 +- install-docker | 2 +- install-linux | 2 +- install.bat | 2 +- pre-run-linux | 8 ++++---- quick-update-linux | 2 +- router_gen/build.bat | 2 +- router_gen/run.bat | 2 +- run-linux | 8 ++++---- run-linux-nowebsockets | 8 ++++---- run-linux-tests | 2 +- run-nowebsockets.bat | 8 ++++---- run.bat | 8 ++++---- run_mssql.bat | 8 ++++---- run_tests.bat | 4 ++-- run_tests_mssql.bat | 4 ++-- 26 files changed, 58 insertions(+), 58 deletions(-) diff --git a/build-linux b/build-linux index 4a75802d..f9edf2f2 100644 --- a/build-linux +++ b/build-linux @@ -5,12 +5,12 @@ rm -f tmpl_client/template_*.go rm -f ./Gosora echo "Building the router generator" -go build -o RouterGen "./router_gen" +go build -ldflags="-s -w" -o RouterGen "./router_gen" echo "Running the router generator" ./RouterGen echo "Building the query generator" -go build -o QueryGen "./cmd/query_gen" +go build -ldflags="-s -w" -o QueryGen "./cmd/query_gen" echo "Running the query generator" ./QueryGen @@ -19,7 +19,7 @@ easyjson -pkg common echo "Building Gosora" go generate -go build -o Gosora +go build -ldflags="-s -w" -o Gosora echo "Building the installer" -go build -o Installer "./install" +go build -ldflags="-s -w" -o Installer "./install" diff --git a/build-linux-nowebsockets b/build-linux-nowebsockets index 41432be8..4cd223f1 100644 --- a/build-linux-nowebsockets +++ b/build-linux-nowebsockets @@ -6,7 +6,7 @@ rm -f ./Gosora echo "Building the router generator" cd ./router_gen -go build -o RouterGen +go build -ldflags="-s -w" -o RouterGen mv ./RouterGen .. cd .. echo "Running the router generator" @@ -14,7 +14,7 @@ echo "Running the router generator" echo "Building the query generator" cd ./cmd/query_gen -go build -o QueryGen +go build -ldflags="-s -w" -o QueryGen mv ./QueryGen ../.. cd ../.. echo "Running the query generator" @@ -25,10 +25,10 @@ easyjson -pkg common echo "Building Gosora" go generate -go build -o Gosora -tags no_ws +go build -ldflags="-s -w" -o Gosora -tags no_ws echo "Building the installer" cd ./install -go build -o Installer +go build -ldflags="-s -w" -o Installer mv ./Installer .. cd .. diff --git a/build-nowebsockets.bat b/build-nowebsockets.bat index 33e00c48..c98dcbdf 100644 --- a/build-nowebsockets.bat +++ b/build-nowebsockets.bat @@ -16,28 +16,28 @@ echo Generating the JSON handlers easyjson -pkg common echo Building the executable -go build -o gosora.exe -tags no_ws +go build -ldflags="-s -w" -o gosora.exe -tags no_ws if %errorlevel% neq 0 ( pause exit /b %errorlevel% ) echo Building the installer -go build "./cmd/install" +go build -ldflags="-s -w" "./cmd/install" if %errorlevel% neq 0 ( pause exit /b %errorlevel% ) echo Building the router generator -go build ./router_gen +go build -ldflags="-s -w" ./router_gen if %errorlevel% neq 0 ( pause exit /b %errorlevel% ) echo Building the query generator -go build "./cmd/query_gen" +go build -ldflags="-s -w" "./cmd/query_gen" if %errorlevel% neq 0 ( pause exit /b %errorlevel% diff --git a/build.bat b/build.bat index a85adc49..5396e1c7 100644 --- a/build.bat +++ b/build.bat @@ -18,28 +18,28 @@ echo Generating the JSON handlers easyjson -pkg common echo Building the executable -go build -o gosora.exe +go build -ldflags="-s -w" -o gosora.exe if %errorlevel% neq 0 ( pause exit /b %errorlevel% ) echo Building the installer -go build "./cmd/install" +go build -ldflags="-s -w" "./cmd/install" if %errorlevel% neq 0 ( pause exit /b %errorlevel% ) echo Building the router generator -go build ./router_gen +go build -ldflags="-s -w" ./router_gen if %errorlevel% neq 0 ( pause exit /b %errorlevel% ) echo Building the query generator -go build "./cmd/query_gen" +go build -ldflags="-s -w" "./cmd/query_gen" if %errorlevel% neq 0 ( pause exit /b %errorlevel% diff --git a/build_templates.bat b/build_templates.bat index c1419c68..d67fa836 100644 --- a/build_templates.bat +++ b/build_templates.bat @@ -2,7 +2,7 @@ echo Building the templates gosora.exe -build-templates echo Rebuilding the executable -go build -o gosora.exe +go build -ldflags="-s -w" -o gosora.exe if %errorlevel% neq 0 ( pause exit /b %errorlevel% diff --git a/cmd/query_gen/build.bat b/cmd/query_gen/build.bat index 41ecc3b6..3484c3e0 100644 --- a/cmd/query_gen/build.bat +++ b/cmd/query_gen/build.bat @@ -1,6 +1,6 @@ @echo off echo Building the query generator -go build +go build -ldflags="-s -w" if %errorlevel% neq 0 ( pause exit /b %errorlevel% diff --git a/cmd/query_gen/run.bat b/cmd/query_gen/run.bat index 6e122cc7..9e05f5b4 100644 --- a/cmd/query_gen/run.bat +++ b/cmd/query_gen/run.bat @@ -1,6 +1,6 @@ @echo off echo Building the query generator -go build +go build -ldflags="-s -w" if %errorlevel% neq 0 ( pause exit /b %errorlevel% diff --git a/dev-update-linux b/dev-update-linux index 52aa63e0..2e3df4f2 100644 --- a/dev-update-linux +++ b/dev-update-linux @@ -9,5 +9,5 @@ git stash apply echo "Patching Gosora" go generate -go build -o Patcher "./patcher" +go build -ldflags="-s -w" -o Patcher "./patcher" ./Patcher \ No newline at end of file diff --git a/dev-update-travis b/dev-update-travis index 87b106bc..79984ec9 100644 --- a/dev-update-travis +++ b/dev-update-travis @@ -1,4 +1,4 @@ echo "Building the patcher" go generate go get -u github.com/mailru/easyjson/... -go build -o Patcher "./patcher" \ No newline at end of file +go build -ldflags="-s -w" -o Patcher "./patcher" \ No newline at end of file diff --git a/dev-update.bat b/dev-update.bat index a2506ae3..5e1f4be8 100644 --- a/dev-update.bat +++ b/dev-update.bat @@ -28,5 +28,5 @@ if %errorlevel% neq 0 ( echo Patching Gosora go generate -go build ./patcher +go build -ldflags="-s -w" ./patcher patcher.exe \ No newline at end of file diff --git a/experimental/new-update.bat b/experimental/new-update.bat index 6ca0a538..f0026858 100644 --- a/experimental/new-update.bat +++ b/experimental/new-update.bat @@ -9,7 +9,7 @@ if %errorlevel% neq 0 ( echo Building the updater go generate -go build ./updater +go build -ldflags="-s -w" ./updater if %errorlevel% neq 0 ( pause exit /b %errorlevel% diff --git a/install-docker b/install-docker index 3fd5e6cb..db918af3 100644 --- a/install-docker +++ b/install-docker @@ -2,6 +2,6 @@ go get -u github.com/mailru/easyjson/... easyjson -pkg common go get -go build -o Installer "./cmd/install" +go build -ldflags="-s -w" -o Installer "./cmd/install" ./Installer --dbType=mysql --dbHost=localhost --dbUser=$MYSQL_USER --dbPassword=$MYSQL_PASSWORD --dbName=$MYSQL_DATABASE --shortSiteName=$SITE_SHORT_NAME --siteName=$SITE_NAME --siteURL=$SITE_URL --serverPort=$SERVER_PORT--secureServerPort=$SECURE_SERVER_PORT \ No newline at end of file diff --git a/install-linux b/install-linux index 2c4362b7..fa561ae3 100644 --- a/install-linux +++ b/install-linux @@ -4,7 +4,7 @@ easyjson -pkg common go get echo "Building the installer" -go build -o Installer "./cmd/install" +go build -ldflags="-s -w" -o Installer "./cmd/install" echo "Running the installer" ./Installer diff --git a/install.bat b/install.bat index 26064daf..65254def 100644 --- a/install.bat +++ b/install.bat @@ -21,7 +21,7 @@ if %errorlevel% neq 0 ( echo Building the installer go generate -go build "./cmd/install" +go build -ldflags="-s -w" "./cmd/install" if %errorlevel% neq 0 ( pause exit /b %errorlevel% diff --git a/pre-run-linux b/pre-run-linux index 2c8de7f7..5716b175 100644 --- a/pre-run-linux +++ b/pre-run-linux @@ -11,20 +11,20 @@ echo "Generating the JSON handlers" easyjson -pkg common echo "Building the router generator" -go build -o RouterGen "./router_gen" +go build -ldflags="-s -w" -o RouterGen "./router_gen" echo "Running the router generator" ./RouterGen echo "Building the query generator" -go build -o QueryGen "./cmd/query_gen" +go build -ldflags="-s -w" -o QueryGen "./cmd/query_gen" echo "Running the query generator" ./QueryGen echo "Building Gosora" -go build -o Gosora +go build -ldflags="-s -w" -o Gosora echo "Building the templates" ./Gosora -build-templates echo "Building Gosora... Again" -go build -o Gosora \ No newline at end of file +go build -ldflags="-s -w" -o Gosora \ No newline at end of file diff --git a/quick-update-linux b/quick-update-linux index f64f2b87..35e279ae 100644 --- a/quick-update-linux +++ b/quick-update-linux @@ -4,5 +4,5 @@ git pull origin master git stash apply echo "Patching Gosora" -go build -o Patcher "./patcher" +go build -ldflags="-s -w" -o Patcher "./patcher" ./Patcher \ No newline at end of file diff --git a/router_gen/build.bat b/router_gen/build.bat index 3e185c54..0485d956 100644 --- a/router_gen/build.bat +++ b/router_gen/build.bat @@ -1,6 +1,6 @@ @echo off echo Building the router generator -go build +go build -ldflags="-s -w" if %errorlevel% neq 0 ( pause exit /b %errorlevel% diff --git a/router_gen/run.bat b/router_gen/run.bat index a0e97282..8c360da5 100644 --- a/router_gen/run.bat +++ b/router_gen/run.bat @@ -1,6 +1,6 @@ @echo off echo Building the router generator -go build +go build -ldflags="-s -w" if %errorlevel% neq 0 ( pause exit /b %errorlevel% diff --git a/run-linux b/run-linux index ce5c2be1..188feb27 100644 --- a/run-linux +++ b/run-linux @@ -8,12 +8,12 @@ echo "Generating the dynamic code" go generate echo "Building the router generator" -go build -o RouterGen "./router_gen" +go build -ldflags="-s -w" -o RouterGen "./router_gen" echo "Running the router generator" ./RouterGen echo "Building the query generator" -go build -o QueryGen "./cmd/query_gen" +go build -ldflags="-s -w" -o QueryGen "./cmd/query_gen" echo "Running the query generator" ./QueryGen @@ -21,13 +21,13 @@ echo "Generating the JSON handlers" easyjson -pkg common echo "Building Gosora" -go build -o Gosora +go build -ldflags="-s -w" -o Gosora echo "Building the templates" ./Gosora -build-templates echo "Building Gosora... Again" -go build -o Gosora +go build -ldflags="-s -w" -o Gosora echo "Running Gosora" ./Gosora \ No newline at end of file diff --git a/run-linux-nowebsockets b/run-linux-nowebsockets index 5d7251df..788ab3fd 100644 --- a/run-linux-nowebsockets +++ b/run-linux-nowebsockets @@ -9,7 +9,7 @@ go generate echo "Building the router generator" cd ./router_gen -go build -o RouterGen +go build -ldflags="-s -w" -o RouterGen mv ./RouterGen .. cd .. echo "Running the router generator" @@ -17,7 +17,7 @@ echo "Running the router generator" echo "Building the query generator" cd ./cmd/query_gen -go build -o QueryGen +go build -ldflags="-s -w" -o QueryGen mv ./QueryGen ../.. cd ../.. echo "Running the query generator" @@ -27,13 +27,13 @@ echo "Generating the JSON handlers" easyjson -pkg common echo "Building Gosora" -go build -o Gosora -tags no_ws +go build -ldflags="-s -w" -o Gosora -tags no_ws echo "Building the templates" ./Gosora -build-templates echo "Building Gosora... Again" -go build -o Gosora -tags no_ws +go build -ldflags="-s -w" -o Gosora -tags no_ws echo "Running Gosora" ./Gosora diff --git a/run-linux-tests b/run-linux-tests index dbf25a02..8f530fe3 100644 --- a/run-linux-tests +++ b/run-linux-tests @@ -3,5 +3,5 @@ go generate echo Generating the JSON handlers easyjson -pkg common echo "Running tests" -go build -o mssqlBuild -tags mssql +go build -ldflags="-s -w" -o mssqlBuild -tags mssql go test -coverprofile c.out diff --git a/run-nowebsockets.bat b/run-nowebsockets.bat index bc9ebb9a..e06ef0de 100644 --- a/run-nowebsockets.bat +++ b/run-nowebsockets.bat @@ -15,7 +15,7 @@ if %errorlevel% neq 0 ( ) echo Building the router generator -go build ./router_gen +go build -ldflags="-s -w" ./router_gen if %errorlevel% neq 0 ( pause exit /b %errorlevel% @@ -28,7 +28,7 @@ if %errorlevel% neq 0 ( ) echo Building the query generator -go build "./cmd/query_gen" +go build -ldflags="-s -w" "./cmd/query_gen" if %errorlevel% neq 0 ( pause exit /b %errorlevel% @@ -44,7 +44,7 @@ echo Generating the JSON handlers easyjson -pkg common echo Building the executable -go build -o gosora.exe -tags no_ws +go build -ldflags="-s -w" -o gosora.exe -tags no_ws if %errorlevel% neq 0 ( pause exit /b %errorlevel% @@ -58,7 +58,7 @@ if %errorlevel% neq 0 ( ) echo Building the executable... again -go build -o gosora.exe -tags no_ws +go build -ldflags="-s -w" -o gosora.exe -tags no_ws if %errorlevel% neq 0 ( pause exit /b %errorlevel% diff --git a/run.bat b/run.bat index 936504f1..1169000a 100644 --- a/run.bat +++ b/run.bat @@ -15,7 +15,7 @@ if %errorlevel% neq 0 ( ) echo Building the router generator -go build ./router_gen +go build -ldflags="-s -w" ./router_gen if %errorlevel% neq 0 ( pause exit /b %errorlevel% @@ -28,7 +28,7 @@ if %errorlevel% neq 0 ( ) echo Building the query generator -go build "./cmd/query_gen" +go build -ldflags="-s -w" "./cmd/query_gen" if %errorlevel% neq 0 ( pause exit /b %errorlevel% @@ -44,7 +44,7 @@ echo Generating the JSON handlers easyjson -pkg common echo Building the executable -go build -o gosora.exe +go build -ldflags="-s -w" -o gosora.exe if %errorlevel% neq 0 ( pause exit /b %errorlevel% @@ -58,7 +58,7 @@ if %errorlevel% neq 0 ( ) echo Building the executable... again -go build -o gosora.exe +go build -ldflags="-s -w" -o gosora.exe if %errorlevel% neq 0 ( pause exit /b %errorlevel% diff --git a/run_mssql.bat b/run_mssql.bat index ed712f5d..1991c485 100644 --- a/run_mssql.bat +++ b/run_mssql.bat @@ -15,7 +15,7 @@ if %errorlevel% neq 0 ( ) echo Building the router generator -go build ./router_gen +go build -ldflags="-s -w" ./router_gen if %errorlevel% neq 0 ( pause exit /b %errorlevel% @@ -28,7 +28,7 @@ if %errorlevel% neq 0 ( ) echo Building the query generator -go build "./cmd/query_gen" +go build -ldflags="-s -w" "./cmd/query_gen" if %errorlevel% neq 0 ( pause exit /b %errorlevel% @@ -44,7 +44,7 @@ echo Generating the JSON handlers easyjson -pkg common echo Building the executable -go build -o gosora.exe -tags mssql +go build -ldflags="-s -w" -o gosora.exe -tags mssql if %errorlevel% neq 0 ( pause exit /b %errorlevel% @@ -58,7 +58,7 @@ if %errorlevel% neq 0 ( ) echo Building the executable... again -go build -o gosora.exe -tags mssql +go build -ldflags="-s -w" -o gosora.exe -tags mssql if %errorlevel% neq 0 ( pause exit /b %errorlevel% diff --git a/run_tests.bat b/run_tests.bat index 18d8368b..4ce1cfd8 100644 --- a/run_tests.bat +++ b/run_tests.bat @@ -15,7 +15,7 @@ if %errorlevel% neq 0 ( ) echo Building the router generator -go build ./router_gen +go build -ldflags="-s -w" ./router_gen if %errorlevel% neq 0 ( pause exit /b %errorlevel% @@ -28,7 +28,7 @@ if %errorlevel% neq 0 ( ) echo Building the query generator -go build "./cmd/query_gen" +go build -ldflags="-s -w" "./cmd/query_gen" if %errorlevel% neq 0 ( pause exit /b %errorlevel% diff --git a/run_tests_mssql.bat b/run_tests_mssql.bat index 943690c5..b5899562 100644 --- a/run_tests_mssql.bat +++ b/run_tests_mssql.bat @@ -15,7 +15,7 @@ if %errorlevel% neq 0 ( ) echo Building the router generator -go build ./router_gen +go build -ldflags="-s -w" ./router_gen if %errorlevel% neq 0 ( pause exit /b %errorlevel% @@ -28,7 +28,7 @@ if %errorlevel% neq 0 ( ) echo Building the query generator -go build "./cmd/query_gen" +go build -ldflags="-s -w" "./cmd/query_gen" if %errorlevel% neq 0 ( pause exit /b %errorlevel%