view Applications/Samples/build-web.sh @ 326:612238b3f3e8 am-2

all 4 samples now working in Qt, SDL and wasm
author am@osimis.io
date Tue, 16 Oct 2018 12:57:38 +0200
parents daa04d15192c
children e641d3978856
line wrap: on
line source

#!/bin/bash

set -e

# this script currently assumes that the wasm code has been built on its side and is availabie in build-wasm/

currentDir=$(pwd)
samplesRootDir=$(pwd)

outputDir=$samplesRootDir/build-web/
mkdir -p $outputDir

# files used by all single files samples
cp $samplesRootDir/Web/index.html $outputDir
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

# 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

# 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

# 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/

cd $currentDir