diff Resources/CodeGeneration/testWasmIntegrated/build-web.sh @ 498:6d62fc8a6988 bgo-commands-codegen

Web demonstrator for codegen ongoing work
author bgo-osimis
date Sun, 24 Feb 2019 13:23:14 +0100
parents
children baa9e1e932db
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Resources/CodeGeneration/testWasmIntegrated/build-web.sh	Sun Feb 24 13:23:14 2019 +0100
@@ -0,0 +1,22 @@
+#!/bin/bash
+set -e
+
+mkdir -p build-final
+
+# compile TS to JS
+tsc --module commonjs --sourceMap -t ES2015 --outDir "build-tsc/" build-wasm/testWasmIntegratedCpp_generated.ts testWasmIntegrated.ts 
+
+# bundle all JS files to final build dir 
+browserify "build-wasm/testWasmIntegratedCpp.js" "build-tsc/build-wasm/testWasmIntegratedCpp_generated.js" "build-tsc/testWasmIntegrated.js" -o "build-final/testWasmIntegratedApp.js"
+
+# copy HTML start page to output dir
+cp testWasmIntegrated.html build-final/
+
+# copy styles to output dir
+cp styles.css build-final/
+
+# copy WASM binary to output dir
+cp build-wasm/testWasmIntegratedCpp.wasm  build-final/
+
+sudo python3 serve.py
+