update build script to allow building only static assets

This commit is contained in:
Michael Becker 2024-08-15 22:23:11 -04:00
parent f7cdcbb33a
commit 88727d1e4a

14
build
View File

@ -4,16 +4,26 @@ if [ ! -d output ]; then
fi
if [ "$1" != "--assets-only" ]; then
dotnet build
if [ $? -eq 1 ]; then
echo -n ".NET build failed. Continue with asset build? (Y/N) [Y]: "
read ans
if [ "$ans" != "Y" && "$ans" != "y" ]; then
exit 1
fi
fi
fi
ASSET_UIHTML_VERSION=2024.27.5
THEME_NAME=avondale
for each in mocha-dotnet/src/assets/ui-html/css/common/*.less mocha-dotnet/src/assets/ui-html/css/$THEME_NAME/*.less; do
>&2 echo $each
cat $each
echo ""
done | lessc --plugin=less-plugin-clean-css=advanced - output/assets/ui-html/$ASSET_UIHTML_VERSION/css/mochaApp.css
@ -23,10 +33,13 @@ if [ ! -d output/assets/ui-html/$ASSET_UIHTML_VERSION/base ]; then
fi
for each in mocha-dotnet/src/assets/ui-html/base/*.js mocha-dotnet/src/assets/ui-html/base/controls/*.js mocha-dotnet/src/assets/ui-html/mocha/*.js mocha-dotnet/src/assets/ui-html/mocha/controls/*.js; do
>&2 echo $each
cat $each
echo ""
done | jsmin > output/assets/ui-html/$ASSET_UIHTML_VERSION/base/shared-min.js
if [ "$1" != "--assets-only" ]; then
cp mocha-dotnet/src/app/Mocha.ServerApplication/bin/Debug/net8.0/* output/
if [ ! -d output/plugins ]; then
@ -40,5 +53,6 @@ for each in mocha-dotnet/src/plugins/*; do
cp $each/bin/Debug/net8.0/*.dll output/plugins
done
fi
exit 0