Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
wasm-watermarker
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nagayama15
wasm-watermarker
Commits
d987dd30
Verified
Commit
d987dd30
authored
Dec 11, 2020
by
nagayama15
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add an embedding script
parent
5cee0cdb
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
0 deletions
+55
-0
.gitignore
.gitignore
+1
-0
embed.sh
scripts/embed.sh
+54
-0
No files found.
.gitignore
View file @
d987dd30
...
...
@@ -51,3 +51,4 @@ node_modules/
### Build directories
/build*/
/out/
scripts/embed.sh
0 → 100755
View file @
d987dd30
#!/bin/sh
SNPI
=
"./build/bin/snpi"
PISN
=
"./build/bin/pisn"
OUT_DIR
=
"./out"
WASM_AMMO_JS
=
"./node_modules/ammo.js/builds/ammo.wasm.wasm"
WASM_JQ_WEB
=
"./node_modules/jq-web/jq.wasm.wasm"
WASM_SOURCE_MAP
=
"./node_modules/source-map/lib/mappings.wasm"
WASM_WASM_FLATE
=
"./node_modules/wasm-flate/wasm_flate_bg.wasm"
function
copy
()
{
local
file
=
"
$1
"
local
out
=
"
$2
"
echo
"cp
$file
$out
"
mkdir
-p
"
$(
dirname
"
$out
"
)
"
cp
"
$file
"
"
$out
"
}
function
embed
()
{
local
file
=
"
$1
"
local
out
=
"
$2
"
local
method
=
"
$3
"
local
watermark
=
"
$4
"
local
chunk_size
=
"
${
5
:-
20
}
"
echo
"
$SNPI
-o
$out
-m
$method
-w
$watermark
-c
$chunk_size
$file
"
mkdir
-p
"
$(
dirname
"
$out
"
)
"
local
embedded_size
embedded_size
=
"
$(
"
$SNPI
"
-o
"
$out
"
-m
"
$method
"
-w
"
$watermark
"
-c
"
$chunk_size
"
"
$file
"
)
"
echo
"
$embedded_size
"
}
copy
"
$WASM_AMMO_JS
"
"
$OUT_DIR
/ammo.js/ammo.wasm.wasm"
copy
"
$WASM_JQ_WEB
"
"
$OUT_DIR
/jq-web/jq.wasm.wasm"
copy
"
$WASM_SOURCE_MAP
"
"
$OUT_DIR
/source-map/mappings.wasm"
copy
"
$WASM_WASM_FLATE
"
"
$OUT_DIR
/wasm-flate/wasm_flate_bg.wasm"
embed
"
$WASM_AMMO_JS
"
"
$OUT_DIR
/ammo.js/ammo.wasm-op-TEST.wasm"
"operand-swap"
"TEST"
embed
"
$WASM_JQ_WEB
"
"
$OUT_DIR
/jq-web/jq-op-TEST.wasm.wasm"
"operand-swap"
"TEST"
embed
"
$WASM_SOURCE_MAP
"
"
$OUT_DIR
/source-map/mappings-op-TEST.wasm"
"operand-swap"
"TEST"
embed
"
$WASM_WASM_FLATE
"
"
$OUT_DIR
/wasm-flate/wasm_flate_bg-op-TEST.wasm"
"operand-swap"
"TEST"
embed
"
$WASM_AMMO_JS
"
"
$OUT_DIR
/ammo.js/ammo.wasm-fn-TEST.wasm"
"function-reorder"
"TEST"
embed
"
$WASM_JQ_WEB
"
"
$OUT_DIR
/jq-web/jq-fn-TEST.wasm.wasm"
"function-reorder"
"TEST"
embed
"
$WASM_SOURCE_MAP
"
"
$OUT_DIR
/source-map/mappings-fn-TEST.wasm"
"function-reorder"
"TEST"
embed
"
$WASM_WASM_FLATE
"
"
$OUT_DIR
/wasm-flate/wasm_flate_bg-fn-TEST.wasm"
"function-reorder"
"TEST"
embed
"
$WASM_AMMO_JS
"
"
$OUT_DIR
/ammo.js/ammo.wasm-ex-TEST.wasm"
"export-reorder"
"TEST"
embed
"
$WASM_JQ_WEB
"
"
$OUT_DIR
/jq-web/jq-ex-TEST.wasm.wasm"
"export-reorder"
"TEST"
embed
"
$WASM_SOURCE_MAP
"
"
$OUT_DIR
/source-map/mappings-ex-TEST.wasm"
"export-reorder"
"TEST"
embed
"
$WASM_WASM_FLATE
"
"
$OUT_DIR
/wasm-flate/wasm_flate_bg-ex-TEST.wasm"
"export-reorder"
"TEST"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment