From 2544187adce463857f3196b566d494f912ba6300 Mon Sep 17 00:00:00 2001 From: Ahmed Moussa Date: Wed, 4 Oct 2023 19:43:19 +0300 Subject: [PATCH] build: update version - update kotlin - code enhancements --- didcomm/build.gradle.kts | 26 ++------------ didcomm/didcomm.podspec | 2 +- didpeer/build.gradle.kts | 34 ++++--------------- didpeer/didpeer.podspec | 2 +- .../DIDDoc.kt | 3 +- .../Exceptions.kt | 8 +++-- .../PeerDIDResolver.kt | 2 ++ 7 files changed, 19 insertions(+), 58 deletions(-) diff --git a/didcomm/build.gradle.kts b/didcomm/build.gradle.kts index 9357927..387f04e 100644 --- a/didcomm/build.gradle.kts +++ b/didcomm/build.gradle.kts @@ -42,6 +42,7 @@ kotlin { this.moduleName = currentModuleName this.binaries.library() this.useCommonJs() + generateTypeScriptDefinitions() this.compilations["main"].packageJson { this.version = rootProject.version.toString() } @@ -53,15 +54,7 @@ kotlin { this.output.library = currentModuleName this.output.libraryTarget = Target.VAR } - this.commonWebpackConfig { - this.cssSupport { - this.enabled = true - } - } this.testTask { - if (os.isWindows) { - this.enabled = false - } this.useKarma { this.useChromeHeadless() } @@ -69,9 +62,6 @@ kotlin { } nodejs { this.testTask { - if (os.isWindows) { - this.enabled = false - } this.useKarma { this.useChromeHeadless() } @@ -192,9 +182,7 @@ android { tasks.withType { moduleName.set(project.name) moduleVersion.set(rootProject.version.toString()) - description = """ - This is a Kotlin Multiplatform Library for Mercury - """.trimIndent() + description = "This is a Kotlin Multiplatform Library for Mercury" dokkaSourceSets { // TODO: Figure out how to include files to the documentations named("commonMain") { @@ -202,13 +190,3 @@ tasks.withType { } } } - -// afterEvaluate { -// tasks.withType { -// testLogging { -// events("passed", "skipped", "failed", "standard_out", "standard_error") -// showExceptions = true -// showStackTraces = true -// } -// } -// } diff --git a/didcomm/didcomm.podspec b/didcomm/didcomm.podspec index cd8fbc5..e139a3b 100644 --- a/didcomm/didcomm.podspec +++ b/didcomm/didcomm.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |spec| spec.name = 'didcomm' - spec.version = '1.0.3-alpha' + spec.version = '1.0.4-alpha' spec.homepage = '' spec.source = { :http=> ''} spec.authors = 'IOG' diff --git a/didpeer/build.gradle.kts b/didpeer/build.gradle.kts index 4840cdb..ac8e044 100644 --- a/didpeer/build.gradle.kts +++ b/didpeer/build.gradle.kts @@ -43,6 +43,7 @@ kotlin { this.moduleName = currentModuleName this.binaries.library() this.useCommonJs() + generateTypeScriptDefinitions() this.compilations["main"].packageJson { this.version = rootProject.version.toString() } @@ -54,15 +55,7 @@ kotlin { this.output.library = currentModuleName this.output.libraryTarget = Target.VAR } - this.commonWebpackConfig { - this.cssSupport { - this.enabled = true - } - } this.testTask { - if (os.isWindows) { - this.enabled = false - } this.useKarma { this.useChromeHeadless() } @@ -70,9 +63,6 @@ kotlin { } nodejs { this.testTask { - if (os.isWindows) { - this.enabled = false - } this.useKarma { this.useChromeHeadless() } @@ -98,10 +88,10 @@ kotlin { sourceSets { val commonMain by getting { dependencies { - implementation("io.iohk.atala.prism.apollo:multibase:1.7.0-alpha") - implementation("io.iohk.atala.prism.apollo:varint:1.7.0-alpha") - implementation("io.iohk.atala.prism.apollo:base64:1.7.0-alpha") - implementation("io.iohk.atala.prism.apollo:base58:1.7.0-alpha") + implementation("io.iohk.atala.prism.apollo:multibase:1.0.2") + implementation("io.iohk.atala.prism.apollo:varint:1.0.2") + implementation("io.iohk.atala.prism.apollo:base64:1.0.2") + implementation("io.iohk.atala.prism.apollo:base58:1.0.2") implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.1") implementation("com.squareup.okio:okio:3.2.0") } @@ -197,9 +187,7 @@ android { tasks.withType { moduleName.set(project.name) moduleVersion.set(rootProject.version.toString()) - description = """ - This is a Kotlin Multiplatform Library for Mercury DIDPeer - """.trimIndent() + description = "This is a Kotlin Multiplatform Library for Mercury DIDPeer" dokkaSourceSets { // TODO: Figure out how to include files to the documentations named("commonMain") { @@ -207,13 +195,3 @@ tasks.withType { } } } - -// afterEvaluate { -// tasks.withType { -// testLogging { -// events("passed", "skipped", "failed", "standard_out", "standard_error") -// showExceptions = true -// showStackTraces = true -// } -// } -// } diff --git a/didpeer/didpeer.podspec b/didpeer/didpeer.podspec index 62c944e..1efbc35 100644 --- a/didpeer/didpeer.podspec +++ b/didpeer/didpeer.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |spec| spec.name = 'didpeer' - spec.version = '1.0.3-alpha' + spec.version = '1.0.4-alpha' spec.homepage = '' spec.source = { :http=> ''} spec.authors = 'IOG' diff --git a/didpeer/src/commonMain/kotlin/io.iohk.atala.prism.didcomm.didpeer/DIDDoc.kt b/didpeer/src/commonMain/kotlin/io.iohk.atala.prism.didcomm.didpeer/DIDDoc.kt index 8904ba2..ae74d12 100644 --- a/didpeer/src/commonMain/kotlin/io.iohk.atala.prism.didcomm.didpeer/DIDDoc.kt +++ b/didpeer/src/commonMain/kotlin/io.iohk.atala.prism.didcomm.didpeer/DIDDoc.kt @@ -5,6 +5,7 @@ import io.iohk.atala.prism.didcomm.didpeer.core.toJsonElement import kotlinx.serialization.Serializable import kotlinx.serialization.json.Json import kotlinx.serialization.json.jsonObject +import kotlin.jvm.JvmOverloads const val SERVICE_ID = "id" const val SERVICE_TYPE = "type" @@ -14,7 +15,7 @@ const val SERVICE_ROUTING_KEYS = "routingKeys" const val SERVICE_ACCEPT = "accept" @Serializable -data class DIDDocPeerDID( +data class DIDDocPeerDID @JvmOverloads constructor( val did: String, val authentication: List, val keyAgreement: List = emptyList(), diff --git a/didpeer/src/commonMain/kotlin/io.iohk.atala.prism.didcomm.didpeer/Exceptions.kt b/didpeer/src/commonMain/kotlin/io.iohk.atala.prism.didcomm.didpeer/Exceptions.kt index e608b6d..6d4651f 100644 --- a/didpeer/src/commonMain/kotlin/io.iohk.atala.prism.didcomm.didpeer/Exceptions.kt +++ b/didpeer/src/commonMain/kotlin/io.iohk.atala.prism.didcomm.didpeer/Exceptions.kt @@ -1,12 +1,14 @@ package io.iohk.atala.prism.didcomm.didpeer +import kotlin.jvm.JvmOverloads + /** * The base class for all PeerDID errors and exceptions. * * @param message - the detail message. * @param cause - the cause of this. */ -open class PeerDIDException(message: String, cause: Throwable? = null) : Throwable(message, cause) +open class PeerDIDException @JvmOverloads constructor(message: String, cause: Throwable? = null) : Throwable(message, cause) /** * Raised if the peer DID to be resolved in not a valid peer DID. @@ -14,7 +16,7 @@ open class PeerDIDException(message: String, cause: Throwable? = null) : Throwab * @param message - the detail message. * @param cause - the cause of this. */ -class MalformedPeerDIDException(message: String, cause: Throwable? = null) : +class MalformedPeerDIDException @JvmOverloads constructor(message: String, cause: Throwable? = null) : PeerDIDException("Invalid peer DID provided. $message", cause) /** @@ -22,5 +24,5 @@ class MalformedPeerDIDException(message: String, cause: Throwable? = null) : * * @param cause - the cause of this. */ -class MalformedPeerDIDDOcException(cause: Throwable? = null) : +class MalformedPeerDIDDOcException @JvmOverloads constructor(cause: Throwable? = null) : PeerDIDException("Invalid peer DID Doc", cause) diff --git a/didpeer/src/commonMain/kotlin/io.iohk.atala.prism.didcomm.didpeer/PeerDIDResolver.kt b/didpeer/src/commonMain/kotlin/io.iohk.atala.prism.didcomm.didpeer/PeerDIDResolver.kt index 727799b..2b144ab 100644 --- a/didpeer/src/commonMain/kotlin/io.iohk.atala.prism.didcomm.didpeer/PeerDIDResolver.kt +++ b/didpeer/src/commonMain/kotlin/io.iohk.atala.prism.didcomm.didpeer/PeerDIDResolver.kt @@ -9,6 +9,7 @@ import io.iohk.atala.prism.didcomm.didpeer.core.getVerificationMethod import io.iohk.atala.prism.didcomm.didpeer.core.validateAgreementMaterialType import io.iohk.atala.prism.didcomm.didpeer.core.validateAuthenticationMaterialType import kotlin.jvm.JvmName +import kotlin.jvm.JvmOverloads /** Resolves [DIDDocPeerDID] from [PeerDID] * @param [peerDID] PeerDID to resolve @@ -18,6 +19,7 @@ import kotlin.jvm.JvmName * - if a valid DIDDoc cannot be produced from the [peerDID] * @return resolved [DIDDocPeerDID] as JSON string */ +@JvmOverloads fun resolvePeerDID( peerDID: PeerDID, format: VerificationMaterialFormatPeerDID = VerificationMaterialFormatPeerDID.MULTIBASE