From b44ecc1958f6e6304ef4460d7e0800f6ad7e9cab Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Tue, 17 Dec 2019 00:40:49 +0000 Subject: [PATCH] Tools: Added build scripts for Windows --- ElectronClient/build.bat | 16 ++++++++++++++++ ElectronClient/build.sh | 22 +++------------------- ElectronClient/run.bat | 9 +++++++++ 3 files changed, 28 insertions(+), 19 deletions(-) create mode 100644 ElectronClient/build.bat create mode 100644 ElectronClient/run.bat diff --git a/ElectronClient/build.bat b/ElectronClient/build.bat new file mode 100644 index 000000000..90849ee24 --- /dev/null +++ b/ElectronClient/build.bat @@ -0,0 +1,16 @@ +@echo off +setlocal +SET mypath=%~dp0 +set script_dir=%mypath:~0,-1% + +xcopy /C /I /H /R /Y /S /Q %script_dir%\..\ReactNativeClient\lib %script_dir%\app\lib +REM if %errorlevel% neq 0 exit /b %errorlevel% + +rem Note that TypeScript must be installed globally for this to work +cd %script_dir%\.. +call tsc +if %errorlevel% neq 0 exit /b %errorlevel% + +cd %script_dir%\app +call npm run compile +REM if %errorlevel% neq 0 exit /b %errorlevel% diff --git a/ElectronClient/build.sh b/ElectronClient/build.sh index 1abb7a66f..76193518f 100755 --- a/ElectronClient/build.sh +++ b/ElectronClient/build.sh @@ -5,24 +5,8 @@ BUILD_DIR="$ROOT_DIR/app" rsync -a --delete "$ROOT_DIR/../ReactNativeClient/lib/" "$BUILD_DIR/lib/" +cd "$ROOT_DIR/.." +npm run tsc + cd "$BUILD_DIR" npm run compile - -# for JSX_FILE in "$BUILD_DIR"/gui/*.jsx; do -# JS_FILE="${JSX_FILE::-4}.min.js" -# if [ $JSX_FILE -nt $JS_FILE ]; then -# echo "Compile $JS_FILE..." -# "$ROOT_DIR/app/node_modules/.bin/babel" --presets react "$JSX_FILE" > "$JS_FILE" -# if [[ $? != 0 ]]; then -# exit 1 -# fi -# fi -# done - -# TRANSLATION_BUILD_SCRIPT="$ROOT_DIR/../CliClient/build/build-translation.js" -# if [[ ! -f $TRANSLATION_BUILD_SCRIPT ]]; then -# echo "Build the CLI app first ($TRANSLATION_BUILD_SCRIPT missing)" -# exit 1 -# fi - -# node "$TRANSLATION_BUILD_SCRIPT" --silent \ No newline at end of file diff --git a/ElectronClient/run.bat b/ElectronClient/run.bat new file mode 100644 index 000000000..c7ad48273 --- /dev/null +++ b/ElectronClient/run.bat @@ -0,0 +1,9 @@ +@echo off +setlocal +SET mypath=%~dp0 +set script_dir=%mypath:~0,-1% +call build.bat +if %errorlevel% neq 0 exit /b %errorlevel% + +cd %script_dir%\app +call .\node_modules\.bin\electron.cmd . --env dev --log-level debug --no-welcome --open-dev-tools "$@"