annotate Resources/CodeGeneration/testWasmIntegrated/build-web.sh @ 500:329f229c2794 bgo-commands-codegen

Improvements to the integrated demo for TS <--> C++
author bgo-osimis
date Mon, 25 Feb 2019 06:35:21 +0100
parents baa9e1e932db
children 342f3e04bfa9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
498
6d62fc8a6988 Web demonstrator for codegen ongoing work
bgo-osimis
parents:
diff changeset
1 #!/bin/bash
6d62fc8a6988 Web demonstrator for codegen ongoing work
bgo-osimis
parents:
diff changeset
2 set -e
6d62fc8a6988 Web demonstrator for codegen ongoing work
bgo-osimis
parents:
diff changeset
3
6d62fc8a6988 Web demonstrator for codegen ongoing work
bgo-osimis
parents:
diff changeset
4 mkdir -p build-final
6d62fc8a6988 Web demonstrator for codegen ongoing work
bgo-osimis
parents:
diff changeset
5
6d62fc8a6988 Web demonstrator for codegen ongoing work
bgo-osimis
parents:
diff changeset
6 # compile TS to JS
6d62fc8a6988 Web demonstrator for codegen ongoing work
bgo-osimis
parents:
diff changeset
7 tsc --module commonjs --sourceMap -t ES2015 --outDir "build-tsc/" build-wasm/testWasmIntegratedCpp_generated.ts testWasmIntegrated.ts
6d62fc8a6988 Web demonstrator for codegen ongoing work
bgo-osimis
parents:
diff changeset
8
499
baa9e1e932db wasm + ts demonstrator WORKS!
bgo-osimis
parents: 498
diff changeset
9 # bundle JS files to final build dir
baa9e1e932db wasm + ts demonstrator WORKS!
bgo-osimis
parents: 498
diff changeset
10 browserify "build-tsc/build-wasm/testWasmIntegratedCpp_generated.js" "build-tsc/testWasmIntegrated.js" -o "build-final/testWasmIntegratedApp.js"
baa9e1e932db wasm + ts demonstrator WORKS!
bgo-osimis
parents: 498
diff changeset
11
baa9e1e932db wasm + ts demonstrator WORKS!
bgo-osimis
parents: 498
diff changeset
12 # copy WASM loader JS file to final build dir
baa9e1e932db wasm + ts demonstrator WORKS!
bgo-osimis
parents: 498
diff changeset
13 cp build-wasm/testWasmIntegratedCpp.js build-final/
498
6d62fc8a6988 Web demonstrator for codegen ongoing work
bgo-osimis
parents:
diff changeset
14
6d62fc8a6988 Web demonstrator for codegen ongoing work
bgo-osimis
parents:
diff changeset
15 # copy HTML start page to output dir
6d62fc8a6988 Web demonstrator for codegen ongoing work
bgo-osimis
parents:
diff changeset
16 cp testWasmIntegrated.html build-final/
6d62fc8a6988 Web demonstrator for codegen ongoing work
bgo-osimis
parents:
diff changeset
17
499
baa9e1e932db wasm + ts demonstrator WORKS!
bgo-osimis
parents: 498
diff changeset
18
498
6d62fc8a6988 Web demonstrator for codegen ongoing work
bgo-osimis
parents:
diff changeset
19 # copy styles to output dir
6d62fc8a6988 Web demonstrator for codegen ongoing work
bgo-osimis
parents:
diff changeset
20 cp styles.css build-final/
6d62fc8a6988 Web demonstrator for codegen ongoing work
bgo-osimis
parents:
diff changeset
21
6d62fc8a6988 Web demonstrator for codegen ongoing work
bgo-osimis
parents:
diff changeset
22 # copy WASM binary to output dir
6d62fc8a6988 Web demonstrator for codegen ongoing work
bgo-osimis
parents:
diff changeset
23 cp build-wasm/testWasmIntegratedCpp.wasm build-final/
6d62fc8a6988 Web demonstrator for codegen ongoing work
bgo-osimis
parents:
diff changeset
24
500
329f229c2794 Improvements to the integrated demo for TS <--> C++
bgo-osimis
parents: 499
diff changeset
25 echo "...Serving files at http://127.0.0.1:8080/"
329f229c2794 Improvements to the integrated demo for TS <--> C++
bgo-osimis
parents: 499
diff changeset
26 echo "Please open build_final/testWasmIntegrated.html"
329f229c2794 Improvements to the integrated demo for TS <--> C++
bgo-osimis
parents: 499
diff changeset
27
498
6d62fc8a6988 Web demonstrator for codegen ongoing work
bgo-osimis
parents:
diff changeset
28 sudo python3 serve.py
6d62fc8a6988 Web demonstrator for codegen ongoing work
bgo-osimis
parents:
diff changeset
29