webui: windows creating batch-files

This commit is contained in:
zeners 2016-03-27 18:28:32 +02:00
parent d96a8efb66
commit 3bbd370242
2 changed files with 56 additions and 0 deletions

View File

@ -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

View File

@ -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