-
-
Notifications
You must be signed in to change notification settings - Fork 544
Expand file tree
/
Copy pathMakefile
More file actions
97 lines (77 loc) · 3.24 KB
/
Copy pathMakefile
File metadata and controls
97 lines (77 loc) · 3.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
NODE_MODULES?=node_modules
.PHONY: clean help all build compile typedoc typedoc-dev doc doc-contrib doc-api javalint todo capacitor-package capacitor-publish check-versions
help:
@echo ""
@echo "Usage: make <target>"
@echo ""
@echo "available targets:"
@echo " all ............... Test and generate everything."
@echo " build ............. Generate and test javascript files for iOS and Android."
@echo " test .............. Run unit tests."
@echo " doc ............... Generate the documentation."
@echo " javalint .......... Check the syntax of java code."
@echo " clean ............. Cleanup the project (temporary and generated files)."
@echo ""
@echo "extra targets"
@echo " todo .............. Find TODO in the code."
@echo " typedoc ........... Generate public API reference into api/"
@echo " typedoc-dev ....... Generate developer API reference into api-dev/"
@echo " compile ........... Just compile the typescript code into javascript"
@echo " capacitor-package . Build Capacitor plugin package"
@echo " capacitor-publish . Publish Capacitor plugin to npm"
@echo " check-versions .... Verify all version numbers match"
@echo ""
@echo "(c)2014-, Jean-Christophe Hoelt <hoelt@fovea.cc>"
@echo ""
@#echo " tests ............. Run all tests."
@#echo " test-js ........... Test javascript files for errors."
@#echo " test-js-coverage .. Test javascript with coverage information."
@#echo " test-install ...... Test plugin installation on iOS and Android."
all: build doc capacitor-package
build: compile
@make tests
compile:
@make check-tsc
@echo "- Compiling TypeScript"
@${NODE_MODULES}/.bin/tsc
# for backward compatibility for older scripts
proprocess: compile
test-js:
@npm test
.checkstyle.jar:
curl "https://github.com/checkstyle/checkstyle/releases/download/checkstyle-10.3.4/checkstyle-10.3.4-all.jar" -o .checkstyle.jar -L
javalint: .checkstyle.jar
java -jar .checkstyle.jar -c /google_checks.xml src/android/cc/fovea/PurchasePlugin.java
tests: test-js javalint
check-tsc:
@test -e "${NODE_MODULES}/.bin/tsc" || ( echo "${NODE_MODULES} not found."; echo 'Please install dependencies: npm install'; exit 1 )
typedoc:
@echo "- Updating api/"
@npm run typedoc
typedoc-dev:
@echo "- Updating api-dev/"
@npm run typedoc-dev
doc: typedoc typedoc-dev
# Capacitor plugin packaging
capacitor-package: compile
@echo "Packaging Capacitor plugin..."
cp www/store.js capacitor/www/store.js
cp www/store.d.ts capacitor/www/store.d.ts
mkdir -p capacitor/src/ts/platforms/iaptic-js
cp src/ts/platforms/iaptic-js/iaptic-js-types.d.ts capacitor/src/ts/platforms/iaptic-js/
cd capacitor && npm run build
@ROOT_VERSION=$$(node -p "require('./package.json').version"); \
CAP_VERSION=$$(node -p "require('./capacitor/package.json').version"); \
if [ "$$ROOT_VERSION" != "$$CAP_VERSION" ]; then \
echo "ERROR: Version mismatch! root=$$ROOT_VERSION capacitor=$$CAP_VERSION"; \
exit 1; \
fi
@echo "Capacitor package ready (version $$(node -p "require('./capacitor/package.json').version"))"
capacitor-publish: capacitor-package
cd capacitor && npm publish
check-versions:
@./versions
clean:
@find . -name '*~' -exec rm '{}' ';'
todo:
@grep -rE "TODO|XXX" src/ts src/android src/ios src/windows