-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
224 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
.env | ||
.idea/ | ||
.task/ | ||
sdk/c/lib/*/ | ||
sdk/swift/CHedera.xcframework/*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
version: "3" | ||
|
||
silent: true | ||
|
||
includes: | ||
rust: | ||
taskfile: ./sdk/rust/Taskfile.yml | ||
dir: ./sdk/rust | ||
|
||
swift: | ||
taskfile: ./sdk/swift/Taskfile.yml | ||
dir: ./sdk/swift | ||
|
||
tasks: | ||
build: | ||
deps: | ||
- rust:build | ||
- swift:build | ||
|
||
format: | ||
deps: | ||
- rust:format | ||
- swift:format | ||
|
||
lint: | ||
cmds: | ||
- task: rust:lint | ||
- task: swift:lint | ||
|
||
package: | ||
deps: | ||
- rust:package | ||
- swift:package | ||
|
||
# TODO: publish |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
version: "3" | ||
|
||
silent: false | ||
|
||
tasks: | ||
build: | ||
run: once | ||
generates: | ||
- target/debug/libhedera.a | ||
sources: | ||
- src/**/*.rs | ||
cmds: | ||
# Build the Hedera Rust SDK (in debug mode) | ||
- cargo build --message-format=short --features=ffi | ||
|
||
# Package for Swift | ||
- rm -rf ../swift/CHedera.xcframework/macos-*/ | ||
- mkdir -p ../swift/CHedera.xcframework/macos-{x86_64,arm64}/Headers/ | ||
- cp target/debug/libhedera.a ../swift/CHedera.xcframework/macos-x86_64/ | ||
- cp target/debug/libhedera.a ../swift/CHedera.xcframework/macos-arm64/ | ||
- cp ../c/include/hedera.h ../swift/CHedera.xcframework/macos-x86_64/Headers/ | ||
- cp ../c/include/hedera.h ../swift/CHedera.xcframework/macos-arm64/Headers/ | ||
- cp ../swift/CHedera.xcframework/module.modulemap ../swift/CHedera.xcframework/macos-x86_64/Headers/ | ||
- cp ../swift/CHedera.xcframework/module.modulemap ../swift/CHedera.xcframework/macos-arm64/Headers/ | ||
|
||
format: | ||
cmds: | ||
- cargo fmt | ||
|
||
lint: | ||
cmds: | ||
- cargo clippy --features=ffi --message-format=short | ||
|
||
package: | ||
run: once | ||
sources: | ||
- src/**/*.rs | ||
generates: | ||
- ../c/lib/macos-x86_64/libhedera.a | ||
- ../c/lib/ios-x86_64/libhedera.a | ||
- ../c/lib/macos-arm64/libhedera.a | ||
- ../c/lib/ios-arm64/libhedera.a | ||
- ../c/lib/linux-x86_64/libhedera.a | ||
- ../c/lib/windows-x86_64/libhedera.a | ||
- ../c/lib/macos-x86_64/libhedera.dylib | ||
- ../c/lib/macos-arm64/libhedera.dylib | ||
- ../c/lib/linux-x86_64/libhedera.so | ||
- ../c/lib/windows-x86_64/hedera.dll | ||
cmds: | ||
# | ||
# Build the Hedera Rust SDK (in release mode) | ||
# | ||
|
||
# Ensure we have rust-src | ||
- rustup component add rust-src 2> /dev/null | ||
|
||
# Build for target: x86_64-apple-darwin | ||
- rustup target add x86_64-apple-darwin 2> /dev/null | ||
- cargo build --features ffi --release -p hedera -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort --target x86_64-apple-darwin | ||
- strip -X -S -N -x ./target/x86_64-apple-darwin/release/libhedera.a 2> /dev/null | ||
- strip -X -S -N -x ./target/x86_64-apple-darwin/release/libhedera.dylib 2> /dev/null | ||
|
||
# Build for target: x86_64-apple-ios | ||
- rustup target add x86_64-apple-ios 2> /dev/null | ||
- cargo build --features ffi --release -p hedera -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort --target x86_64-apple-ios | ||
- strip -X -S -N -x ./target/x86_64-apple-ios/release/libhedera.a 2> /dev/null | ||
|
||
# Build for target: aarch64-apple-darwin | ||
- rustup target add aarch64-apple-darwin 2> /dev/null | ||
- cargo build --features ffi --release -p hedera -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort --target aarch64-apple-darwin | ||
- strip -X -S -N -x ./target/aarch64-apple-darwin/release/libhedera.a 2> /dev/null | ||
- strip -X -S -N -x ./target/aarch64-apple-darwin/release/libhedera.dylib 2> /dev/null | ||
|
||
# Build for target: aarch64-apple-ios | ||
- rustup target add aarch64-apple-ios 2> /dev/null | ||
- cargo build --features ffi --release -p hedera -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort --target aarch64-apple-ios | ||
- strip -X -S -N -x ./target/aarch64-apple-ios/release/libhedera.a 2> /dev/null | ||
|
||
# Build for target: x86_64-unknown-linux-gnu | ||
- rustup target add x86_64-unknown-linux-gnu 2> /dev/null | ||
|
||
- env | ||
CC_x86_64_unknown_linux_gnu=x86_64-unknown-linux-gnu-gcc | ||
CXX_x86_64_unknown_linux_gnu=x86_64-unknown-linux-gnu-g++ | ||
AR_x86_64_unknown_linux_gnu=x86_64-unknown-linux-gnu-ar | ||
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=x86_64-unknown-linux-gnu-gcc | ||
cargo build --features ffi --release -p hedera -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort --target x86_64-unknown-linux-gnu | ||
|
||
- x86_64-unknown-linux-gnu-strip --strip-unneeded target/x86_64-unknown-linux-gnu/release/libhedera.a 2> /dev/null | ||
- x86_64-unknown-linux-gnu-strip --strip-unneeded target/x86_64-unknown-linux-gnu/release/libhedera.so 2> /dev/null | ||
|
||
# Build for target: x86_64-pc-windows-gnu | ||
- rustup target add x86_64-pc-windows-gnu 2> /dev/null | ||
- cargo build --features ffi --release -p hedera -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort --target x86_64-pc-windows-gnu | ||
- x86_64-w64-mingw32-strip --strip-unneeded target/x86_64-pc-windows-gnu/release/libhedera.a 2> /dev/null | ||
- x86_64-w64-mingw32-strip --strip-unneeded target/x86_64-pc-windows-gnu/release/hedera.dll 2> /dev/null | ||
|
||
# | ||
# Package for C | ||
# | ||
|
||
- mkdir -p ../c/lib/{macos,ios}-{x86_64,arm64}/ | ||
- mkdir -p ../c/lib/{linux,windows}-x86_64/ | ||
|
||
- cp target/x86_64-apple-darwin/release/libhedera.a ../c/lib/macos-x86_64/ | ||
- cp target/x86_64-apple-ios/release/libhedera.a ../c/lib/ios-x86_64/ | ||
- cp target/aarch64-apple-darwin/release/libhedera.a ../c/lib/macos-arm64/ | ||
- cp target/aarch64-apple-ios/release/libhedera.a ../c/lib/ios-arm64/ | ||
- cp target/x86_64-unknown-linux-gnu/release/libhedera.a ../c/lib/linux-x86_64/ | ||
- cp target/x86_64-pc-windows-gnu/release/libhedera.a ../c/lib/windows-x86_64/ | ||
|
||
- cp target/x86_64-apple-darwin/release/libhedera.dylib ../c/lib/macos-x86_64/ | ||
- cp target/aarch64-apple-darwin/release/libhedera.dylib ../c/lib/macos-arm64/ | ||
- cp target/x86_64-unknown-linux-gnu/release/libhedera.so ../c/lib/linux-x86_64/ | ||
- cp target/x86_64-pc-windows-gnu/release/hedera.dll ../c/lib/windows-x86_64/ | ||
|
||
# | ||
# Package for Swift | ||
# | ||
|
||
- rm -rf ../swift/CHedera.xcframework/{ios,macos}-*/ | ||
|
||
- mkdir -p ../swift/CHedera.xcframework/macos-{x86_64,arm64}/Headers/ | ||
- mkdir -p ../swift/CHedera.xcframework/ios-{x86_64-simulator,arm64}/Headers/ | ||
|
||
- cp ../c/lib/macos-x86_64/libhedera.a ../swift/CHedera.xcframework/macos-x86_64/ | ||
- cp ../c/lib/macos-arm64/libhedera.a ../swift/CHedera.xcframework/macos-arm64/ | ||
- cp ../c/lib/ios-x86_64/libhedera.a ../swift/CHedera.xcframework/ios-x86_64-simulator/ | ||
- cp ../c/lib/ios-arm64/libhedera.a ../swift/CHedera.xcframework/ios-arm64/ | ||
|
||
- cp ../c/include/hedera.h ../swift/CHedera.xcframework/macos-x86_64/Headers/ | ||
- cp ../c/include/hedera.h ../swift/CHedera.xcframework/macos-arm64/Headers/ | ||
- cp ../c/include/hedera.h ../swift/CHedera.xcframework/ios-x86_64-simulator/Headers/ | ||
- cp ../c/include/hedera.h ../swift/CHedera.xcframework/ios-arm64/Headers/ | ||
|
||
- cp ../swift/CHedera.xcframework/module.modulemap ../swift/CHedera.xcframework/macos-x86_64/Headers/ | ||
- cp ../swift/CHedera.xcframework/module.modulemap ../swift/CHedera.xcframework/macos-arm64/Headers/ | ||
- cp ../swift/CHedera.xcframework/module.modulemap ../swift/CHedera.xcframework/ios-x86_64-simulator/Headers/ | ||
- cp ../swift/CHedera.xcframework/module.modulemap ../swift/CHedera.xcframework/ios-arm64/Headers/ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
.build/ | ||
CHedera.xcframework/*/ | ||
.vscode/launch.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
version: "3" | ||
|
||
silent: true | ||
|
||
includes: | ||
":rust": | ||
taskfile: ../rust/Taskfile.yml | ||
dir: ../rust | ||
|
||
tasks: | ||
build: | ||
deps: [":rust:build"] | ||
cmds: | ||
- swift build | ||
|
||
format: | ||
cmds: | ||
- swift format -i -p -r Sources Examples Package.swift | ||
|
||
lint: | ||
cmds: | ||
- swiftlint --strict --quiet | ||
|
||
package: | ||
deps: [":rust:package"] | ||
cmds: | ||
- swift build -c release |
This file was deleted.
Oops, something went wrong.