diff --git a/README.md b/README.md index 1efc5d54f..b6a7a6cb8 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,7 @@ # Atala Prism Wallet SDK - Kotlin Multiplatform (Android/JVM) -[![Kotlin](https://img.shields.io/badge/kotlin-1.9.22-blue.svg?logo=kotlin)](http://kotlinlang.org) -![android](https://camo.githubusercontent.com/b1d9ad56ab51c4ad1417e9a5ad2a8fe63bcc4755e584ec7defef83755c23f923/687474703a2f2f696d672e736869656c64732e696f2f62616467652f706c6174666f726d2d616e64726f69642d3645444238442e7376673f7374796c653d666c6174) -![jvm](https://camo.githubusercontent.com/700f5dcd442fd835875568c038ae5cd53518c80ae5a0cf12c7c5cf4743b5225b/687474703a2f2f696d672e736869656c64732e696f2f62616467652f706c6174666f726d2d6a766d2d4442343133442e7376673f7374796c653d666c6174) +![badge-platform-android] +![badge-platform-jvm] ![Atala Prism Logo](Logo.png) @@ -42,11 +41,17 @@ Atala PRISM Kotlin multiplatform SDK provides the following building blocks to c To get started with the Atala PRISM kotlin multiplatform SDK, you can set up the SDK and start a new project or integrate it into an existing project. Before you start, make sure you have the following installed on your development machine: - Android: API level 21 and above. -- Kotlin 1.9.10 or later. +- Kotlin 1.9.22 or later. - JVM: 17 or later. ### Integrating the SDK in an existing project To integrate the SDK into an existing project, you have to import the SDK into your project: -`implementation("io.iohk.atala.prism:walletsdk:$sdk_version")` +```kotlin +implementation("io.iohk.atala.prism.walletsdk:atala-prism-sdk:") +``` + + +[badge-platform-android]: http://img.shields.io/badge/-android-6EDB8D.svg?style=flat +[badge-platform-jvm]: http://img.shields.io/badge/-jvm-DB413D.svg?style=flat diff --git a/atala-prism-sdk/build.gradle.kts b/atala-prism-sdk/build.gradle.kts index 161e04791..970bfdfaa 100644 --- a/atala-prism-sdk/build.gradle.kts +++ b/atala-prism-sdk/build.gradle.kts @@ -53,6 +53,7 @@ kotlin { useJUnitPlatform() } } + applyDefaultHierarchyTemplate() sourceSets { val commonMain by getting { @@ -141,6 +142,7 @@ kotlin { android { compileSdk = 33 sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml") + namespace = "io.iohk.atala.prism.walletsdk" defaultConfig { minSdk = 21 targetSdk = 33 @@ -189,7 +191,7 @@ tasks.withType().configureEach { dokkaSourceSets { configureEach { jdkVersion.set(11) - languageVersion.set("1.7.20") + languageVersion.set("1.9.22") apiVersion.set("2.0") includes.from( "docs/AtalaPrismSDK.md", diff --git a/build.gradle.kts b/build.gradle.kts index f71c3f8b7..2e9d8238b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,11 +1,17 @@ +import java.util.Base64 + +val publishedMavenId = "io.iohk.atala.prism.walletsdk" + plugins { id("org.jetbrains.kotlin.android") version "1.9.22" apply false kotlin("jvm") version "1.9.22" kotlin("plugin.serialization") version "1.8.20" - id("maven-publish") id("org.jlleitschuh.gradle.ktlint") version "11.5.1" id("org.jetbrains.dokka") version "1.9.0" id("org.jetbrains.kotlin.kapt") version "1.9.10" + id("maven-publish") + id("signing") + id("io.github.gradle-nexus.publish-plugin") version "2.0.0-rc-1" } buildscript { @@ -31,7 +37,7 @@ java { } allprojects { - this.group = "io.iohk.atala.prism.walletsdk" + this.group = publishedMavenId repositories { mavenLocal() @@ -56,13 +62,6 @@ allprojects { this.password = System.getenv("ATALA_GITHUB_TOKEN") } } - maven { - this.url = uri("https://github.com/input-output-hk/anoncreds-rs/") - credentials { - this.username = System.getenv("ATALA_GITHUB_ACTOR") - this.password = System.getenv("ATALA_GITHUB_TOKEN") - } - } } configurations.all { @@ -81,21 +80,6 @@ allprojects { } } } - - apply(plugin = "org.gradle.maven-publish") - - publishing { - repositories { - maven { - this.name = "GitHubPackages" - this.url = uri("https://maven.pkg.github.com/input-output-hk/atala-prism-wallet-sdk-kmm/") - credentials { - this.username = System.getenv("ATALA_GITHUB_ACTOR") - this.password = System.getenv("ATALA_GITHUB_TOKEN") - } - } - } - } } subprojects { @@ -119,8 +103,133 @@ subprojects { } } } + + if (this.name == "atala-prism-sdk") { + apply(plugin = "org.gradle.maven-publish") + apply(plugin = "org.gradle.signing") + + publishing { + publications { + withType { + groupId = publishedMavenId + artifactId = project.name + version = project.version.toString() + pom { + name.set("Atala PRISM Wallet SDK") + description.set("Atala Prism Wallet SDK - Kotlin Multiplatform (Android/JVM)") + url.set("https://docs.atalaprism.io/") + organization { + name.set("IOG") + url.set("https://iog.io/") + } + issueManagement { + system.set("Github") + url.set("https://github.com/input-output-hk/atala-prism-wallet-sdk-kmm") + } + licenses { + license { + name.set("The Apache License, Version 2.0") + url.set("https://www.apache.org/licenses/LICENSE-2.0.txt") + } + } + developers { + developer { + id.set("hamada147") + name.set("Ahmed Moussa") + email.set("ahmed.moussa@iohk.io") + organization.set("IOG") + roles.add("developer") + url.set("https://github.com/hamada147") + } + developer { + id.set("elribonazo") + name.set("Javier Ribó") + email.set("javier.ribo@iohk.io") + organization.set("IOG") + roles.add("developer") + } + developer { + id.set("cristianIOHK") + name.set("Cristian Gonzalez") + email.set("cristian.castro@iohk.io") + organization.set("IOG") + roles.add("developer") + url.set("https://github.com/cristianIOHK") + } + developer { + id.set("amagyar-iohk") + name.set("Allain Magyar") + email.set("allain.magyar@iohk.io") + organization.set("IOG") + roles.add("qc") + } + developer { + id.set("antonbaliasnikov") + name.set("Anton Baliasnikov") + email.set("anton.baliasnikov@iohk.io") + organization.set("IOG") + roles.add("qc") + } + developer { + id.set("goncalo-frade-iohk") + name.set("Gonçalo Frade") + email.set("goncalo.frade@iohk.io") + organization.set("IOG") + roles.add("developer") + } + } + scm { + connection.set("scm:git:git://input-output-hk/atala-prism-wallet-sdk-kmm.git") + developerConnection.set("scm:git:ssh://input-output-hk/atala-prism-wallet-sdk-kmm.git") + url.set("https://github.com/input-output-hk/atala-prism-wallet-sdk-kmm") + } + } + if (System.getenv("BASE64_ARMORED_GPG_SIGNING_KEY_MAVEN") != null) { + if (System.getenv("BASE64_ARMORED_GPG_SIGNING_KEY_MAVEN").isNotBlank()) { + signing { + val base64EncodedAsciiArmoredSigningKey: String = + System.getenv("BASE64_ARMORED_GPG_SIGNING_KEY_MAVEN") ?: "" + val signingKeyPassword: String = + System.getenv("SIGNING_KEY_PASSWORD") ?: "" + useInMemoryPgpKeys( + String( + Base64.getDecoder().decode( + base64EncodedAsciiArmoredSigningKey.toByteArray() + ) + ), + signingKeyPassword + ) + sign(this@withType) + } + } + } + } + } + repositories { +// maven { +// this.name = "GitHubPackages" +// this.url = uri("https://maven.pkg.github.com/input-output-hk/atala-prism-wallet-sdk-kmm") +// credentials { +// this.username = System.getenv("ATALA_GITHUB_ACTOR") +// this.password = System.getenv("ATALA_GITHUB_TOKEN") +// } +// } + } + } + } } tasks.dokkaGfmMultiModule.configure { outputDirectory.set(buildDir.resolve("dokkaCustomMultiModuleOutput")) } + +nexusPublishing { + repositories { + sonatype { + nexusUrl.set(uri("https://oss.sonatype.org/service/local/")) + snapshotRepositoryUrl.set(uri("https://oss.sonatype.org/content/repositories/snapshots/")) + username.set(System.getenv("SONATYPE_USERNAME")) + password.set(System.getenv("SONATYPE_PASSWORD")) + } + } +}