Adding commented out build script code to shorten ("optimize") Lua scripts.

master
Icedream 2013-12-25 18:23:54 +01:00
parent 2772c9905a
commit e05231b293
3 changed files with 37 additions and 4 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "tools/luasrcdiet"]
path = tools/luasrcdiet
url = https://github.com/LuaDist/luasrcdiet

View File

@ -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

1
tools/luasrcdiet Submodule

@ -0,0 +1 @@
Subproject commit 486129fa1ef1539071d14a366d686f3892c3d43f