annotate 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
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
6d62fc8a6988 Web demonstrator for codegen ongoing work
bgo-osimis
parents:
diff changeset
9 # bundle all JS files to final build dir
6d62fc8a6988 Web demonstrator for codegen ongoing work
bgo-osimis
parents:
diff changeset
10 browserify "build-wasm/testWasmIntegratedCpp.js" "build-tsc/build-wasm/testWasmIntegratedCpp_generated.js" "build-tsc/testWasmIntegrated.js" -o "build-final/testWasmIntegratedApp.js"
6d62fc8a6988 Web demonstrator for codegen ongoing work
bgo-osimis
parents:
diff changeset
11
6d62fc8a6988 Web demonstrator for codegen ongoing work
bgo-osimis
parents:
diff changeset
12 # copy HTML start page to output dir
6d62fc8a6988 Web demonstrator for codegen ongoing work
bgo-osimis
parents:
diff changeset
13 cp testWasmIntegrated.html build-final/
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 styles to output dir
6d62fc8a6988 Web demonstrator for codegen ongoing work
bgo-osimis
parents:
diff changeset
16 cp styles.css build-final/
6d62fc8a6988 Web demonstrator for codegen ongoing work
bgo-osimis
parents:
diff changeset
17
6d62fc8a6988 Web demonstrator for codegen ongoing work
bgo-osimis
parents:
diff changeset
18 # copy WASM binary to output dir
6d62fc8a6988 Web demonstrator for codegen ongoing work
bgo-osimis
parents:
diff changeset
19 cp build-wasm/testWasmIntegratedCpp.wasm build-final/
6d62fc8a6988 Web demonstrator for codegen ongoing work
bgo-osimis
parents:
diff changeset
20
6d62fc8a6988 Web demonstrator for codegen ongoing work
bgo-osimis
parents:
diff changeset
21 sudo python3 serve.py
6d62fc8a6988 Web demonstrator for codegen ongoing work
bgo-osimis
parents:
diff changeset
22