From 88727d1e4a46ebfe1c71a6039d609a9e18e2e8fa Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Thu, 15 Aug 2024 22:23:11 -0400 Subject: [PATCH] update build script to allow building only static assets --- build | 42 ++++++++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/build b/build index 188d3ee..fd00a87 100755 --- a/build +++ b/build @@ -4,9 +4,18 @@ if [ ! -d output ]; then fi -dotnet build -if [ $? -eq 1 ]; then - exit 1 +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 @@ -14,6 +23,7 @@ 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,22 +33,26 @@ 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 -cp mocha-dotnet/src/app/Mocha.ServerApplication/bin/Debug/net8.0/* output/ +if [ "$1" != "--assets-only" ]; then -if [ ! -d output/plugins ]; then - mkdir output/plugins + cp mocha-dotnet/src/app/Mocha.ServerApplication/bin/Debug/net8.0/* output/ + + if [ ! -d output/plugins ]; then + mkdir output/plugins + fi + + for each in mocha-dotnet/src/plugins/*; do + pushd $each + dotnet build + popd + + cp $each/bin/Debug/net8.0/*.dll output/plugins + done fi -for each in mocha-dotnet/src/plugins/*; do - pushd $each - dotnet build - popd - - cp $each/bin/Debug/net8.0/*.dll output/plugins -done - exit 0