Skip to content

Commit

Permalink
fix: upgrade gradle & libs (#147)
Browse files Browse the repository at this point in the history
Signed-off-by: Ahmed Moussa <[email protected]>
  • Loading branch information
hamada147 authored Mar 6, 2024
1 parent ce739dd commit b0906dd
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 57 deletions.
14 changes: 4 additions & 10 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ concurrency:
cancel-in-progress: true

env:
JAVA_VERSION: 11
NODEJS_VERSION: 16.17.0
JAVA_VERSION: 17
ATALA_GITHUB_ACTOR: ${{ secrets.ATALA_GITHUB_ACTOR }}
ATALA_GITHUB_TOKEN: ${{ secrets.ATALA_GITHUB_TOKEN }}

Expand All @@ -34,25 +33,20 @@ jobs:
run: pwd

- name: "Checkout the repo"
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.ATALA_GITHUB_TOKEN }}
fetch-depth: 0

- name: "Install Java ${{ env.JAVA_VERSION }}"
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: "zulu"

- name: "Gradle Build Action"
uses: gradle/gradle-build-action@v2

- name: "Install NodeJS ${{ env.NODEJS_VERSION }}"
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODEJS_VERSION }}
uses: gradle/gradle-build-action@v3

- name: "Install Homebrew"
if: matrix.os-type == 'macos'
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/release-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ defaults:
shell: bash

env:
JAVA_VERSION: 11
NODEJS_VERSION: 16.17.0
JAVA_VERSION: 17
ATALA_GITHUB_ACTOR: ${{ secrets.ATALA_GITHUB_ACTOR }}
ATALA_GITHUB_TOKEN: ${{ secrets.ATALA_GITHUB_TOKEN }}

Expand All @@ -23,7 +22,7 @@ jobs:
runs-on: macos-latest
steps:
- name: "Checkout the repo"
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.ATALA_GITHUB_TOKEN }}
Expand Down
11 changes: 3 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ concurrency:
cancel-in-progress: true

env:
JAVA_VERSION: 11
JAVA_VERSION: 17
ATALA_GITHUB_ACTOR: ${{ secrets.ATALA_GITHUB_ACTOR }}
GITHUB_ACTOR: ${{ secrets.ATALA_GITHUB_ACTOR }}
ATALA_GITHUB_TOKEN: ${{ secrets.ATALA_GITHUB_TOKEN }}
Expand All @@ -27,23 +27,18 @@ jobs:
runs-on: macos-13
steps:
- name: "Checkout the repo"
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.ATALA_GITHUB_TOKEN }}
fetch-depth: 0

- name: "Install Java ${{ env.JAVA_VERSION }}"
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: "${{ env.JAVA_VERSION }}"
distribution: zulu

- name: "Install NodeJS ${{ env.NODEJS_VERSION }}"
uses: actions/setup-node@v3
with:
node-version: "lts/*"

- name: "Install Homebrew"
run: >
/bin/bash -c "$(curl -fsSL
Expand Down
47 changes: 21 additions & 26 deletions apollo/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ val os: OperatingSystem = OperatingSystem.current()

plugins {
kotlin("multiplatform")
id("io.github.luca992.multiplatform-swiftpackage") version "2.0.5-arm64"
id("io.github.luca992.multiplatform-swiftpackage") version "2.2.2"
id("com.android.library")
id("org.jetbrains.dokka")
id("dev.petuska.npm.publish") version "3.4.1"
Expand All @@ -26,15 +26,15 @@ fun org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget.swiftCinterop(libr
when (platform) {
"iosX64", "iosSimulatorArm64" -> {
includeDirs.headerFilterOnly("$rootDir/iOSLibs/$library/build/Release-iphonesimulator/include/")
tasks[interopProcessingTaskName].dependsOn(":iOSLibs:build${library.capitalize()}Iphonesimulator")
tasks[interopProcessingTaskName].dependsOn(":iOSLibs:build${library.replaceFirstChar(Char::uppercase)}Iphonesimulator")
}
"iosArm64" -> {
includeDirs.headerFilterOnly("$rootDir/iOSLibs/$library/build/Release-iphoneos/include/")
tasks[interopProcessingTaskName].dependsOn(":iOSLibs:build${library.capitalize()}Iphoneos")
tasks[interopProcessingTaskName].dependsOn(":iOSLibs:build${library.replaceFirstChar(Char::uppercase)}Iphoneos")
}
"macosX64", "macosArm64" -> {
includeDirs.headerFilterOnly("$rootDir/iOSLibs/$library/build/Release/include/")
tasks[interopProcessingTaskName].dependsOn(":iOSLibs:build${library.capitalize()}Macosx")
tasks[interopProcessingTaskName].dependsOn(":iOSLibs:build${library.replaceFirstChar(Char::uppercase)}Macosx")
}
}
}
Expand Down Expand Up @@ -66,7 +66,7 @@ kotlin {
}
compilations.all {
kotlinOptions {
jvmTarget = "11"
jvmTarget = "17"
}
}
testRuns["test"].executionTask.configure {
Expand Down Expand Up @@ -159,10 +159,10 @@ kotlin {
sourceSets {
val commonMain by getting {
dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.1")
implementation("com.ionspin.kotlin:bignum:0.3.8")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.2")
implementation("com.ionspin.kotlin:bignum:0.3.9")
implementation("org.kotlincrypto.macs:hmac-sha2:0.3.0")
implementation("org.kotlincrypto.hash:sha2:0.3.0")
implementation("org.kotlincrypto.hash:sha2:0.4.0")
}
}
val commonTest by getting {
Expand All @@ -172,9 +172,9 @@ kotlin {
}
val androidMain by getting {
dependencies {
api("fr.acinq.secp256k1:secp256k1-kmp:0.11.0")
api("fr.acinq.secp256k1:secp256k1-kmp:0.14.0")
implementation("fr.acinq.secp256k1:secp256k1-kmp-jni-jvm:0.11.0")
implementation("fr.acinq.secp256k1:secp256k1-kmp-jni-android:0.11.0")
implementation("fr.acinq.secp256k1:secp256k1-kmp-jni-android:0.14.0")
implementation("com.google.guava:guava:30.1-jre")
implementation("org.bouncycastle:bcprov-jdk15on:1.68")
implementation("org.bitcoinj:bitcoinj-core:0.16.2")
Expand All @@ -187,7 +187,7 @@ kotlin {
}
val jvmMain by getting {
dependencies {
api("fr.acinq.secp256k1:secp256k1-kmp:0.11.0")
api("fr.acinq.secp256k1:secp256k1-kmp:0.14.0")
implementation("fr.acinq.secp256k1:secp256k1-kmp-jni-jvm:0.11.0")
implementation("com.google.guava:guava:30.1-jre")
implementation("org.bouncycastle:bcprov-jdk15on:1.68")
Expand All @@ -206,7 +206,7 @@ kotlin {
implementation(npm("@noble/curves", "1.2.0"))
implementation(npm("@stablelib/x25519", "1.0.3"))
implementation(npm("hash.js", "1.1.7"))
implementation(npm("@noble/hashes", "1.3.1", true))
implementation(npm("@noble/hashes", "1.3.1"))

// Polyfill dependencies
implementation(npm("stream-browserify", "3.0.0"))
Expand Down Expand Up @@ -244,15 +244,14 @@ kotlin {

android {
namespace = "io.iohk.atala.prism.apollo"
compileSdk = 33
compileSdk = 34
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
defaultConfig {
minSdk = 21
targetSdk = 33
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
/**
* Because Software Components will not be created automatically for Maven publishing from
Expand Down Expand Up @@ -323,8 +322,8 @@ tasks.withType<DokkaTask>().configureEach {
}
dokkaSourceSets {
configureEach {
jdkVersion.set(11)
languageVersion.set("1.9.21")
jdkVersion.set(17)
languageVersion.set("1.9.22")
apiVersion.set("2.0")
includes.from(
"docs/Apollo.md",
Expand Down Expand Up @@ -388,14 +387,10 @@ npmPublish {

// Workaround for a bug in Gradle
afterEvaluate {
tasks.named("lintAnalyzeDebug") {
this.enabled = false
}
tasks.named("lintAnalyzeRelease") {
this.enabled = false
}
tasks.named("iosX64Test") {
this.enabled = false
if (tasks.findByName("iosX64Test") != null) {
tasks.named("iosX64Test") {
this.enabled = false
}
}
tasks.withType<PublishToMavenRepository> {
dependsOn(tasks.withType<Sign>())
Expand Down
8 changes: 1 addition & 7 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin
import java.util.Base64

val publishedMavenId: String = "io.iohk.atala.prism.apollo"
Expand All @@ -11,6 +9,7 @@ plugins {
id("org.jetbrains.kotlinx.kover") version "0.7.5"
id("io.github.gradle-nexus.publish-plugin") version "2.0.0-rc-1"
id("signing")
id("com.android.library") version "8.1.4" apply false
}

buildscript {
Expand All @@ -21,7 +20,6 @@ buildscript {
}
dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.22")
classpath("com.android.tools.build:gradle:7.2.2")
classpath("org.jetbrains.dokka:dokka-base:1.9.10")
}
}
Expand Down Expand Up @@ -181,10 +179,6 @@ subprojects {
}
}

rootProject.plugins.withType(NodeJsRootPlugin::class.java) {
rootProject.extensions.getByType(NodeJsRootExtension::class.java).nodeVersion = "16.17.0"
}

nexusPublishing {
repositories {
sonatype {
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Wed Aug 24 15:28:52 EET 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
2 changes: 1 addition & 1 deletion iOSLibs/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ val sdks = listOf("iphoneos", "iphonesimulator", "macosx")

libraries.forEach { library ->
sdks.forEach { sdk ->
tasks.create<Exec>("build${library.capitalize()}${sdk.capitalize()}") {
tasks.create<Exec>("build${library.replaceFirstChar(Char::uppercase)}${sdk.replaceFirstChar(Char::uppercase)}") {
group = "build swift"

if (os.isMacOsX) {
Expand Down
2 changes: 1 addition & 1 deletion secp256k1-kmp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fun KotlinNativeTarget.secp256k1CInterop(target: String) {
compilations["main"].cinterops {
val libsecp256k1 by creating {
includeDirs.headerFilterOnly(project.file("native/secp256k1/include/"))
tasks[interopProcessingTaskName].dependsOn(":secp256k1-kmp:native:buildSecp256k1${target.capitalize()}")
tasks[interopProcessingTaskName].dependsOn(":secp256k1-kmp:native:buildSecp256k1${target.replaceFirstChar(Char::uppercase)}")
}
}
}
Expand Down

0 comments on commit b0906dd

Please sign in to comment.