-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathMakefile
More file actions
78 lines (59 loc) · 2.83 KB
/
Makefile
File metadata and controls
78 lines (59 loc) · 2.83 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
.PHONY: all fmt clippy check test webpack webpack-npm grcov build-go build-go-mac build-go-musl
UNAME := $(shell uname)
all: fmt
cargo build
fmt:
cargo fmt --all -- --check
clippy:
cargo clippy --all -- -D warnings
check: fmt clippy
cargo deny check
# cargo outdated --exit-code 1
cargo pants
test: fmt clippy
cargo test --workspace --exclude kos-hardware
grcov:
cargo build
cargo test
# todo: fix grcov
# grcov ./target/debug/ -s . -t lcov --llvm --branch --ignore-not-existing --ignore "/*" -o lcov.info
webpack:
wasm-pack build --scope klever --target web --out-name index --out-dir ../../packages/kos-web/demo/kos ./packages/kos-web
webpack-npm:
wasm-pack build --scope klever --target bundler --release --out-name index --out-dir ../../packages/kos-web/demo/kos ./packages/kos-web
clean-mobile-build:
cd packages/kos-mobile && ./build_clean.sh
build-ksafe:
cargo build --package kos-hardware --target thumbv7em-none-eabihf --profile hardware
build-android:
cd packages/kos-mobile && ./build_android.sh
publish-android:
cd packages/kos-mobile/android && ./gradlew lib:publishKOSPublicationToGithubPackagesRepository
build-ios:
cd packages/kos-mobile && ./build_ios.sh
build-go:
cargo install uniffi-bindgen-go --git https://github.com/NordSecurity/uniffi-bindgen-go --tag v0.4.0+v0.28.3 && \
cargo build --release --package kos-mobile && uniffi-bindgen-go --library target/release/libkos_mobile.a --out-dir ./packages/kos-go
mkdir -p ./packages/kos-go/kos_mobile/lib/linux-amd64/ && \
cp target/release/libkos_mobile.so ./packages/kos-go/kos_mobile/lib/linux-amd64/
build-go-mac:
cargo install uniffi-bindgen-go --git https://github.com/NordSecurity/uniffi-bindgen-go --tag v0.4.0+v0.28.3 && \
cargo build --release --package kos-mobile && uniffi-bindgen-go --library target/release/libkos_mobile.a --out-dir ./packages/kos-go
mkdir -p ./packages/kos-go/kos_mobile/lib/darwin-aarch64/ && \
cp target/release/libkos_mobile.dylib ./packages/kos-go/kos_mobile/lib/darwin-aarch64/
build-go-musl:
cargo install uniffi-bindgen-go --git https://github.com/NordSecurity/uniffi-bindgen-go --tag v0.4.0+v0.28.3 && \
cargo build --profile min-size --target x86_64-unknown-linux-musl --package kos-mobile && \
uniffi-bindgen-go --library target/x86_64-unknown-linux-musl/min-size/libkos_mobile.a --out-dir ./packages/kos-go
mkdir -p ./packages/kos-go/kos_mobile/lib/linux-musl-amd64/ && \
cp target/x86_64-unknown-linux-musl/min-size/libkos_mobile.a ./packages/kos-go/kos_mobile/lib/linux-musl-amd64/
test-ios: build-ios
cd packages/kos-mobile/ios/framework/KOSMobile && xcodebuild \
-project KOSMobile.xcodeproj \
-scheme KOSMobile \
-sdk iphonesimulator \
-destination 'platform=iOS Simulator,OS=17.2,name=iPhone 15 Pro' \
CODE_SIGNING_ALLOWED=NO \
test
test-android: build-android
cd packages/kos-mobile/android && ./gradlew lib:testDebugUnitTest