-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
86 lines (67 loc) · 2.38 KB
/
Makefile
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
CONFIG = debug
PLATFORM_IOS = iOS Simulator,id=$(call udid_for,iOS 17.5,iPhone \d\+ Pro [^M])
build:
cargo build --release
setup: build-debug-mode build-ios-bindings build-swift-apple-platforms
build-swift-apple-platforms:
export USE_LOCAL_RUST_XCFRAMEWORK=1; \
for platform in "iOS"; do \
xcodebuild \
-skipMacroValidation \
-configuration $(CONFIG) \
-workspace .github/package.xcworkspace \
-scheme yttrium \
-destination generic/platform="$$platform" || exit 1; \
done;
test-swift-apple-platforms:
for platform in "$(PLATFORM_IOS)" ; do \
xcodebuild test \
-skipMacroValidation \
-configuration $(CONFIG) \
-workspace .github/package.xcworkspace \
-scheme yttrium \
-destination platform="$$platform" || exit 1; \
done;
build-debug-mode:
cargo build
build-ios-bindings:
sh crates/ffi/build-rust-ios.sh
build-ios-bindings-release:
sh crates/ffi/build-rust-ios-release.sh
test:
cargo test --workspace
format:
cargo +nightly fmt --all
cargo sort --workspace --grouped
lint:
cargo +nightly fmt --all -- --check
cargo clippy --all -- -D warnings -A clippy::derive_partial_eq_without_eq -D clippy::unwrap_used -D clippy::uninlined_format_args
cargo sort --check --workspace --grouped
cargo +nightly udeps --workspace
clean:
cd crates/account/src/contracts && yarn clean && cd ../../../../
cargo clean
local-infra:
cd test/scripts/local_infra && sh local-infra.sh
local-infra-forked:
cd test/scripts/forked_state && sh local-infra.sh
local-infra-7702:
cd test/scripts/7702 && sh local-infra.sh
.PHONY: zip-rust-xcframework
zip-rust-xcframework:
mkdir -p Output
cd crates/ffi/YttriumCore/ && \
zip -r ../../../Output/RustXcframework.xcframework.zip \
RustXcframework.xcframework \
.PHONY: compute-rust-checksum
compute-rust-checksum:
swift package compute-checksum Output/RustXcframework.xcframework.zip > rust_checksum.txt
echo "Rust XCFramework checksum: $$(cat rust_checksum.txt)"
.PHONY: generate-package-swift
generate-package-swift:
chmod +x scripts/generate_package_swift.sh
./scripts/generate_package_swift.sh
.PHONY: build setup build-ios-bindings build-swift-apple-platforms test-swift-apple-platforms fetch-thirdparty setup-thirdparty test format clean local-infra local-infra-forked local-infra-7702
define udid_for
$(shell xcrun simctl list devices available '$(1)' | grep '$(2)' | sort -r | head -1 | awk -F '[()]' '{ print $$(NF-3) }')
endef