-
Notifications
You must be signed in to change notification settings - Fork 1
/
build_src.bat
30 lines (26 loc) · 1.21 KB
/
build_src.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
@echo off
setlocal enabledelayedexpansion
echo Copying module files
xcopy ".\node_modules\antlr4\src\antlr4\" ".\build\csinterp\node_modules\antlr4\" /s /e /y
echo Converting C# Builtin Libraries into Typescript
set generatedBuiltinCSharpLibraryPath=.\src\generated-builtinCSharpLibraries
if exist %generatedBuiltinCSharpLibraryPath% (rmdir /s /q %generatedBuiltinCSharpLibraryPath%)
mkdir %generatedBuiltinCSharpLibraryPath%
for %%i in (".\BuiltinCSharpLibraries\*.cs") do (
set destinationFile=%generatedBuiltinCSharpLibraryPath%\%%~nxi.ts
echo // This is an auto-generated file. Do not edit this file directly. > !destinationFile!
echo // Edit the C# source file ..\..\BuiltinCSharpLibraries\%%~nxi then use the build script to regenerate this file. >> !destinationFile!
echo const csharpCode = ` >> !destinationFile!
set csharpCodeContent=
for /f "usebackq delims=" %%c in (%%i) do (
set csharpCodeContent=!csharpCodeContent!%%c
)
echo !csharpCodeContent! >> !destinationFile!
echo `; >> !destinationFile!
echo export default csharpCode; >> !destinationFile!
echo Converted %%i into !destinationFile!
)
echo Building TypeScript
call npm run build
echo Build complete
pause