-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: agent start and mediation achieved (#60)
fix: agent start
- Loading branch information
1 parent
b0086a1
commit e24f67a
Showing
40 changed files
with
1,237 additions
and
244 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,185 @@ | ||
import org.gradle.internal.os.OperatingSystem | ||
import org.jetbrains.dokka.gradle.DokkaTask | ||
import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackOutput.Target | ||
|
||
val currentModuleName: String = "WalletApollo" | ||
val os: OperatingSystem = OperatingSystem.current() | ||
val apolloVersion = project.property("apollo_version") | ||
plugins { | ||
kotlin("multiplatform") | ||
kotlin("plugin.serialization") version "1.7.20" | ||
id("com.android.library") | ||
id("org.jetbrains.dokka") | ||
} | ||
|
||
kotlin { | ||
android { | ||
publishAllLibraryVariants() | ||
} | ||
|
||
jvm { | ||
compilations.all { | ||
kotlinOptions { | ||
jvmTarget = "11" | ||
} | ||
} | ||
testRuns["test"].executionTask.configure { | ||
useJUnitPlatform() | ||
} | ||
} | ||
|
||
js(IR) { | ||
this.moduleName = currentModuleName | ||
this.binaries.library() | ||
this.useCommonJs() | ||
this.compilations["main"].packageJson { | ||
this.version = rootProject.version.toString() | ||
} | ||
this.compilations["test"].packageJson { | ||
this.version = rootProject.version.toString() | ||
} | ||
browser { | ||
this.webpackTask { | ||
this.output.library = currentModuleName | ||
this.output.libraryTarget = Target.VAR | ||
} | ||
this.testTask { | ||
this.useKarma { | ||
this.useChromeHeadless() | ||
} | ||
} | ||
} | ||
nodejs { | ||
this.testTask { | ||
this.useKarma { | ||
this.useChromeHeadless() | ||
} | ||
} | ||
} | ||
} | ||
|
||
sourceSets { | ||
|
||
val commonMain by getting { | ||
dependencies { | ||
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.1") | ||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4") | ||
implementation("io.iohk.atala.prism:base-asymmetric-encryption:$apolloVersion") | ||
implementation("io.iohk.atala.prism:ecdsa:$apolloVersion") | ||
implementation("com.nimbusds:nimbus-jose-jwt:9.31") | ||
implementation("org.bouncycastle:bcprov-jdk15on:1.68") | ||
implementation(project(":domain")) | ||
} | ||
} | ||
val commonTest by getting { | ||
dependencies { | ||
implementation("org.slf4j:slf4j-simple:1.7.30") | ||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.4") | ||
implementation("io.iohk.atala.prism:ecdsa:$apolloVersion") | ||
implementation(kotlin("test")) | ||
} | ||
} | ||
val jvmMain by getting { | ||
dependencies { | ||
api(kotlin("stdlib-jdk8")) | ||
api(kotlin("reflect")) | ||
} | ||
} | ||
val jvmTest by getting { | ||
dependencies { | ||
implementation("junit:junit:4.13.2") | ||
} | ||
} | ||
val androidMain by getting { | ||
dependencies { | ||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4") | ||
implementation("org.bouncycastle:bcprov-jdk15on:1.68") | ||
} | ||
} | ||
val androidTest by getting { | ||
dependencies { | ||
implementation("junit:junit:4.13.2") | ||
} | ||
} | ||
val jsMain by getting { | ||
dependencies { | ||
implementation("org.jetbrains.kotlinx:kotlinx-nodejs:0.0.7") | ||
implementation("org.jetbrains.kotlin:kotlin-stdlib-common:1.7.20") | ||
implementation("org.jetbrains.kotlin:kotlin-stdlib-js:1.7.20") | ||
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.1") | ||
implementation(npm("stream-browserify", "3.0.0")) | ||
implementation(npm("buffer", "6.0.3")) | ||
} | ||
} | ||
val jsTest by getting | ||
|
||
all { | ||
languageSettings.optIn("kotlin.RequiresOptIn") | ||
} | ||
} | ||
} | ||
|
||
android { | ||
compileSdk = 32 | ||
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml") | ||
defaultConfig { | ||
minSdk = 21 | ||
targetSdk = 32 | ||
} | ||
compileOptions { | ||
sourceCompatibility = JavaVersion.VERSION_11 | ||
targetCompatibility = JavaVersion.VERSION_11 | ||
} | ||
/** | ||
* Because Software Components will not be created automatically for Maven publishing from | ||
* Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android. | ||
* disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new | ||
* publishing DSL. | ||
*/ | ||
publishing { | ||
multipleVariants { | ||
withSourcesJar() | ||
withJavadocJar() | ||
allVariants() | ||
} | ||
} | ||
} | ||
|
||
ktlint { | ||
filter { | ||
exclude("build/generated-src/**") | ||
exclude("**/generated/**") | ||
exclude("**/generated-src/**") | ||
exclude { | ||
it.file.path.contains("generated-src") | ||
} | ||
exclude { | ||
it.file.path.contains("generated") | ||
} | ||
} | ||
} | ||
|
||
// Dokka implementation | ||
tasks.withType<DokkaTask> { | ||
moduleName.set(project.name) | ||
moduleVersion.set(rootProject.version.toString()) | ||
description = """ | ||
This is a Kotlin Multiplatform Wallet-Core-SDK Library | ||
""".trimIndent() | ||
dokkaSourceSets { | ||
// TODO: Figure out how to include files to the documentations | ||
named("commonMain") { | ||
includes.from("Module.md", "docs/Module.md") | ||
} | ||
} | ||
} | ||
|
||
// afterEvaluate { | ||
// tasks.withType<AbstractTestTask> { | ||
// testLogging { | ||
// events("passed", "skipped", "failed", "standard_out", "standard_error") | ||
// showExceptions = true | ||
// showStackTraces = true | ||
// } | ||
// } | ||
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
...rism-sdk/src/androidMain/kotlin/io/iohk/atala/prism/walletsdk/domain/models/HttpClient.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package io.iohk.atala.prism.walletsdk.domain.models | ||
|
||
import io.ktor.client.HttpClientConfig | ||
import io.ktor.client.engine.okhttp.OkHttp | ||
|
||
actual fun httpClient(config: HttpClientConfig<*>.() -> Unit) = io.ktor.client.HttpClient(OkHttp) { | ||
config(this) | ||
} |
8 changes: 0 additions & 8 deletions
8
...sdk/src/androidMain/kotlin/io/iohk/atala/prism/walletsdk/prismagent/helpers/HttpClient.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
...m/walletsdk/prismagent/helpers/ApiImpl.kt → .../prism/walletsdk/domain/models/ApiImpl.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
...prism-sdk/src/commonMain/kotlin/io/iohk/atala/prism/walletsdk/domain/models/HttpClient.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package io.iohk.atala.prism.walletsdk.domain.models | ||
|
||
import io.ktor.client.HttpClient | ||
import io.ktor.client.HttpClientConfig | ||
|
||
expect fun httpClient(config: HttpClientConfig<*>.() -> Unit = {}): HttpClient |
12 changes: 12 additions & 0 deletions
12
...m-sdk/src/commonMain/kotlin/io/iohk/atala/prism/walletsdk/domain/models/OctetPublicKey.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package io.iohk.atala.prism.walletsdk.domain.models | ||
|
||
import kotlinx.serialization.EncodeDefault | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class OctetPublicKey | ||
@JvmOverloads | ||
constructor(@EncodeDefault val kty: String = "OKP", val crv: String, val x: String) | ||
|
||
@Serializable | ||
data class OctetPrivateKey(val kty: String, val crv: String, val x: String, val d: String) |
Oops, something went wrong.