diff --git a/build-linux b/build-linux index eb757f99..8ae81a62 100644 --- a/build-linux +++ b/build-linux @@ -5,20 +5,31 @@ rm -f gen_*.go rm -f tmpl_client/template_* rm -f tmpl_client/tmpl_* rm -f ./Gosora +rm -f ./common/gen_extend.go echo "Building the router generator" go build -ldflags="-s -w" -o RouterGen "./router_gen" echo "Running the router generator" ./RouterGen +echo "Building the hook stub generator" +go build -ldflags="-s -w" -o HookStubGen "./cmd/hook_stub_gen" +echo "Running the hook stub generator" +./HookStubGen + +echo "Building the hook generator" +go build -tags hookgen -ldflags="-s -w" -o HookGen "./cmd/hook_gen" +echo "Running the hook generator" +./HookGen + +echo "Generating the JSON handlers" +easyjson -pkg common + echo "Building the query generator" go build -ldflags="-s -w" -o QueryGen "./cmd/query_gen" echo "Running the query generator" ./QueryGen -echo "Generating the JSON handlers" -easyjson -pkg common - echo "Building Gosora" go generate go build -ldflags="-s -w" -o Gosora diff --git a/build-linux-nowebsockets b/build-linux-nowebsockets index 82438aa3..048a219c 100644 --- a/build-linux-nowebsockets +++ b/build-linux-nowebsockets @@ -5,32 +5,34 @@ rm -f gen_*.go rm -f tmpl_client/template_* rm -f tmpl_client/tmpl_* rm -f ./Gosora +rm -f ./common/gen_extend.go echo "Building the router generator" -cd ./router_gen -go build -ldflags="-s -w" -o RouterGen -mv ./RouterGen .. -cd .. +go build -ldflags="-s -w" -o RouterGen "./router_gen" echo "Running the router generator" ./RouterGen -echo "Building the query generator" -cd ./cmd/query_gen -go build -ldflags="-s -w" -o QueryGen -mv ./QueryGen ../.. -cd ../.. -echo "Running the query generator" -./QueryGen +echo "Building the hook stub generator" +go build -ldflags="-s -w" -o HookStubGen "./cmd/hook_stub_gen" +echo "Running the hook stub generator" +./HookStubGen + +echo "Building the hook generator" +go build -tags hookgen -ldflags="-s -w" -o HookGen "./cmd/hook_gen" +echo "Running the hook generator" +./HookGen echo "Generating the JSON handlers" easyjson -pkg common +echo "Building the query generator" +go build -ldflags="-s -w" -o QueryGen "./cmd/query_gen" +echo "Running the query generator" +./QueryGen + echo "Building Gosora" go generate go build -ldflags="-s -w" -o Gosora -tags no_ws echo "Building the installer" -cd ./install -go build -ldflags="-s -w" -o Installer -mv ./Installer .. -cd .. +go build -ldflags="-s -w" -o Installer "./install" \ No newline at end of file diff --git a/build-nowebsockets.bat b/build-nowebsockets.bat index 1b405784..0a0f9f31 100644 --- a/build-nowebsockets.bat +++ b/build-nowebsockets.bat @@ -3,8 +3,9 @@ rem TODO: Make these deletes a little less noisy del "template_*.go" del "tmpl_*.go" del "gen_*.go" -del "tmpl_client/template_*" -del "tmpl_client/tmpl_*" +del ".\tmpl_client\template_*" +del ".\tmpl_client\tmpl_*" +del ".\common\gen_extend.go" del "gosora.exe" echo Generating the dynamic code @@ -38,6 +39,20 @@ if %errorlevel% neq 0 ( exit /b %errorlevel% ) +echo Building the hook stub generator +go build -ldflags="-s -w" "./cmd/hook_stub_gen" +if %errorlevel% neq 0 ( + pause + exit /b %errorlevel% +) + +echo Building the hook generator +go build -tags hookgen -ldflags="-s -w" "./cmd/hook_gen" +if %errorlevel% neq 0 ( + pause + exit /b %errorlevel% +) + echo Building the query generator go build -ldflags="-s -w" "./cmd/query_gen" if %errorlevel% neq 0 ( diff --git a/build.bat b/build.bat index 809e6dc1..d3aa36d6 100644 --- a/build.bat +++ b/build.bat @@ -3,10 +3,9 @@ rem TODO: Make these deletes a little less noisy del "template_*.go" del "tmpl_*.go" del "gen_*.go" -cd tmpl_client -del "template_*" -del "tmpl_*" -cd .. +del ".\tmpl_client\template_*" +del ".\tmpl_client\tmpl_*" +del ".\common\gen_extend.go" del "gosora.exe" echo Generating the dynamic code @@ -40,6 +39,20 @@ if %errorlevel% neq 0 ( exit /b %errorlevel% ) +echo Building the hook stub generator +go build -ldflags="-s -w" "./cmd/hook_stub_gen" +if %errorlevel% neq 0 ( + pause + exit /b %errorlevel% +) + +echo Building the hook generator +go build -tags hookgen -ldflags="-s -w" "./cmd/hook_gen" +if %errorlevel% neq 0 ( + pause + exit /b %errorlevel% +) + echo Building the query generator go build -ldflags="-s -w" "./cmd/query_gen" if %errorlevel% neq 0 ( diff --git a/docs/installation.md b/docs/installation.md index cebee4d5..5cae7ebd 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -151,6 +151,14 @@ go build -ldflags="-s -w" -o RouterGen "./router_gen" ./RouterGen +go build -ldflags="-s -w" -o HookStubGen "./cmd/hook_stub_gen" + +./HookStubGen + +go build -ldflags="-s -w" -o HookGen "./cmd/hook_gen" + +./HookGen + go build -ldflags="-s -w" -o QGen "./cmd/query_gen" ./QGen @@ -203,6 +211,14 @@ go build -ldflags="-s -w" "./router_gen" router_gen.exe +go build -ldflags="-s -w" "./cmd/hook_stub_gen" + +hook_stub_gen.exe + +go build -ldflags="-s -w" "./cmd/hook_gen" + +hook_gen.exe + easyjson -pkg common go build -ldflags="-s -w" "./cmd/query_gen" @@ -224,4 +240,6 @@ I'm looking into minimising the number of go gets for the advanced build and to If systemd gives you no permission errors, then make sure you `chown`, `chgrp` and `chmod` the files and folders appropriately. -You don't need `-ldflags="-s -w"` in any of the commands, however it will make compilation times faster. \ No newline at end of file +You don't need `-ldflags="-s -w"` in any of the commands, however it will make compilation times faster. + +Building and running HookGen is optional, but strips unneccesary hook indirects for plugins you don't use. \ No newline at end of file diff --git a/pre-run-linux b/pre-run-linux index 3c32726f..462c1a9e 100644 --- a/pre-run-linux +++ b/pre-run-linux @@ -5,6 +5,7 @@ rm -f gen_*.go rm -f tmpl_client/template_* rm -f tmpl_client/tmpl_* rm -f ./Gosora +rm -f ./common/gen_extend.go echo "Generating the dynamic code" go generate @@ -17,14 +18,24 @@ go build -ldflags="-s -w" -o RouterGen "./router_gen" echo "Running the router generator" ./RouterGen +echo "Building the hook stub generator" +go build -ldflags="-s -w" -o HookStubGen "./cmd/hook_stub_gen" +echo "Running the hook stub generator" +./HookStubGen + +echo "Building the hook generator" +go build -tags hookgen -ldflags="-s -w" -o HookGen "./cmd/hook_gen" +echo "Running the hook generator" +./HookGen + +echo "Building Gosora" +go build -ldflags="-s -w" -o Gosora + echo "Building the query generator" go build -ldflags="-s -w" -o QueryGen "./cmd/query_gen" echo "Running the query generator" ./QueryGen -echo "Building Gosora" -go build -ldflags="-s -w" -o Gosora - echo "Building the templates" ./Gosora -build-templates diff --git a/run-linux b/run-linux index 773c9364..1588f77e 100644 --- a/run-linux +++ b/run-linux @@ -5,6 +5,7 @@ rm -f gen_*.go rm -f tmpl_client/template_* rm -f tmpl_client/tmpl_* rm -f ./Gosora +rm -f ./common/gen_extend.go echo "Generating the dynamic code" go generate @@ -14,14 +15,24 @@ go build -ldflags="-s -w" -o RouterGen "./router_gen" echo "Running the router generator" ./RouterGen -echo "Building the query generator" -go build -ldflags="-s -w" -o QueryGen "./cmd/query_gen" -echo "Running the query generator" -./QueryGen +echo "Building the hook stub generator" +go build -ldflags="-s -w" -o HookStubGen "./cmd/hook_stub_gen" +echo "Running the hook stub generator" +./HookStubGen + +echo "Building the hook generator" +go build -tags hookgen -ldflags="-s -w" -o HookGen "./cmd/hook_gen" +echo "Running the hook generator" +./HookGen echo "Generating the JSON handlers" easyjson -pkg common +echo "Building the query generator" +go build -ldflags="-s -w" -o QGen "./cmd/query_gen" +echo "Running the query generator" +./QGen + echo "Building Gosora" go build -ldflags="-s -w" -o Gosora diff --git a/run-linux-nowebsockets b/run-linux-nowebsockets index 1f6187a0..c3a513b3 100644 --- a/run-linux-nowebsockets +++ b/run-linux-nowebsockets @@ -5,29 +5,34 @@ rm -f gen_*.go rm -f tmpl_client/template_* rm -f tmpl_client/tmpl_* rm -f ./Gosora +rm -f ./common/gen_extend.go echo "Generating the dynamic code" go generate echo "Building the router generator" -cd ./router_gen -go build -ldflags="-s -w" -o RouterGen -mv ./RouterGen .. -cd .. +go build -ldflags="-s -w" -o RouterGen "./router_gen" echo "Running the router generator" ./RouterGen -echo "Building the query generator" -cd ./cmd/query_gen -go build -ldflags="-s -w" -o QueryGen -mv ./QueryGen ../.. -cd ../.. -echo "Running the query generator" -./QueryGen +echo "Building the hook stub generator" +go build -ldflags="-s -w" -o HookStubGen "./cmd/hook_stub_gen" +echo "Running the hook stub generator" +./HookStubGen + +echo "Building the hook generator" +go build -tags hookgen -ldflags="-s -w" -o HookGen "./cmd/hook_gen" +echo "Running the hook generator" +./HookGen echo "Generating the JSON handlers" easyjson -pkg common +echo "Building the query generator" +go build -ldflags="-s -w" -o QueryGen "./cmd/query_gen" +echo "Running the query generator" +./QueryGen + echo "Building Gosora" go build -ldflags="-s -w" -o Gosora -tags no_ws diff --git a/run-nowebsockets.bat b/run-nowebsockets.bat index 1ecdb8a9..4af4b0d7 100644 --- a/run-nowebsockets.bat +++ b/run-nowebsockets.bat @@ -3,10 +3,9 @@ rem TODO: Make these deletes a little less noisy del "template_*.go" del "tmpl_*.go" del "gen_*.go" -cd tmpl_client -del "template_*" -del "tmpl_*" -cd .. +del ".\tmpl_client\template_*" +del ".\tmpl_client\tmpl_*" +del ".\common\gen_extend.go" del "gosora.exe" echo Generating the dynamic code @@ -29,6 +28,35 @@ if %errorlevel% neq 0 ( exit /b %errorlevel% ) +echo Building the hook stub generator +go build -ldflags="-s -w" "./cmd/hook_stub_gen" +if %errorlevel% neq 0 ( + pause + exit /b %errorlevel% +) +echo Running the hook stub generator +hook_stub_gen.exe +if %errorlevel% neq 0 ( + pause + exit /b %errorlevel% +) + +echo Building the hook generator +go build -tags hookgen -ldflags="-s -w" "./cmd/hook_gen" +if %errorlevel% neq 0 ( + pause + exit /b %errorlevel% +) +echo Running the hook generator +hook_gen.exe +if %errorlevel% neq 0 ( + pause + exit /b %errorlevel% +) + +echo Generating the JSON handlers +easyjson -pkg common + echo Building the query generator go build -ldflags="-s -w" "./cmd/query_gen" if %errorlevel% neq 0 ( @@ -42,9 +70,6 @@ if %errorlevel% neq 0 ( exit /b %errorlevel% ) -echo Generating the JSON handlers -easyjson -pkg common - echo Building the executable go build -ldflags="-s -w" -o gosora.exe -tags no_ws if %errorlevel% neq 0 ( diff --git a/run.bat b/run.bat index 0613395a..475f2701 100644 --- a/run.bat +++ b/run.bat @@ -3,10 +3,9 @@ rem TODO: Make these deletes a little less noisy del "template_*.go" del "tmpl_*.go" del "gen_*.go" -cd tmpl_client -del "template_*" -del "tmpl_*" -cd .. +del ".\tmpl_client\template_*" +del ".\tmpl_client\tmpl_*" +del ".\common\gen_extend.go" del "gosora.exe" echo Generating the dynamic code @@ -29,6 +28,35 @@ if %errorlevel% neq 0 ( exit /b %errorlevel% ) +echo Building the hook stub generator +go build -ldflags="-s -w" "./cmd/hook_stub_gen" +if %errorlevel% neq 0 ( + pause + exit /b %errorlevel% +) +echo Running the hook stub generator +hook_stub_gen.exe +if %errorlevel% neq 0 ( + pause + exit /b %errorlevel% +) + +echo Building the hook generator +go build -tags hookgen -ldflags="-s -w" "./cmd/hook_gen" +if %errorlevel% neq 0 ( + pause + exit /b %errorlevel% +) +echo Running the hook generator +hook_gen.exe +if %errorlevel% neq 0 ( + pause + exit /b %errorlevel% +) + +echo Generating the JSON handlers +easyjson -pkg common + echo Building the query generator go build -ldflags="-s -w" "./cmd/query_gen" if %errorlevel% neq 0 ( @@ -42,9 +70,6 @@ if %errorlevel% neq 0 ( exit /b %errorlevel% ) -echo Generating the JSON handlers -easyjson -pkg common - echo Building the executable go build -ldflags="-s -w" -o gosora.exe if %errorlevel% neq 0 ( diff --git a/run_mssql.bat b/run_mssql.bat index 906c0182..d6cab5af 100644 --- a/run_mssql.bat +++ b/run_mssql.bat @@ -3,10 +3,9 @@ rem TODO: Make these deletes a little less noisy del "template_*.go" del "tmpl_*.go" del "gen_*.go" -cd tmpl_client -del "template_*" -del "tmpl_*" -cd .. +del ".\tmpl_client\template_*" +del ".\tmpl_client\tmpl_*" +del ".\common\gen_extend.go" del "gosora.exe" echo Generating the dynamic code @@ -29,6 +28,35 @@ if %errorlevel% neq 0 ( exit /b %errorlevel% ) +echo Building the hook stub generator +go build -ldflags="-s -w" "./cmd/hook_stub_gen" +if %errorlevel% neq 0 ( + pause + exit /b %errorlevel% +) +echo Running the hook stub generator +hook_stub_gen.exe +if %errorlevel% neq 0 ( + pause + exit /b %errorlevel% +) + +echo Building the hook generator +go build -tags hookgen -ldflags="-s -w" "./cmd/hook_gen" +if %errorlevel% neq 0 ( + pause + exit /b %errorlevel% +) +echo Running the hook generator +hook_gen.exe +if %errorlevel% neq 0 ( + pause + exit /b %errorlevel% +) + +echo Generating the JSON handlers +easyjson -pkg common + echo Building the query generator go build -ldflags="-s -w" "./cmd/query_gen" if %errorlevel% neq 0 ( @@ -42,9 +70,6 @@ if %errorlevel% neq 0 ( exit /b %errorlevel% ) -echo Generating the JSON handlers -easyjson -pkg common - echo Building the executable go build -ldflags="-s -w" -o gosora.exe -tags mssql if %errorlevel% neq 0 ( diff --git a/run_tests.bat b/run_tests.bat index a7ad864e..0b392d64 100644 --- a/run_tests.bat +++ b/run_tests.bat @@ -3,10 +3,9 @@ rem TODO: Make these deletes a little less noisy del "template_*.go" del "tmpl_*.go" del "gen_*.go" -cd tmpl_client -del "template_*" -del "tmpl_*" -cd .. +del ".\tmpl_client\template_*" +del ".\tmpl_client\tmpl_*" +del ".\common\gen_extend.go" del "gosora.exe" echo Generating the dynamic code @@ -29,6 +28,35 @@ if %errorlevel% neq 0 ( exit /b %errorlevel% ) +echo Building the hook stub generator +go build -ldflags="-s -w" "./cmd/hook_stub_gen" +if %errorlevel% neq 0 ( + pause + exit /b %errorlevel% +) +echo Running the hook stub generator +hook_stub_gen.exe +if %errorlevel% neq 0 ( + pause + exit /b %errorlevel% +) + +echo Building the hook generator +go build -tags hookgen -ldflags="-s -w" "./cmd/hook_gen" +if %errorlevel% neq 0 ( + pause + exit /b %errorlevel% +) +echo Running the hook generator +hook_gen.exe +if %errorlevel% neq 0 ( + pause + exit /b %errorlevel% +) + +echo Generating the JSON handlers +easyjson -pkg common + echo Building the query generator go build -ldflags="-s -w" "./cmd/query_gen" if %errorlevel% neq 0 ( @@ -42,9 +70,6 @@ if %errorlevel% neq 0 ( exit /b %errorlevel% ) -echo Generating the JSON handlers -easyjson -pkg common - echo Building the executable go test if %errorlevel% neq 0 ( diff --git a/run_tests_mssql.bat b/run_tests_mssql.bat index 36a841a1..12aba2bb 100644 --- a/run_tests_mssql.bat +++ b/run_tests_mssql.bat @@ -3,10 +3,9 @@ rem TODO: Make these deletes a little less noisy del "template_*.go" del "tmpl_*.go" del "gen_*.go" -cd tmpl_client -del "template_*" -del "tmpl_*" -cd .. +del ".\tmpl_client\template_*" +del ".\tmpl_client\tmpl_*" +del ".\common\gen_extend.go" del "gosora.exe" echo Generating the dynamic code @@ -29,6 +28,35 @@ if %errorlevel% neq 0 ( exit /b %errorlevel% ) +echo Building the hook stub generator +go build -ldflags="-s -w" "./cmd/hook_stub_gen" +if %errorlevel% neq 0 ( + pause + exit /b %errorlevel% +) +echo Running the hook stub generator +hook_stub_gen.exe +if %errorlevel% neq 0 ( + pause + exit /b %errorlevel% +) + +echo Building the hook generator +go build -tags hookgen -ldflags="-s -w" "./cmd/hook_gen" +if %errorlevel% neq 0 ( + pause + exit /b %errorlevel% +) +echo Running the hook generator +hook_gen.exe +if %errorlevel% neq 0 ( + pause + exit /b %errorlevel% +) + +echo Generating the JSON handlers +easyjson -pkg common + echo Building the query generator go build -ldflags="-s -w" "./cmd/query_gen" if %errorlevel% neq 0 ( @@ -42,9 +70,6 @@ if %errorlevel% neq 0 ( exit /b %errorlevel% ) -echo Generating the JSON handlers -easyjson -pkg common - echo Building the executable go test -tags mssql if %errorlevel% neq 0 (