Adding commented out build script code to shorten ("optimize") Lua scripts.
parent
2772c9905a
commit
e05231b293
|
@ -0,0 +1,3 @@
|
|||
[submodule "tools/luasrcdiet"]
|
||||
path = tools/luasrcdiet
|
||||
url = https://github.com/LuaDist/luasrcdiet
|
35
build.bat
35
build.bat
|
@ -1,8 +1,37 @@
|
|||
@echo off
|
||||
path %path%;%programfiles(x86)%\Steam\SteamApps\common\GarrysMod\bin
|
||||
@echo off & setlocal enabledelayedexpansion
|
||||
|
||||
path %programfiles(x86)%\lua\5.1\;%path%;%programfiles(x86)%\Steam\SteamApps\common\GarrysMod\bin
|
||||
|
||||
if not exist builds mkdir builds
|
||||
mkdir tmp
|
||||
robocopy . tmp *.json *.lua *.wav *.mp3 *.jpg *.png *.txt /E /XD tmp /XF LICENSE.txt
|
||||
|
||||
:: Optimize LUA files
|
||||
::set cutofflen=
|
||||
::set foo=%~dp0
|
||||
:::_cl1
|
||||
::if not "!foo!"=="" (
|
||||
:: set /a cutofflen += 1
|
||||
:: set foo=!foo:~1!
|
||||
:: goto _cl1
|
||||
::)
|
||||
::for /R lua %%f in (*.lua) do (
|
||||
:: set B=%%~ff
|
||||
:: set B=!B:~%cutofflen%!
|
||||
:: if not exist "!~dpB!" (
|
||||
:: mkdir "!~dpB!"
|
||||
:: )
|
||||
:: echo Optimizing: !B!
|
||||
:: pushd tools\luasrcdiet
|
||||
:: LuaSrcDiet.lua ..\..\!B! --quiet -o ..\..\tmp\!B!
|
||||
:: popd
|
||||
::)
|
||||
|
||||
:: Copy over resources
|
||||
robocopy . tmp *.json *.lua *.wav *.mp3 *.jpg *.png *.txt /MIR /XD tools /XD tmp /XF LICENSE.txt /NJH /NJS /NDL /NP /NS
|
||||
|
||||
:: Create the GMA file
|
||||
gmad create -folder "tmp" -out "builds\disguiser_swep.gma"
|
||||
|
||||
:: Clean up
|
||||
rmdir /q /s tmp
|
||||
pause
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 486129fa1ef1539071d14a366d686f3892c3d43f
|
Loading…
Reference in New Issue