You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rust is required to build the project. Xcode is required to build and test Swift wrappers.
4
+
Andriod Stuio and Docker Desktop are required to build and test Android wrappers.
5
+
6
+
## Swift wrappers
7
+
8
+
### Build
9
+
10
+
Create Swift bindings by running `build-swift-framework.sh`. This will create xcframeworks from the
11
+
static libraries generated by UniFFI. It also creates Swift bindings and copy them to `swift/Sources` directory.
12
+
13
+
### Test
14
+
15
+
Run `USE_LOCAL_XCFRAMEWORK=1 swift test`. This will build the Swift package and run all the tests.
16
+
17
+
### Publish
18
+
19
+
Swift xcframeworks are created in `out` directory of each modules.
20
+
For example, anoncreds xcframework file is created at `anoncreds/out/anoncreds_uniffiFFI.xcframework`.
21
+
Zip the xcframework to a zip file using `zip -rq anoncreds/out/anoncreds_uniffiFFI.xcframework.zip anoncreds/out/anoncreds_uniffiFFI.xcframework` and then upload it as a github release asset. Checksum can be computed using `swift package compute-checksum anoncreds/out/anoncreds_uniffiFFI.xcframework.zip`. Finally, update the `url` and `checksum` properties of binaray targets in the Package.swift file. Note that we need to create a tag after the update of Package.swift.
22
+
23
+
## Kotlin wrappers
24
+
25
+
### Build
26
+
27
+
Create Kotlin bindings by running `build-kotlin-libraries.sh`. This will create libraries and Kotlin bindings in `out/kmpp-uniffi` directory.
28
+
29
+
### Test
30
+
31
+
Go to one of the Kotlin projects, e.g., `kotlin/anoncreds` and run tests using `./gradlew jvmTest`.
32
+
33
+
### Publish
34
+
35
+
#### Publish to Maven Local
36
+
37
+
Run `./gradlew publishToMavenLocal` to publish to Maven Local.
38
+
39
+
To use Maven Local in a seperate project you'll want to make sure to add it inside of your `build.gradle.kts`.
40
+
```kotlin
41
+
repositories {
42
+
mavenLocal()
43
+
mavenCentral()
44
+
google()
45
+
}
46
+
```
47
+
48
+
#### Publish Kotlin libraries to github
49
+
50
+
Publishing to github will require you to do a couple more steps. First we will want to get a github token with `write:packages` permissions, more details can be [found here](https://docs.github.com/en/packages/learn-github-packages/about-permissions-for-github-packages#about-scopes-and-permissions-for-package-registries).
51
+
52
+
Once you have a token you will want to add both your token and your github username into `kotlin/${library}/local.properties` like so:
53
+
```
54
+
githubUsername=ExampleUsername
55
+
githubToken=ghp_ajsldk1FakeTokenjkash
56
+
```
57
+
58
+
Now you can publish to github packages using `./gradlew publishAllPublicationsToGithubRepository`.
Copy file name to clipboardExpand all lines: README.md
+11-56Lines changed: 11 additions & 56 deletions
Original file line number
Diff line number
Diff line change
@@ -31,65 +31,18 @@ And add the following dependency to your target:
31
31
),
32
32
```
33
33
34
-
Take a look at the tests in `Tests`folder for examples on how to use the wrappers.
34
+
Take a look at the tests in `swift/Tests`directory for examples on how to use the wrappers.
35
35
36
36
### Kotlin
37
37
38
-
The Kotlin wrappers are set up to be distributed as a Maven package. In the future we aim to have releases on github packages. For now you will either have to use Maven Local or fork this repository and publish it yourself.
39
-
40
-
#### Generate Kotlin bindings
41
-
42
-
First step before publishing will be to generate the bindings. To generate all bindings for Kotlin just run the `build-kotlin-libraries.sh` file from root. You can also generate bindings for a specific library by running the `build-kotlin-libraries.sh` found inside of target library's directory. (ie: `/askar/build-kotlin-library.sh`)
43
-
44
-
#### Publish Kotlin libraries with Maven Local
45
-
46
-
Once bindings have been generated we can now publish to Maven Local. To do so we'll cd into the target kotlin wrapper (ie: `/kotlin/askar/`) and then we will run `./gradlew publishToMavenLocal`.
47
-
48
-
To use Maven Local in a seperate project you'll want to make sure to add it inside of your `build.gradle.kts`
49
-
```kotlin
50
-
repositories {
51
-
mavenLocal()
52
-
mavenCentral()
53
-
google()
54
-
}
55
-
```
56
-
57
-
#### Publish Kotlin libraries to github
58
-
59
-
Publishing to github will require you to do a couple more steps. First we will want to get a github token with `write:packages` permissions, more details can be [found here](https://docs.github.com/en/packages/learn-github-packages/about-permissions-for-github-packages#about-scopes-and-permissions-for-package-registries)
60
-
61
-
Once you have a token we will want to add both your token and your github username into `kotlin/${library}/local.properties` like so:
62
-
```
63
-
githubUsername=ExampleUsername
64
-
githubToken=ghp_ajsldk1FakeTokenjkash
65
-
```
66
-
Next you'll want to make sure you are targetting the correct URL for publishing. Make sure that the `setUrl` function in `kotlin/${library}/build.gradle.kts` targets your fork's URL instead of the main repository's.
Now we can publish to github packages. You'll want to call `./gradlew publishAllPublicationsToGithubRepository` inside of the target wrapper root directory.
85
-
38
+
The Kotlin wrappers are distributed as a Maven package hosted by GitHub Packages.
86
39
To add a github packages repository in a seperate project you will have to have a github token with `read:packages` permissions. Then you will add the repository to your `build.gradle.kts` like so:
Take a look at the tests in `kotlin/${library}/src/commonTest` for usage examples.
64
+
112
65
## Contributing
113
66
114
67
Pull requests are welcome! We enforce [developer certificate of origin](https://developercertificate.org/) (DCO) commit signing. See guidance [here](https://github.com/apps/dco).
115
68
69
+
Please see our [Developer Guide](DEVELOP.md) for more information.
70
+
116
71
## License
117
72
118
73
Aries uniffi wrappers are licensed under the [Apache License 2.0](LICENSE).
0 commit comments