blob: 7694cf1798c764c29de0f1aec0daf3100c0f7fb8 [file] [log] [blame]
Kevin Lubicke1b36fe2018-08-02 11:30:33 -04001build:
2 ./compile.sh
3
Kevin Lubickf14a3c02018-08-22 09:35:32 -04004npm: npm-test npm-debug
Kevin Lubicke1b36fe2018-08-02 11:30:33 -04005 mkdir -p ./npm-wasm/bin
6 mkdir -p ./npm-asmjs/bin
7 ./compile.sh
Kevin Lubickf14a3c02018-08-22 09:35:32 -04008 cp ../../out/pathkit/pathkit.js ./npm-wasm/bin
Kevin Lubicke1b36fe2018-08-02 11:30:33 -04009 cp ../../out/pathkit/pathkit.wasm ./npm-wasm/bin
Kevin Lubickf14a3c02018-08-22 09:35:32 -040010 ./compile.sh asm.js
11 cp ../../out/pathkit/pathkit.js ./npm-asmjs/bin/pathkit.js
12 cp ../../out/pathkit/pathkit.js.mem ./npm-asmjs/bin/pathkit.js.mem
Kevin Lubickb3d0e3e2018-08-03 12:24:06 -040013
Kevin Lubicke1b36fe2018-08-02 11:30:33 -040014publish:
15 cd npm-wasm; npm publish
Kevin Lubickd9936482018-08-24 10:44:16 -040016 cd npm-asmjs; npm publish
Kevin Lubicke1b36fe2018-08-02 11:30:33 -040017
18update-major:
19 cd npm-wasm; npm version major
Kevin Lubickf14a3c02018-08-22 09:35:32 -040020 cd ../npm-asmjs; npm version major
Kevin Lubicke1b36fe2018-08-02 11:30:33 -040021 echo "Don't forget to publish."
22
23update-minor:
24 cd npm-wasm; npm version minor
Kevin Lubickd9936482018-08-24 10:44:16 -040025 cd npm-asmjs; npm version minor
Kevin Lubicke1b36fe2018-08-02 11:30:33 -040026 echo "Don't forget to publish."
27
28update-patch:
29 cd npm-wasm; npm version patch
Kevin Lubickd9936482018-08-24 10:44:16 -040030 cd npm-asmjs; npm version patch
Kevin Lubicke1b36fe2018-08-02 11:30:33 -040031 echo "Don't forget to publish."
32
Kevin Lubick92c91712018-08-09 10:00:02 -040033# Build the library and run the tests. If developing locally, test-continuous is better
34# suited for that, although if you make changes to the C++/WASM code, you will need
35# to manually call make npm-test to re-build.
36test: npm-test
37 npm install
38 npx karma start ./karma.conf.js --single-run
Kevin Lubickf14a3c02018-08-22 09:35:32 -040039 ASM_JS=1 npx karma start ./karma.conf.js --single-run
Kevin Lubick92c91712018-08-09 10:00:02 -040040
41test-continuous:
42 echo "Assuming npm install has been run by user"
43 echo "Also assuming make npm-test has also been run by a user (if needed)"
44 npx karma start ./karma.conf.js --no-single-run --watch-poll
45
Kevin Lubickf14a3c02018-08-22 09:35:32 -040046test-continuous-asmjs:
47 echo "Assuming npm install has been run by user"
48 echo "Also assuming make npm-test has also been run by a user (if needed)"
49 ASM_JS=1 npx karma start ./karma.conf.js --no-single-run --watch-poll
50
Kevin Lubick92c91712018-08-09 10:00:02 -040051# Build the library and run the tests using the docker image. If developing locally,
52# test-docker-continuous is better, although if you make changes to the C++/WASM code,
53# you will need to manually call make npm-test to re-build.
54test-docker: npm-test
Kevin Lubickf14a3c02018-08-22 09:35:32 -040055 docker run --shm-size=2gb -v $$SKIA_ROOT:/SRC gcr.io/skia-public/karma-chrome-tests:68.0.3440.106_v4 \
Kevin Lubickc7d05712018-08-31 10:03:23 -040056karma start /SRC/modules/pathkit/karma.conf.js --single-run
Kevin Lubickf14a3c02018-08-22 09:35:32 -040057 docker run --shm-size=2gb -v $$SKIA_ROOT:/SRC -e ASM_JS=1 gcr.io/skia-public/karma-chrome-tests:68.0.3440.106_v4 \
Kevin Lubickc7d05712018-08-31 10:03:23 -040058karma start /SRC/modules/pathkit/karma.conf.js --single-run
Kevin Lubick92c91712018-08-09 10:00:02 -040059
60test-docker-continuous:
61 echo "Assuming make npm-test has also been run by a user (if needed)"
Kevin Lubickf14a3c02018-08-22 09:35:32 -040062 docker run --shm-size=2gb -v $$SKIA_ROOT:/SRC gcr.io/skia-public/karma-chrome-tests:68.0.3440.106_v4 \
Kevin Lubickc7d05712018-08-31 10:03:23 -040063karma start /SRC/modules/pathkit/karma.conf.js --no-single-run
Kevin Lubickf14a3c02018-08-22 09:35:32 -040064
65test-docker-continuous-asmjs:
66 echo "Assuming make npm-test has also been run by a user (if needed)"
67 docker run --shm-size=2gb -v $$SKIA_ROOT:/SRC -e ASM_JS=1 gcr.io/skia-public/karma-chrome-tests:68.0.3440.106_v4 \
Kevin Lubickc7d05712018-08-31 10:03:23 -040068karma start /SRC/modules/pathkit/karma.conf.js --no-single-run
Kevin Lubick641bf872018-08-06 14:49:39 -040069
70npm-test:
71 # This compile time is typically faster than release and good for use with
72 # local-example-test
73 mkdir -p ./npm-wasm/bin/test
74 mkdir -p ./npm-asmjs/bin/test
75 ./compile.sh test
Kevin Lubickf14a3c02018-08-22 09:35:32 -040076 cp ../../out/pathkit/pathkit.js ./npm-wasm/bin/test/pathkit.js
Kevin Lubick641bf872018-08-06 14:49:39 -040077 cp ../../out/pathkit/pathkit.wasm ./npm-wasm/bin/test/pathkit.wasm
Kevin Lubickf14a3c02018-08-22 09:35:32 -040078 ./compile.sh asm.js test
79 cp ../../out/pathkit/pathkit.js ./npm-asmjs/bin/test/pathkit.js
80 cp ../../out/pathkit/pathkit.js.mem ./npm-asmjs/bin/test/pathkit.js.mem
Kevin Lubick641bf872018-08-06 14:49:39 -040081
82npm-debug:
83 # This compile time is typically faster than release and good for use with
84 # local-example-test
85 mkdir -p ./npm-wasm/bin/debug
86 mkdir -p ./npm-asmjs/bin/debug
87 ./compile.sh debug
Kevin Lubickf14a3c02018-08-22 09:35:32 -040088 cp ../../out/pathkit/pathkit.js ./npm-wasm/bin/debug/pathkit.js
89 cp ../../out/pathkit/pathkit.wasm ./npm-wasm/bin/debug/pathkit.wasm
90 cp ../../out/pathkit/pathkit.js.map ./npm-wasm/bin/debug/pathkit.js.map
91 ./compile.sh asm.js debug
92 cp ../../out/pathkit/pathkit.js ./npm-asmjs/bin/debug/pathkit.js
93 cp ../../out/pathkit/pathkit.js.map ./npm-asmjs/bin/debug/pathkit.js.map
Kevin Lubicke1b36fe2018-08-02 11:30:33 -040094
Kevin Lubicke1b36fe2018-08-02 11:30:33 -040095example:
Kevin Lubickbe5091c2018-08-31 10:45:18 -040096 npm install pathkit-asmjs pathkit-wasm
Kevin Lubicke1b36fe2018-08-02 11:30:33 -040097 echo "Go check out localhost:8000/npm-wasm/example.html"
Kevin Lubickb3d0e3e2018-08-03 12:24:06 -040098 python serve.py
99
100local-example:
Kevin Lubickbe5091c2018-08-31 10:45:18 -0400101 rm -rf node_modules/pathkit-wasm
102 rm -rf node_modules/pathkit-asmjs
Kevin Lubickb3d0e3e2018-08-03 12:24:06 -0400103 mkdir -p node_modules
Kevin Lubickbe5091c2018-08-31 10:45:18 -0400104 ln -s -T ../npm-wasm node_modules/pathkit-wasm
105 ln -s -T ../npm-asmjs node_modules/pathkit-asmjs
Kevin Lubickf14a3c02018-08-22 09:35:32 -0400106 echo "Go check out http://localhost:8000/npm-wasm/example.html"
107 echo "or http://localhost:8000/npm-asmjs/example.html"
Kevin Lubickb3d0e3e2018-08-03 12:24:06 -0400108 python serve.py
109
Kevin Lubick641bf872018-08-06 14:49:39 -0400110local-example-test:
Kevin Lubickbe5091c2018-08-31 10:45:18 -0400111 rm -rf node_modules/pathkit-wasm
112 rm -rf node_modules/pathkit-asmjs
113 mkdir -p node_modules/pathkit-wasm
114 mkdir -p node_modules/pathkit-asmjs
115 ln -s -T ../../npm-wasm/bin/test node_modules/pathkit-wasm/bin
116 ln -s -T ../../npm-asmjs/bin/test node_modules/pathkit-asmjs/bin
Kevin Lubick641bf872018-08-06 14:49:39 -0400117 echo "Go check out localhost:8000/npm-wasm/example.html"
Kevin Lubickf14a3c02018-08-22 09:35:32 -0400118 echo "or http://localhost:8000/npm-asmjs/example.html"
Kevin Lubick641bf872018-08-06 14:49:39 -0400119 python serve.py
120
Kevin Lubickb3d0e3e2018-08-03 12:24:06 -0400121local-example-debug:
Kevin Lubickbe5091c2018-08-31 10:45:18 -0400122 rm -rf node_modules/pathkit-wasm
123 rm -rf node_modules/pathkit-asmjs
124 mkdir -p node_modules/pathkit-wasm
125 mkdir -p node_modules/pathkit-asmjs
126 ln -s -T ../../npm-wasm/bin/debug node_modules/pathkit-wasm/bin
127 ln -s -T ../../npm-asmjs/bin/debug node_modules/pathkit-asmjs/bin
Kevin Lubickb3d0e3e2018-08-03 12:24:06 -0400128 echo "Go check out localhost:8000/npm-wasm/example.html"
Kevin Lubickf14a3c02018-08-22 09:35:32 -0400129 echo "or http://localhost:8000/npm-asmjs/example.html"
Kevin Lubicke1b36fe2018-08-02 11:30:33 -0400130 python serve.py