From 3bbd370242c53f4ac1a40c756d000af8d135c2f1 Mon Sep 17 00:00:00 2001 From: zeners Date: Sun, 27 Mar 2016 18:28:32 +0200 Subject: [PATCH] webui: windows creating batch-files --- libresapi/src/webui-src/make-src/build.bat | 41 ++++++++++++++++++++++ libresapi/src/webui-src/make-src/init.bat | 15 ++++++++ 2 files changed, 56 insertions(+) create mode 100644 libresapi/src/webui-src/make-src/build.bat create mode 100644 libresapi/src/webui-src/make-src/init.bat diff --git a/libresapi/src/webui-src/make-src/build.bat b/libresapi/src/webui-src/make-src/build.bat new file mode 100644 index 000000000..a1c2347b1 --- /dev/null +++ b/libresapi/src/webui-src/make-src/build.bat @@ -0,0 +1,41 @@ +@echo off +REM create webfiles from sources at compile time (works without npm/node.js) + +set publicdest=%1\webui +set src=%1\webui-src + +if "%1" == "" set publicdest=..\..\webui&&set src=.. + +if exist "%publicdest%" echo remove existing %publicdest%&&rd %publicdest% /S /Q + +echo mkdir %publicdest% +md %publicdest% + +echo building app.js +echo - copy template.js ... +copy %src%\make-src\template.js %publicdest%\app.js + +for %%F in (%src%\app\*.js) DO (set "fname=%%~nF" && CALL :addfile) + +echo building app.css +type %src%\app\green-black.scss >> %publicdest%\app.css +type %src%\make-src\main.css >> %publicdest%\app.css +type %src%\make-src\chat.css >> %publicdest%\app.css + +echo copy index.html +copy %src%\app\assets\index.html %publicdest%\index.html + +echo build.bat complete + +goto :EOF + +:addfile +echo - adding %fname% ... +echo require.register("%fname%", function(exports, require, module) { >> %publicdest%\app.js +echo %src%\app\%fname%.js +type %src%\app\%fname%.js >> %publicdest%\app.js +echo. >> %publicdest%\app.js +echo }); >> %publicdest%\app.js + + +:EOF diff --git a/libresapi/src/webui-src/make-src/init.bat b/libresapi/src/webui-src/make-src/init.bat new file mode 100644 index 000000000..bf7ab6d34 --- /dev/null +++ b/libresapi/src/webui-src/make-src/init.bat @@ -0,0 +1,15 @@ +@echo off +REM create dummy webfiles at qmake run + +set publicdest=%1\webui +if "%1" == "" set publicdest=..\..\webui + +if exist %publicdest% echo remove %publicdest%&&rd %publicdest% /S /Q + +echo create %publicdest% +md %publicdest% + +echo create %publicdest%\app.js, %publicdest%\app.css, %publicdest%\index.html +echo. > %publicdest%\app.js +echo. > %publicdest%\app.css +echo. > %publicdest%\index.html