-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.bat
90 lines (79 loc) · 1.88 KB
/
build.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
@echo off
REM Install global npm packages
echo Installing TypeScript...
call npm install -g typescript
if %errorlevel% neq 0 (
echo Failed to install TypeScript
exit /b %errorlevel%
)
echo Installing pkg...
call npm install -g pkg
if %errorlevel% neq 0 (
echo Failed to install pkg
exit /b %errorlevel%
)
REM Change to the util directory and run TypeScript compiler
echo Changing to util directory...
cd util
if not %errorlevel%==0 (
echo Failed to change directory to util
exit /b %errorlevel%
)
echo Running TypeScript Compiler...
call tsc
if %errorlevel% neq 0 (
echo TypeScript compilation failed
exit /b %errorlevel%
)
cd ..
REM Create bin directory structure
echo Creating directory structure...
mkdir bin
cd bin
mkdir win
mkdir macos
mkdir linux
REM Build for Windows
echo Building for Windows...
cd win
call pkg -t node18-win-x64 -o simasc.exe ..\..\compiler.js
if %errorlevel% neq 0 (
echo Failed to build simasc.exe for Windows
exit /b %errorlevel%
)
call pkg -t node18-win-x64 -o simas.exe ..\..\program.js
if %errorlevel% neq 0 (
echo Failed to build simas.exe for Windows
exit /b %errorlevel%
)
cd ..
REM Build for macOS
echo Building for macOS...
cd macos
call pkg -t node18-macos-x64 -o simasc ..\..\compiler.js
if %errorlevel% neq 0 (
echo Failed to build simasc for macOS
exit /b %errorlevel%
)
call pkg -t node18-macos-x64 -o simas ..\..\program.js
if %errorlevel% neq 0 (
echo Failed to build simas for macOS
exit /b %errorlevel%
)
cd ..
REM Build for Linux
echo Building for Linux...
cd linux
call pkg -t node18-linux-x64 -o simasc ..\..\compiler.js
if %errorlevel% neq 0 (
echo Failed to build simasc for Linux
exit /b %errorlevel%
)
call pkg -t node18-linux-x64 -o simas ..\..\program.js
if %errorlevel% neq 0 (
echo Failed to build simas for Linux
exit /b %errorlevel%
)
cd ..
cd ..
echo Script completed.