diff Applications/Samples/build-web.sh @ 435:e641d3978856 am-vsol-upgrade

WasmWebService now using BaseWebService and supporting cache
author am@osimis.io
date Tue, 04 Dec 2018 11:52:43 +0100
parents 612238b3f3e8
children 5055031f4a06
line wrap: on
line diff
--- a/Applications/Samples/build-web.sh	Mon Dec 03 18:03:30 2018 +0100
+++ b/Applications/Samples/build-web.sh	Tue Dec 04 11:52:43 2018 +0100
@@ -2,6 +2,7 @@
 
 set -e
 
+target=${1:-all}
 # this script currently assumes that the wasm code has been built on its side and is availabie in build-wasm/
 
 currentDir=$(pwd)
@@ -15,29 +16,37 @@
 cp $samplesRootDir/Web/samples-styles.css $outputDir
 
 # build simple-viewer-single-file (obsolete project)
-cp $samplesRootDir/Web/simple-viewer-single-file.html $outputDir
-tsc --allowJs --project $samplesRootDir/Web/simple-viewer-single-file.tsconfig.json
-cp $currentDir/build-wasm/OrthancStoneSimpleViewerSingleFile.js  $outputDir
-cp $currentDir/build-wasm/OrthancStoneSimpleViewerSingleFile.wasm  $outputDir
+if [[ $target == "all" || $target == "OrthancStoneSimpleViewerSingleFile" ]]; then
+  cp $samplesRootDir/Web/simple-viewer-single-file.html $outputDir
+  tsc --allowJs --project $samplesRootDir/Web/simple-viewer-single-file.tsconfig.json
+  cp $currentDir/build-wasm/OrthancStoneSimpleViewerSingleFile.js  $outputDir
+  cp $currentDir/build-wasm/OrthancStoneSimpleViewerSingleFile.wasm  $outputDir
+fi
 
 # build single-frame
-cp $samplesRootDir/Web/single-frame.html $outputDir
-tsc --allowJs --project $samplesRootDir/Web/single-frame.tsconfig.json
-cp $currentDir/build-wasm/OrthancStoneSingleFrame.js  $outputDir
-cp $currentDir/build-wasm/OrthancStoneSingleFrame.wasm  $outputDir
+if [[ $target == "all" || $target == "OrthancStoneSingleFrame" ]]; then
+  cp $samplesRootDir/Web/single-frame.html $outputDir
+  tsc --allowJs --project $samplesRootDir/Web/single-frame.tsconfig.json
+  cp $currentDir/build-wasm/OrthancStoneSingleFrame.js  $outputDir
+  cp $currentDir/build-wasm/OrthancStoneSingleFrame.wasm  $outputDir
+fi
 
 # build single-frame-editor
-cp $samplesRootDir/Web/single-frame-editor.html $outputDir
-tsc --allowJs --project $samplesRootDir/Web/single-frame-editor.tsconfig.json
-cp $currentDir/build-wasm/OrthancStoneSingleFrameEditor.js  $outputDir
-cp $currentDir/build-wasm/OrthancStoneSingleFrameEditor.wasm  $outputDir
+if [[ $target == "all" || $target == "OrthancStoneSingleFrameEditor" ]]; then
+  cp $samplesRootDir/Web/single-frame-editor.html $outputDir
+  tsc --allowJs --project $samplesRootDir/Web/single-frame-editor.tsconfig.json
+  cp $currentDir/build-wasm/OrthancStoneSingleFrameEditor.js  $outputDir
+  cp $currentDir/build-wasm/OrthancStoneSingleFrameEditor.wasm  $outputDir
+fi
 
 # build simple-viewer project
-mkdir -p $outputDir/simple-viewer/
-cp $samplesRootDir/SimpleViewer/Wasm/simple-viewer.html $outputDir/simple-viewer/
-cp $samplesRootDir/SimpleViewer/Wasm/styles.css $outputDir/simple-viewer/
-tsc --allowJs --project $samplesRootDir/SimpleViewer/Wasm/tsconfig-simple-viewer.json
-cp $currentDir/build-wasm/OrthancStoneSimpleViewer.js  $outputDir/simple-viewer/
-cp $currentDir/build-wasm/OrthancStoneSimpleViewer.wasm  $outputDir/simple-viewer/
+if [[ $target == "all" || $target == "OrthancStoneSimpleViewer" ]]; then
+  mkdir -p $outputDir/simple-viewer/
+  cp $samplesRootDir/SimpleViewer/Wasm/simple-viewer.html $outputDir/simple-viewer/
+  cp $samplesRootDir/SimpleViewer/Wasm/styles.css $outputDir/simple-viewer/
+  tsc --allowJs --project $samplesRootDir/SimpleViewer/Wasm/tsconfig-simple-viewer.json
+  cp $currentDir/build-wasm/OrthancStoneSimpleViewer.js  $outputDir/simple-viewer/
+  cp $currentDir/build-wasm/OrthancStoneSimpleViewer.wasm  $outputDir/simple-viewer/
+fi
 
 cd $currentDir