Skip to content

Commit

Permalink
build: update Kotlin to 1.9.20 (#122)
Browse files Browse the repository at this point in the history
Signed-off-by: Ahmed Moussa <[email protected]>
  • Loading branch information
hamada147 committed May 20, 2024
1 parent f7be4ae commit 6d23eb1
Show file tree
Hide file tree
Showing 28 changed files with 197 additions and 430 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
include:
- os: ubuntu-latest
os-type: linux
- os: macos-latest
- os: macos-13
os-type: macos
fail-fast: false
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -64,6 +64,11 @@ jobs:
run: |
brew install autoconf automake libtool
- uses: maxim-lobanov/setup-xcode@v1
if: matrix.os-type == 'macos'
with:
xcode-version: '15.0.1'

- name: "Test Kotlin code is properly formatted"
run: ./gradlew ktlintCheck

Expand Down
6 changes: 3 additions & 3 deletions .releaserc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ branches:
plugins:
- "@semantic-release/commit-analyzer"
- "@semantic-release/release-notes-generator"
- ["@semantic-release/changelog", {changelogFile: "CHANGELOG.md"}]
- [ "@semantic-release/changelog", { changelogFile: "CHANGELOG.md" } ]
- "gradle-semantic-release-plugin"
- [ '@semantic-release/exec', {
prepareCmd: './gradlew :apollo:createSwiftPackage' } ]
Expand Down Expand Up @@ -42,11 +42,11 @@ plugins:
notifyOnFail: true,
markdownReleaseNotes: true,
onSuccessTemplate:
{text: "A new version of `$package_name` successfully released!\n
{ text: "A new version of `$package_name` successfully released!\n
Version: `v$npm_package_version`\n
Tag: $repo_url/releases/tag/v$npm_package_version\n
\n
Release notes:\n
$release_notes"},
$release_notes" },
},
]
126 changes: 79 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Apollo

[![Kotlin](https://img.shields.io/badge/kotlin-1.7.21-blue.svg?logo=kotlin)](http://kotlinlang.org)
[![Kotlin](https://img.shields.io/badge/kotlin-1.9.20-blue.svg?logo=kotlin)](http://kotlinlang.org)
[![Build](https://github.com/input-output-hk/atala-prism-apollo/actions/workflows/pull-request.yml/badge.svg)](https://github.com/input-output-hk/atala-prism-apollo/actions/workflows/pull-request.yml)
[![Deployment](https://github.com/input-output-hk/atala-prism-apollo/actions/workflows/Deployment.yml/badge.svg)](https://github.com/input-output-hk/atala-prism-apollo/actions/workflows/Deployment.yml)

Expand All @@ -11,8 +11,6 @@
![js](https://camo.githubusercontent.com/3e0a143e39915184b54b60a2ecedec75e801f396d34b5b366c94ec3604f7e6bd/687474703a2f2f696d672e736869656c64732e696f2f62616467652f706c6174666f726d2d6a732d4638444235442e7376673f7374796c653d666c6174)
![getNode-js](https://camo.githubusercontent.com/d08fda729ceebcae0f23c83499ca8f06105350f037661ac9a4cc7f58edfdbca9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f706c6174666f726d2d6e6f64656a732d3638613036332e7376673f7374796c653d666c6174)
![macos](https://camo.githubusercontent.com/1b8313498db244646b38a4480186ae2b25464e5e8d71a1920c52b2be5212b909/687474703a2f2f696d672e736869656c64732e696f2f62616467652f706c6174666f726d2d6d61636f732d3131313131312e7376673f7374796c653d666c6174)
![tvos](https://camo.githubusercontent.com/4ac08d7fb1bcb8ef26388cd2bf53b49626e1ab7cbda581162a946dd43e6a2726/687474703a2f2f696d672e736869656c64732e696f2f62616467652f706c6174666f726d2d74766f732d3830383038302e7376673f7374796c653d666c6174)
![watchos](https://camo.githubusercontent.com/135dbadae40f9cabe7a3a040f9380fb485cff36c90909f3c1ae36b81c304426b/687474703a2f2f696d672e736869656c64732e696f2f62616467652f706c6174666f726d2d77617463686f732d4330433043302e7376673f7374796c653d666c6174)

![Atala Prism Logo](Logo.png)

Expand All @@ -25,6 +23,18 @@ A cryptography lib built with Kotlin Multiplatform with support for the followin

## How to build Apollo

### Set Environment Variables

Set variable `ATALA_GITHUB_ACTOR` with your GitHub Username and set variable `ATALA_GITHUB_TOKEN` with your GitHub Personal Access Token.

As an example we will go with `Bash`

1. Open CMD.
2. Run `sudo nano $HOME/.bash_profile`.
3. Insert `export ATALA_GITHUB_ACTOR="YOUR GITHUB USERNAME"`
4. Insert `export ATALA_GITHUB_TOKEN="YOUR GITHUB PERSONAL ACCESS TOKEN"`
5. Save profile and restart CMD to take effect.

### Install Homebrew (Mac Only)

```bash
Expand Down Expand Up @@ -101,6 +111,14 @@ You should be able to import and build the project in IntelliJ IDEA now.
Here is a list of common issues you might face and its solutions.
##### Enviroment Variables were added but not available
If you already added the envorment variable to your CMD profile and still not being available.
**Solution**
* Restart your Device.
##### No binary for ChromeHeadless browser on your platform
If you get error:
Expand Down Expand Up @@ -132,25 +150,66 @@ Could not find JNA native support
* Make sure that you are using Java version that is arch64.
## How to use for JVM/Android app
TBD
## How to use for iOS app
TBD
In `build.gradle.kts` files include the dependency
```kotlin
repositories {
mavenCentral()
maven {
this.url = uri("https://maven.pkg.github.com/input-output-hk/atala-prism-apollo")
credentials {
this.username = // GitHub Username
this.password = // GitHub Access Token
}
}
}
```
For dependencies
```kotlin
dependencies {
val apolloVersion = ... // Latest Apollo Version
implementation("io.iohk.atala.prism.apollo:apollo:$apolloVersion")
}
```
## How to use for JS app
TBD
## How to use for iOS app
## How to use for NodeJS app
TBD
### Using SPM
## How to use for Python
TBD
Inside your `Package.swift` file, add the following
```swift
dependencies: [
.package(
url: "[email protected]:input-output-hk/atala-prism-apollo.git",
from: "latest versoin"
)
]
```
### Using generated xcframework directly
The following instruction using Xcode 15
1. Go the [Release Page](https://github.com/input-output-hk/atala-prism-apollo/releases) and check the latest version and download the `Apollo.xcframework.zip` file.
2. Uncompress the downloaded file.
3. Add the `Apollo.xcframework` to your Xcode project.
4. When asked select Copy items if needed.
5. Then go to the project configuration page in Xcode and check the Frameworks and Libraries section and add the `Apollo.xcframework` if not found then choose `Embed & Sign`.
6. Then go to the build phase page and mark the framework as required.
## How to use for Node.js app
Inside the `package.json`
```json
{
"dependencies": {
"@atala/apollo": "latest version of Apollo"
}
}
```
## How to use for Scala
TBD
## How to use for another KMP (Kotlin Multiplatform) project
## How to use for another KMM project
You need to do the following:
1. You need to let Gradle know where to search for the Apollo package
2. Import the packages in the common target as per your project needs
1. Once you insert the import in the common target, it will automatically retrieve each supported target knowing that the currently only available targets are:
Expand All @@ -161,26 +220,13 @@ You need to do the following:
|------------------------------------------|--------------------|
| iOS x86 64 | :heavy_check_mark: |
| iOS Arm 64 | :heavy_check_mark: |
| iOS Arm 32 | :heavy_check_mark: |
| iOS Simulator Arm 64 (Apple Silicon) | :heavy_check_mark: |
| JVM | :heavy_check_mark: |
| Android | :heavy_check_mark: |
| JS Browser | :heavy_check_mark: |
| NodeJS Browser | :heavy_check_mark: |
| macOS X86 64 | :heavy_check_mark: |
| macOS Arm 64 (Apple Silicon) | :heavy_check_mark: |
| watchOS X86 32 | :heavy_check_mark: |
| watchOS Arm 64(_32) | :heavy_check_mark: |
| watchOS Arm 32 | :heavy_check_mark: |
| watchOS Simulator Arm 64 (Apple Silicon) | :heavy_check_mark: |
| tvOS X86 64 | :heavy_check_mark: |
| tvOS Arm 64 | :heavy_check_mark: |
| tvOS Simulator Arm 64 (Apple Silicon) | :heavy_check_mark: |
| Linux X86 64 | :x: |
| Linux Arm 64 | :x: |
| Linux Arm 32 | :x: |
| minGW X86 64 | :x: |
| minGW X86 32 | :x: |
**For the first, second & third point** we have two cases using Groovy and using Kotlin DSL
Expand All @@ -194,8 +240,8 @@ allprojects {
maven {
url = uri("https://maven.pkg.github.com/input-output-hk/atala-prism-apollo")
credentials {
username = System.getenv("ATALA_GITHUB_ACTOR") // this is CMD system environment and you can replace the retrieval of its value to any other preferable way if needed
password = System.getenv("ATALA_GITHUB_TOKEN") // this is CMD system environment and you can replace the retrieval of its value to any other preferable way if needed
username = // GitHub Username
password = // GitHub Access Token
}
}
}
Expand All @@ -204,13 +250,6 @@ allprojects {
In the module `build.gradle`
```groovy
kotlin {
// if you are going to use the iOS as one of the KMM module target. You need to use the new iOS hierarchy
ios() // New iOS hierarchy
// instead of the old way
iosX64()
iosArm64()
iosSimulatorArm64()
sourceSets {
commonMain {
dependencies {
Expand All @@ -232,22 +271,15 @@ allprojects {
maven {
url = uri("https://maven.pkg.github.com/input-output-hk/atala-prism-apollo")
credentials {
username = System.getenv("ATALA_GITHUB_ACTOR") // this is CMD system environment, and you can replace the retrieval of its value to any other preferable way if needed
password = System.getenv("ATALA_GITHUB_TOKEN") // this is CMD system environment, and you can replace the retrieval of its value to any other preferable way if needed
username = // GitHub Username
password = // GitHub Access Token
}
}
}
}
```
```kotlin
kotlin {
// if you are going to use the iOS as one of the KMM module target. You need to use the new iOS hierarchy
ios() // New iOS hierarchy
// instead of the old way
iosX64()
iosArm64()
iosSimulatorArm64()
sourceSets {
val commonMain by getting {
dependencies {
Expand All @@ -259,7 +291,7 @@ kotlin {
}
```
**For the third point**
You need to use Kotlin version `1.7.21`.
You need to use Kotlin version `1.9.20`.
## Usage
Expand Down
Loading

0 comments on commit 6d23eb1

Please sign in to comment.