Kevin Lubick | e1b36fe | 2018-08-02 11:30:33 -0400 | [diff] [blame] | 1 | build: |
| 2 | ./compile.sh |
| 3 | |
Kevin Lubick | f14a3c0 | 2018-08-22 09:35:32 -0400 | [diff] [blame] | 4 | npm: npm-test npm-debug |
Kevin Lubick | e1b36fe | 2018-08-02 11:30:33 -0400 | [diff] [blame] | 5 | mkdir -p ./npm-wasm/bin |
| 6 | mkdir -p ./npm-asmjs/bin |
| 7 | ./compile.sh |
Kevin Lubick | f14a3c0 | 2018-08-22 09:35:32 -0400 | [diff] [blame] | 8 | cp ../../out/pathkit/pathkit.js ./npm-wasm/bin |
Kevin Lubick | e1b36fe | 2018-08-02 11:30:33 -0400 | [diff] [blame] | 9 | cp ../../out/pathkit/pathkit.wasm ./npm-wasm/bin |
Kevin Lubick | f14a3c0 | 2018-08-22 09:35:32 -0400 | [diff] [blame] | 10 | ./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 Lubick | b3d0e3e | 2018-08-03 12:24:06 -0400 | [diff] [blame] | 13 | |
Kevin Lubick | e1b36fe | 2018-08-02 11:30:33 -0400 | [diff] [blame] | 14 | publish: |
| 15 | cd npm-wasm; npm publish |
Kevin Lubick | d993648 | 2018-08-24 10:44:16 -0400 | [diff] [blame] | 16 | cd npm-asmjs; npm publish |
Kevin Lubick | e1b36fe | 2018-08-02 11:30:33 -0400 | [diff] [blame] | 17 | |
| 18 | update-major: |
| 19 | cd npm-wasm; npm version major |
Kevin Lubick | f14a3c0 | 2018-08-22 09:35:32 -0400 | [diff] [blame] | 20 | cd ../npm-asmjs; npm version major |
Kevin Lubick | e1b36fe | 2018-08-02 11:30:33 -0400 | [diff] [blame] | 21 | echo "Don't forget to publish." |
| 22 | |
| 23 | update-minor: |
| 24 | cd npm-wasm; npm version minor |
Kevin Lubick | d993648 | 2018-08-24 10:44:16 -0400 | [diff] [blame] | 25 | cd npm-asmjs; npm version minor |
Kevin Lubick | e1b36fe | 2018-08-02 11:30:33 -0400 | [diff] [blame] | 26 | echo "Don't forget to publish." |
| 27 | |
| 28 | update-patch: |
| 29 | cd npm-wasm; npm version patch |
Kevin Lubick | d993648 | 2018-08-24 10:44:16 -0400 | [diff] [blame] | 30 | cd npm-asmjs; npm version patch |
Kevin Lubick | e1b36fe | 2018-08-02 11:30:33 -0400 | [diff] [blame] | 31 | echo "Don't forget to publish." |
| 32 | |
Kevin Lubick | 92c9171 | 2018-08-09 10:00:02 -0400 | [diff] [blame] | 33 | # 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. |
| 36 | test: npm-test |
| 37 | npm install |
| 38 | npx karma start ./karma.conf.js --single-run |
Kevin Lubick | f14a3c0 | 2018-08-22 09:35:32 -0400 | [diff] [blame] | 39 | ASM_JS=1 npx karma start ./karma.conf.js --single-run |
Kevin Lubick | 92c9171 | 2018-08-09 10:00:02 -0400 | [diff] [blame] | 40 | |
| 41 | test-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 Lubick | f14a3c0 | 2018-08-22 09:35:32 -0400 | [diff] [blame] | 46 | test-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 Lubick | 92c9171 | 2018-08-09 10:00:02 -0400 | [diff] [blame] | 51 | # 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. |
Kevin Lubick | cbcff38 | 2018-10-02 09:02:18 -0400 | [diff] [blame] | 54 | test-docker: |
| 55 | mkdir -p ./npm-wasm/bin/test |
| 56 | mkdir -p ./npm-asmjs/bin/test |
| 57 | mkdir -p $$SKIA_ROOT/out/dockerbuild |
| 58 | |
| 59 | docker run --rm -v $$SKIA_ROOT:/SRC -v $$SKIA_ROOT/out/dockerbuild:/OUT \ |
Kevin Lubick | e70c6b1 | 2018-11-06 07:49:40 -0500 | [diff] [blame] | 60 | gcr.io/skia-public/emsdk-release:1.38.16_v1 /SRC/infra/pathkit/build_pathkit.sh |
Kevin Lubick | cbcff38 | 2018-10-02 09:02:18 -0400 | [diff] [blame] | 61 | cp ../../out/dockerbuild/pathkit.js ./npm-wasm/bin/test/pathkit.js |
| 62 | cp ../../out/dockerbuild/pathkit.wasm ./npm-wasm/bin/test/pathkit.wasm |
| 63 | |
| 64 | docker run --rm -v $$SKIA_ROOT:/SRC -v $$SKIA_ROOT/out/dockerbuild:/OUT \ |
Kevin Lubick | e70c6b1 | 2018-11-06 07:49:40 -0500 | [diff] [blame] | 65 | gcr.io/skia-public/emsdk-release:1.38.16_v1 /SRC/infra/pathkit/build_pathkit.sh asm.js |
Kevin Lubick | cbcff38 | 2018-10-02 09:02:18 -0400 | [diff] [blame] | 66 | cp ../../out/dockerbuild/pathkit.js ./npm-asmjs/bin/test/pathkit.js |
| 67 | cp ../../out/dockerbuild/pathkit.js.mem ./npm-asmjs/bin/test/pathkit.js.mem |
| 68 | |
Kevin Lubick | f14a3c0 | 2018-08-22 09:35:32 -0400 | [diff] [blame] | 69 | docker run --shm-size=2gb -v $$SKIA_ROOT:/SRC gcr.io/skia-public/karma-chrome-tests:68.0.3440.106_v4 \ |
Kevin Lubick | c7d0571 | 2018-08-31 10:03:23 -0400 | [diff] [blame] | 70 | karma start /SRC/modules/pathkit/karma.conf.js --single-run |
Kevin Lubick | f14a3c0 | 2018-08-22 09:35:32 -0400 | [diff] [blame] | 71 | 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 Lubick | c7d0571 | 2018-08-31 10:03:23 -0400 | [diff] [blame] | 72 | karma start /SRC/modules/pathkit/karma.conf.js --single-run |
Kevin Lubick | 92c9171 | 2018-08-09 10:00:02 -0400 | [diff] [blame] | 73 | |
| 74 | test-docker-continuous: |
| 75 | echo "Assuming make npm-test has also been run by a user (if needed)" |
Kevin Lubick | f14a3c0 | 2018-08-22 09:35:32 -0400 | [diff] [blame] | 76 | docker run --shm-size=2gb -v $$SKIA_ROOT:/SRC gcr.io/skia-public/karma-chrome-tests:68.0.3440.106_v4 \ |
Kevin Lubick | c7d0571 | 2018-08-31 10:03:23 -0400 | [diff] [blame] | 77 | karma start /SRC/modules/pathkit/karma.conf.js --no-single-run |
Kevin Lubick | f14a3c0 | 2018-08-22 09:35:32 -0400 | [diff] [blame] | 78 | |
| 79 | test-docker-continuous-asmjs: |
| 80 | echo "Assuming make npm-test has also been run by a user (if needed)" |
| 81 | 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 Lubick | c7d0571 | 2018-08-31 10:03:23 -0400 | [diff] [blame] | 82 | karma start /SRC/modules/pathkit/karma.conf.js --no-single-run |
Kevin Lubick | 641bf87 | 2018-08-06 14:49:39 -0400 | [diff] [blame] | 83 | |
| 84 | npm-test: |
| 85 | # This compile time is typically faster than release and good for use with |
| 86 | # local-example-test |
| 87 | mkdir -p ./npm-wasm/bin/test |
| 88 | mkdir -p ./npm-asmjs/bin/test |
| 89 | ./compile.sh test |
Kevin Lubick | f14a3c0 | 2018-08-22 09:35:32 -0400 | [diff] [blame] | 90 | cp ../../out/pathkit/pathkit.js ./npm-wasm/bin/test/pathkit.js |
Kevin Lubick | 641bf87 | 2018-08-06 14:49:39 -0400 | [diff] [blame] | 91 | cp ../../out/pathkit/pathkit.wasm ./npm-wasm/bin/test/pathkit.wasm |
Kevin Lubick | f14a3c0 | 2018-08-22 09:35:32 -0400 | [diff] [blame] | 92 | ./compile.sh asm.js test |
| 93 | cp ../../out/pathkit/pathkit.js ./npm-asmjs/bin/test/pathkit.js |
| 94 | cp ../../out/pathkit/pathkit.js.mem ./npm-asmjs/bin/test/pathkit.js.mem |
Kevin Lubick | 641bf87 | 2018-08-06 14:49:39 -0400 | [diff] [blame] | 95 | |
| 96 | npm-debug: |
| 97 | # This compile time is typically faster than release and good for use with |
| 98 | # local-example-test |
| 99 | mkdir -p ./npm-wasm/bin/debug |
| 100 | mkdir -p ./npm-asmjs/bin/debug |
| 101 | ./compile.sh debug |
Kevin Lubick | f14a3c0 | 2018-08-22 09:35:32 -0400 | [diff] [blame] | 102 | cp ../../out/pathkit/pathkit.js ./npm-wasm/bin/debug/pathkit.js |
| 103 | cp ../../out/pathkit/pathkit.wasm ./npm-wasm/bin/debug/pathkit.wasm |
Kevin Lubick | cbcff38 | 2018-10-02 09:02:18 -0400 | [diff] [blame] | 104 | cp ../../out/pathkit/pathkit.wasm.map ./npm-wasm/bin/debug/pathkit.wasm.map |
Kevin Lubick | f14a3c0 | 2018-08-22 09:35:32 -0400 | [diff] [blame] | 105 | ./compile.sh asm.js debug |
| 106 | cp ../../out/pathkit/pathkit.js ./npm-asmjs/bin/debug/pathkit.js |
| 107 | cp ../../out/pathkit/pathkit.js.map ./npm-asmjs/bin/debug/pathkit.js.map |
Kevin Lubick | e1b36fe | 2018-08-02 11:30:33 -0400 | [diff] [blame] | 108 | |
Kevin Lubick | e1b36fe | 2018-08-02 11:30:33 -0400 | [diff] [blame] | 109 | example: |
Kevin Lubick | be5091c | 2018-08-31 10:45:18 -0400 | [diff] [blame] | 110 | npm install pathkit-asmjs pathkit-wasm |
Kevin Lubick | e1b36fe | 2018-08-02 11:30:33 -0400 | [diff] [blame] | 111 | echo "Go check out localhost:8000/npm-wasm/example.html" |
Kevin Lubick | b3d0e3e | 2018-08-03 12:24:06 -0400 | [diff] [blame] | 112 | python serve.py |
| 113 | |
| 114 | local-example: |
Kevin Lubick | be5091c | 2018-08-31 10:45:18 -0400 | [diff] [blame] | 115 | rm -rf node_modules/pathkit-wasm |
| 116 | rm -rf node_modules/pathkit-asmjs |
Kevin Lubick | b3d0e3e | 2018-08-03 12:24:06 -0400 | [diff] [blame] | 117 | mkdir -p node_modules |
Kevin Lubick | be5091c | 2018-08-31 10:45:18 -0400 | [diff] [blame] | 118 | ln -s -T ../npm-wasm node_modules/pathkit-wasm |
| 119 | ln -s -T ../npm-asmjs node_modules/pathkit-asmjs |
Kevin Lubick | f14a3c0 | 2018-08-22 09:35:32 -0400 | [diff] [blame] | 120 | echo "Go check out http://localhost:8000/npm-wasm/example.html" |
| 121 | echo "or http://localhost:8000/npm-asmjs/example.html" |
Kevin Lubick | b3d0e3e | 2018-08-03 12:24:06 -0400 | [diff] [blame] | 122 | python serve.py |
| 123 | |
Kevin Lubick | 641bf87 | 2018-08-06 14:49:39 -0400 | [diff] [blame] | 124 | local-example-test: |
Kevin Lubick | be5091c | 2018-08-31 10:45:18 -0400 | [diff] [blame] | 125 | rm -rf node_modules/pathkit-wasm |
| 126 | rm -rf node_modules/pathkit-asmjs |
| 127 | mkdir -p node_modules/pathkit-wasm |
| 128 | mkdir -p node_modules/pathkit-asmjs |
| 129 | ln -s -T ../../npm-wasm/bin/test node_modules/pathkit-wasm/bin |
| 130 | ln -s -T ../../npm-asmjs/bin/test node_modules/pathkit-asmjs/bin |
Kevin Lubick | 641bf87 | 2018-08-06 14:49:39 -0400 | [diff] [blame] | 131 | echo "Go check out localhost:8000/npm-wasm/example.html" |
Kevin Lubick | f14a3c0 | 2018-08-22 09:35:32 -0400 | [diff] [blame] | 132 | echo "or http://localhost:8000/npm-asmjs/example.html" |
Kevin Lubick | 641bf87 | 2018-08-06 14:49:39 -0400 | [diff] [blame] | 133 | python serve.py |
| 134 | |
Kevin Lubick | b3d0e3e | 2018-08-03 12:24:06 -0400 | [diff] [blame] | 135 | local-example-debug: |
Kevin Lubick | be5091c | 2018-08-31 10:45:18 -0400 | [diff] [blame] | 136 | rm -rf node_modules/pathkit-wasm |
| 137 | rm -rf node_modules/pathkit-asmjs |
| 138 | mkdir -p node_modules/pathkit-wasm |
| 139 | mkdir -p node_modules/pathkit-asmjs |
| 140 | ln -s -T ../../npm-wasm/bin/debug node_modules/pathkit-wasm/bin |
| 141 | ln -s -T ../../npm-asmjs/bin/debug node_modules/pathkit-asmjs/bin |
Kevin Lubick | b3d0e3e | 2018-08-03 12:24:06 -0400 | [diff] [blame] | 142 | echo "Go check out localhost:8000/npm-wasm/example.html" |
Kevin Lubick | f14a3c0 | 2018-08-22 09:35:32 -0400 | [diff] [blame] | 143 | echo "or http://localhost:8000/npm-asmjs/example.html" |
Kevin Lubick | 774be5a | 2018-09-07 14:00:41 -0400 | [diff] [blame] | 144 | python serve.py |
Kevin Lubick | e70c6b1 | 2018-11-06 07:49:40 -0500 | [diff] [blame] | 145 | |