annotate Applications/Samples/build-web-ext.sh @ 590:5430bcffba57

FloatTextureSceneLayer
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 26 Apr 2019 11:33:57 +0200
parents ee41b6a017d7
children 4eccf698e52f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
445
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
1 #!/bin/bash
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
2
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
3 set -e
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
4
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
5 target=${1:-all}
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
6 # this script currently assumes that the wasm code has been built on its side and is availabie in build-wasm/
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
7
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
8 currentDir=$(pwd)
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
9
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
10 scriptDirRel=$(dirname $0)
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
11 #echo $scriptDirRel
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
12 scriptDirAbs=$(realpath $scriptDirRel)
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
13 echo $scriptDirAbs
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
14
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
15 samplesRootDir=scriptDirAbs
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
16
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
17 outputDir=$samplesRootDir/build-web/
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
18 mkdir -p $outputDir
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
19
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
20 # files used by all single files samples
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
21 cp $samplesRootDir/Web/index.html $outputDir
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
22 cp $samplesRootDir/Web/samples-styles.css $outputDir
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
23
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
24 # build simple-viewer-single-file (obsolete project)
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
25 if [[ $target == "all" || $target == "OrthancStoneSimpleViewerSingleFile" ]]; then
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
26 cp $samplesRootDir/Web/simple-viewer-single-file.html $outputDir
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
27 tsc --allowJs --project $samplesRootDir/Web/simple-viewer-single-file.tsconfig.json
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
28 cp $currentDir/build-wasm/OrthancStoneSimpleViewerSingleFile.js $outputDir
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
29 cp $currentDir/build-wasm/OrthancStoneSimpleViewerSingleFile.wasm $outputDir
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
30 fi
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
31
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
32 # build single-frame
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
33 if [[ $target == "all" || $target == "OrthancStoneSingleFrame" ]]; then
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
34 cp $samplesRootDir/Web/single-frame.html $outputDir
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
35 tsc --allowJs --project $samplesRootDir/Web/single-frame.tsconfig.json
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
36 cp $currentDir/build-wasm/OrthancStoneSingleFrame.js $outputDir
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
37 cp $currentDir/build-wasm/OrthancStoneSingleFrame.wasm $outputDir
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
38 fi
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
39
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
40 # build single-frame-editor
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
41 if [[ $target == "all" || $target == "OrthancStoneSingleFrameEditor" ]]; then
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
42 cp $samplesRootDir/Web/single-frame-editor.html $outputDir
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
43 tsc --allowJs --project $samplesRootDir/Web/single-frame-editor.tsconfig.json
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
44 cp $currentDir/build-wasm/OrthancStoneSingleFrameEditor.js $outputDir
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
45 cp $currentDir/build-wasm/OrthancStoneSingleFrameEditor.wasm $outputDir
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
46 fi
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
47
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
48 # build simple-viewer project
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
49 if [[ $target == "all" || $target == "OrthancStoneSimpleViewer" ]]; then
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
50 mkdir -p $outputDir/simple-viewer/
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
51 cp $samplesRootDir/SimpleViewer/Wasm/simple-viewer.html $outputDir/simple-viewer/
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
52 cp $samplesRootDir/SimpleViewer/Wasm/styles.css $outputDir/simple-viewer/
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
53 tsc --allowJs --project $samplesRootDir/SimpleViewer/Wasm/tsconfig-simple-viewer.json
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
54 cp $currentDir/build-wasm/OrthancStoneSimpleViewer.js $outputDir/simple-viewer/
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
55 cp $currentDir/build-wasm/OrthancStoneSimpleViewer.wasm $outputDir/simple-viewer/
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
56 fi
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
57
ee41b6a017d7 dumb change
bgo-osimis
parents:
diff changeset
58 cd $currentDir