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. |
| 54 | test-docker: npm-test |
Kevin Lubick | f14a3c0 | 2018-08-22 09:35:32 -0400 | [diff] [blame] | 55 | 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] | 56 | karma start /SRC/modules/pathkit/karma.conf.js --single-run |
Kevin Lubick | f14a3c0 | 2018-08-22 09:35:32 -0400 | [diff] [blame] | 57 | 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] | 58 | karma start /SRC/modules/pathkit/karma.conf.js --single-run |
Kevin Lubick | 92c9171 | 2018-08-09 10:00:02 -0400 | [diff] [blame] | 59 | |
| 60 | test-docker-continuous: |
| 61 | 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] | 62 | 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] | 63 | karma start /SRC/modules/pathkit/karma.conf.js --no-single-run |
Kevin Lubick | f14a3c0 | 2018-08-22 09:35:32 -0400 | [diff] [blame] | 64 | |
| 65 | test-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 Lubick | c7d0571 | 2018-08-31 10:03:23 -0400 | [diff] [blame] | 68 | karma start /SRC/modules/pathkit/karma.conf.js --no-single-run |
Kevin Lubick | 641bf87 | 2018-08-06 14:49:39 -0400 | [diff] [blame] | 69 | |
| 70 | npm-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 Lubick | f14a3c0 | 2018-08-22 09:35:32 -0400 | [diff] [blame] | 76 | cp ../../out/pathkit/pathkit.js ./npm-wasm/bin/test/pathkit.js |
Kevin Lubick | 641bf87 | 2018-08-06 14:49:39 -0400 | [diff] [blame] | 77 | cp ../../out/pathkit/pathkit.wasm ./npm-wasm/bin/test/pathkit.wasm |
Kevin Lubick | f14a3c0 | 2018-08-22 09:35:32 -0400 | [diff] [blame] | 78 | ./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 Lubick | 641bf87 | 2018-08-06 14:49:39 -0400 | [diff] [blame] | 81 | |
| 82 | npm-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 Lubick | f14a3c0 | 2018-08-22 09:35:32 -0400 | [diff] [blame] | 88 | 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 Lubick | e1b36fe | 2018-08-02 11:30:33 -0400 | [diff] [blame] | 94 | |
Kevin Lubick | e1b36fe | 2018-08-02 11:30:33 -0400 | [diff] [blame] | 95 | example: |
Kevin Lubick | be5091c | 2018-08-31 10:45:18 -0400 | [diff] [blame^] | 96 | npm install pathkit-asmjs pathkit-wasm |
Kevin Lubick | e1b36fe | 2018-08-02 11:30:33 -0400 | [diff] [blame] | 97 | echo "Go check out localhost:8000/npm-wasm/example.html" |
Kevin Lubick | b3d0e3e | 2018-08-03 12:24:06 -0400 | [diff] [blame] | 98 | python serve.py |
| 99 | |
| 100 | local-example: |
Kevin Lubick | be5091c | 2018-08-31 10:45:18 -0400 | [diff] [blame^] | 101 | rm -rf node_modules/pathkit-wasm |
| 102 | rm -rf node_modules/pathkit-asmjs |
Kevin Lubick | b3d0e3e | 2018-08-03 12:24:06 -0400 | [diff] [blame] | 103 | mkdir -p node_modules |
Kevin Lubick | be5091c | 2018-08-31 10:45:18 -0400 | [diff] [blame^] | 104 | ln -s -T ../npm-wasm node_modules/pathkit-wasm |
| 105 | ln -s -T ../npm-asmjs node_modules/pathkit-asmjs |
Kevin Lubick | f14a3c0 | 2018-08-22 09:35:32 -0400 | [diff] [blame] | 106 | echo "Go check out http://localhost:8000/npm-wasm/example.html" |
| 107 | echo "or http://localhost:8000/npm-asmjs/example.html" |
Kevin Lubick | b3d0e3e | 2018-08-03 12:24:06 -0400 | [diff] [blame] | 108 | python serve.py |
| 109 | |
Kevin Lubick | 641bf87 | 2018-08-06 14:49:39 -0400 | [diff] [blame] | 110 | local-example-test: |
Kevin Lubick | be5091c | 2018-08-31 10:45:18 -0400 | [diff] [blame^] | 111 | 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 Lubick | 641bf87 | 2018-08-06 14:49:39 -0400 | [diff] [blame] | 117 | echo "Go check out localhost:8000/npm-wasm/example.html" |
Kevin Lubick | f14a3c0 | 2018-08-22 09:35:32 -0400 | [diff] [blame] | 118 | echo "or http://localhost:8000/npm-asmjs/example.html" |
Kevin Lubick | 641bf87 | 2018-08-06 14:49:39 -0400 | [diff] [blame] | 119 | python serve.py |
| 120 | |
Kevin Lubick | b3d0e3e | 2018-08-03 12:24:06 -0400 | [diff] [blame] | 121 | local-example-debug: |
Kevin Lubick | be5091c | 2018-08-31 10:45:18 -0400 | [diff] [blame^] | 122 | 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 Lubick | b3d0e3e | 2018-08-03 12:24:06 -0400 | [diff] [blame] | 128 | echo "Go check out localhost:8000/npm-wasm/example.html" |
Kevin Lubick | f14a3c0 | 2018-08-22 09:35:32 -0400 | [diff] [blame] | 129 | echo "or http://localhost:8000/npm-asmjs/example.html" |
Kevin Lubick | e1b36fe | 2018-08-02 11:30:33 -0400 | [diff] [blame] | 130 | python serve.py |