2017-04-10 01:05:20 +00:00
set PATH = %PATH% ;C:\Program Files (x86)\git\bin;C:\Program Files\git\bin
2015-07-15 03:10:47 +00:00
2015-02-02 23:44:48 +00:00
if " %1 " == " " (
SET NAME = BizHawk.zip
) else (
SET NAME = %1
)
2015-07-15 03:10:47 +00:00
git --version > NUL
@ if errorlevel 1 goto MISSINGGIT
2014-09-24 23:53:13 +00:00
2020-12-04 20:40:43 +00:00
dotnet build ..\BizHawk.sln -c Release --no-incremental
2021-12-09 04:07:38 +00:00
@ if not errorlevel 0 goto DOTNETBUILDFAILED
2020-12-04 20:40:43 +00:00
rem -p:Platform="Any CPU"
2023-03-16 00:42:52 +00:00
rem -p:RunAnalyzersDuringBuild=true
2015-02-02 22:07:19 +00:00
2014-07-23 00:31:00 +00:00
rmdir /s /q temp
2015-02-02 23:44:48 +00:00
del /s %NAME%
2017-06-12 22:39:52 +00:00
cd ..\output
2012-10-29 08:37:22 +00:00
2015-12-10 12:57:02 +00:00
rem Now, we're about to zip and then unzip. Why, you ask? Because that's just the way this evolved.
2024-05-05 01:01:11 +00:00
..\dist\zip.exe -X -r ..\Dist\%NAME% EmuHawk.exe EmuHawk.exe.config DiscoHawk.exe DiscoHawk.exe.config defctrl.json EmuHawkMono.sh dll Shaders gamedb Tools NES\Palettes Lua Gameboy\Palettes overlay -x *.pdb -x *.lib -x *.pgd -x *.ipdb -x *.iobj -x *.exp -x *.ilk
2014-07-23 00:31:00 +00:00
cd ..\Dist
2015-02-02 23:44:48 +00:00
.\unzip.exe %NAME% -d temp
del %NAME%
2014-07-23 00:31:00 +00:00
2015-12-10 12:57:02 +00:00
rem Remove things we can't allow the user's junky files to pollute the dist with. We'll export fresh copies from git
2014-07-23 00:31:00 +00:00
rmdir /s /q temp\lua
2015-07-15 03:10:47 +00:00
rmdir /s /q temp\firmware
2015-12-10 12:57:02 +00:00
rmdir /s /q gitsucks
2017-06-12 22:39:52 +00:00
git --git-dir ../.git archive --format zip --output lua.zip HEAD Assets/Lua
git --git-dir ../.git archive --format zip --output firmware.zip HEAD output/Firmware
2015-12-20 17:13:32 +00:00
2015-07-15 03:10:47 +00:00
unzip lua.zip -d gitsucks
rem del lua.zip
2016-09-01 18:22:57 +00:00
move gitsucks\Assets\Lua temp
2015-07-15 03:10:47 +00:00
unzip Firmware.zip -d gitsucks
rem del firmware.zip
2017-06-12 22:39:52 +00:00
move gitsucks\output\Firmware temp
2015-07-15 03:10:47 +00:00
rmdir /s /q gitsucks
rem remove UPX from any files we have checked in, because people's lousy security software hates it
2016-03-24 21:42:33 +00:00
rem: wait, why did I comment this out? did it have to do with CGC not roundtripping de-UPXing? then we should just not UPX it in the first place (but it's big)
upx -d temp\dll\*.dll
upx -d temp\dll\*.exe
upx -d temp\*.exe
2016-02-02 23:48:02 +00:00
2016-11-13 00:27:39 +00:00
rem dont need docs xml for assemblies and whatnot
del temp\dll\*.xml
2016-02-02 23:48:02 +00:00
cd temp
2015-12-10 12:57:02 +00:00
rem Patch up working dir with a few other things we want
2016-03-24 21:42:33 +00:00
mkdir Firmware
2015-12-10 12:57:02 +00:00
rem Build the final zip
2015-02-02 23:44:48 +00:00
..\zip.exe -X -9 -r ..\%NAME% . -i \*
2014-07-23 00:31:00 +00:00
cd ..
2015-12-10 12:57:02 +00:00
rem DONE!
2014-07-23 00:31:00 +00:00
rmdir /s /q temp
2014-09-24 23:53:13 +00:00
goto END
2021-12-09 04:07:38 +00:00
: DOTNETBUILDFAILED
set ERRORLEVEL = 1
@ echo dotnet build failed. Usual cause: user committed broken code, or unavailable dotnet sdk
2017-02-23 10:51:47 +00:00
goto END
2021-12-09 04:07:38 +00:00
2015-07-15 03:10:47 +00:00
: MISSINGGIT
2021-12-09 04:07:38 +00:00
set ERRORLEVEL = 1
2015-07-15 03:10:47 +00:00
@ echo missing git.exe. can't make distro without that.
2015-02-02 23:44:48 +00:00
: END