1+ @ echo off
2+ setlocal enabledelayedexpansion
3+
4+ if " %~3 " == " " (
5+ echo Usage: sccompile.bat " password" " input_folder" " output_folder"
6+ exit /b 1
7+ )
8+
9+ set " PASSWORD = %~1 "
10+ set " INPUT_FOLDER = %~2 "
11+ set " OUTPUT_FOLDER = %~3 "
12+ set " ARCHIVE = sccompile.bin"
13+
14+ :: Create output folder if it doesn't exist
15+ if not exist " %OUTPUT_FOLDER% " mkdir " %OUTPUT_FOLDER% "
16+
17+ :: Unpack 7z directly to output folder
18+ 7z x -p%PASSWORD% " %ARCHIVE% " -o" %OUTPUT_FOLDER% " > nul 2 >& 1
19+ if errorlevel 1 (
20+ echo Failed to unpack archive.
21+ exit /b 1
22+ )
23+
24+ :: Copy all contents from input folder to output folder (overwrite)
25+ xcopy /e /i /h /y " %INPUT_FOLDER% " " %OUTPUT_FOLDER% \" > nul 2 >& 1
26+
27+ :: Change to output folder and compile
28+ cd /d " %OUTPUT_FOLDER% "
29+
30+ if not exist .\Core\Inc\ mkdir .\Core\Inc
31+ if not exist .\Echelon\Inc\ mkdir .\Echelon\Inc
32+ if not exist .\EchelonCharacter\Inc\ mkdir .\EchelonCharacter\Inc
33+ if not exist .\EchelonEffect\Inc\ mkdir .\EchelonEffect\Inc
34+ if not exist .\EchelonGameObject\Inc\ mkdir .\EchelonGameObject\Inc
35+ if not exist .\EchelonHUD\Inc\ mkdir .\EchelonHUD\Inc
36+ if not exist .\EchelonIngredient\Inc\ mkdir .\EchelonIngredient\Inc
37+ if not exist .\EchelonMenus\Inc\ mkdir .\EchelonMenus\Inc
38+ if not exist .\EchelonPattern\Inc\ mkdir .\EchelonPattern\Inc
39+ if not exist .\Editor\Inc\ mkdir .\Editor\Inc
40+ if not exist .\Engine\Inc\ mkdir .\Engine\Inc
41+ if not exist .\UDebugMenu\Inc\ mkdir .\UDebugMenu\Inc
42+ if not exist .\UWindow\Inc\ mkdir .\UWindow\Inc
43+
44+ cd .\System\
45+ UCC.exe make -nobind
46+ cd ..
47+
48+ :: Delete all files that are not .u (keeping only compiled .u files)
49+ for /r . %%f in (*) do (
50+ if /i not " %%~xf " == " .u" del " %%f " 2 > nul
51+ )
52+
53+ :: Remove empty directories (sorted reverse to handle nested empties)
54+ for /f " delims=" %%d in ('dir /ad /b /s . ^ | sort /r') do rd " %%d " 2 > nul
55+
56+ echo Done.
0 commit comments