-
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.
- Loading branch information
Showing
17 changed files
with
358 additions
and
1 deletion.
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 |
---|---|---|
|
@@ -8,3 +8,4 @@ pluginManagement { | |
|
||
rootProject.name = "wallet-sdk" | ||
include(":wallet-sdk") | ||
include(":wallet-core-sdk") |
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,204 @@ | ||
import org.gradle.internal.os.OperatingSystem | ||
import org.jetbrains.dokka.gradle.DokkaTask | ||
import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackOutput.Target | ||
|
||
version = rootProject.version | ||
val currentModuleName: String = "wallet-core-sdk" | ||
val os: OperatingSystem = OperatingSystem.current() | ||
|
||
plugins { | ||
kotlin("multiplatform") | ||
kotlin("native.cocoapods") | ||
id("com.android.library") | ||
id("org.jetbrains.dokka") | ||
} | ||
|
||
kotlin { | ||
android { | ||
publishAllLibraryVariants() | ||
} | ||
jvm { | ||
compilations.all { | ||
kotlinOptions { | ||
jvmTarget = "11" | ||
} | ||
} | ||
testRuns["test"].executionTask.configure { | ||
useJUnitPlatform() | ||
} | ||
} | ||
if (os.isMacOsX) { | ||
ios() | ||
tvos() | ||
watchos() | ||
macosX64() | ||
if (System.getProperty("os.arch") != "x86_64") { // M1Chip | ||
iosSimulatorArm64() | ||
tvosSimulatorArm64() | ||
watchosSimulatorArm64() | ||
macosArm64() | ||
} | ||
} | ||
js(IR) { | ||
this.moduleName = currentModuleName | ||
this.binaries.executable() | ||
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.commonWebpackConfig { | ||
this.cssSupport { | ||
this.enabled = true | ||
} | ||
} | ||
this.testTask { | ||
this.useKarma { | ||
this.useChromeHeadless() | ||
} | ||
} | ||
} | ||
nodejs { | ||
this.testTask { | ||
this.useKarma { | ||
this.useChromeHeadless() | ||
} | ||
} | ||
} | ||
} | ||
|
||
if (os.isMacOsX) { | ||
cocoapods { | ||
this.summary = "Wallet-Core-SDK" | ||
this.version = rootProject.version.toString() | ||
this.authors = "IOG" | ||
this.ios.deploymentTarget = "13.0" | ||
this.osx.deploymentTarget = "12.0" | ||
this.tvos.deploymentTarget = "13.0" | ||
this.watchos.deploymentTarget = "8.0" | ||
framework { | ||
this.baseName = currentModuleName | ||
} | ||
} | ||
} | ||
|
||
sourceSets { | ||
val commonMain by getting | ||
val commonTest by getting { | ||
dependencies { | ||
implementation(kotlin("test")) | ||
} | ||
} | ||
val jvmMain by getting | ||
val jvmTest by getting { | ||
dependencies { | ||
implementation("junit:junit:4.13.2") | ||
} | ||
} | ||
val androidMain by getting | ||
val androidTest by getting { | ||
dependencies { | ||
implementation("junit:junit:4.13.2") | ||
} | ||
} | ||
val jsMain by getting | ||
val jsTest by getting | ||
if (os.isMacOsX) { | ||
val iosMain by getting | ||
val iosTest by getting | ||
val tvosMain by getting | ||
val tvosTest by getting | ||
val watchosMain by getting | ||
val watchosTest by getting | ||
val macosX64Main by getting | ||
val macosX64Test by getting | ||
if (System.getProperty("os.arch") != "x86_64") { // M1Chip | ||
val iosSimulatorArm64Main by getting { | ||
this.dependsOn(iosMain) | ||
} | ||
val iosSimulatorArm64Test by getting { | ||
this.dependsOn(iosTest) | ||
} | ||
val tvosSimulatorArm64Main by getting { | ||
this.dependsOn(tvosMain) | ||
} | ||
val tvosSimulatorArm64Test by getting { | ||
this.dependsOn(tvosTest) | ||
} | ||
val watchosSimulatorArm64Main by getting { | ||
this.dependsOn(watchosMain) | ||
} | ||
val watchosSimulatorArm64Test by getting { | ||
this.dependsOn(watchosTest) | ||
} | ||
val macosArm64Main by getting { | ||
this.dependsOn(macosX64Main) | ||
} | ||
val macosArm64Test by getting { | ||
this.dependsOn(macosX64Test) | ||
} | ||
} | ||
} | ||
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() | ||
} | ||
} | ||
} | ||
|
||
// 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest package="io.iohk.prism.walletcore" /> |
6 changes: 6 additions & 0 deletions
6
wallet-core-sdk/src/androidMain/kotlin/io/iohk/atala/prism/walletcore/Platform.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.walletcore | ||
|
||
internal actual object Platform { | ||
actual val OS: String | ||
get() = "Android ${android.os.Build.VERSION.SDK_INT}" | ||
} |
5 changes: 5 additions & 0 deletions
5
wallet-core-sdk/src/commonMain/kotlin/io.iohk.atala.prism.walletcore/Platform.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,5 @@ | ||
package io.iohk.atala.prism.walletcore | ||
|
||
internal expect object Platform { | ||
val OS: String | ||
} |
8 changes: 8 additions & 0 deletions
8
wallet-core-sdk/src/iosArm64Main/kotlin/io/iohk/atala/prism/walletcore/Platform.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.walletcore | ||
|
||
import platform.UIKit.UIDevice | ||
|
||
internal actual object Platform { | ||
actual val OS: String | ||
get() = "${UIDevice.currentDevice.systemName()}-${UIDevice.currentDevice.systemVersion}" | ||
} |
8 changes: 8 additions & 0 deletions
8
wallet-core-sdk/src/iosX64Main/kotlin/io/iohk/atala/prism/walletcore/Platform.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.walletcore | ||
|
||
import platform.UIKit.UIDevice | ||
|
||
internal actual object Platform { | ||
actual val OS: String | ||
get() = "${UIDevice.currentDevice.systemName()}-${UIDevice.currentDevice.systemVersion}" | ||
} |
11 changes: 11 additions & 0 deletions
11
wallet-core-sdk/src/jsMain/kotlin/io/iohk/atala/prism/walletcore/Platform.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,11 @@ | ||
package io.iohk.atala.prism.walletcore | ||
|
||
internal actual object Platform { | ||
private val isNodeJs by lazy { js("(typeof process === 'object' && typeof require === 'function')").unsafeCast<Boolean>() } | ||
actual val OS: String | ||
get() = if (isNodeJs) { | ||
"NodeJS" | ||
} else { | ||
"JS" | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
wallet-core-sdk/src/jvmMain/kotlin/io/iohk/atala/prism/walletcore/Platform.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.walletcore | ||
|
||
internal actual object Platform { | ||
actual val OS: String | ||
get() = "JVM - ${System.getProperty("java.version")}" | ||
} |
11 changes: 11 additions & 0 deletions
11
wallet-core-sdk/src/macosX64Main/kotlin/io/iohk/atala/prism/walletcore/Platform.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,11 @@ | ||
package io.iohk.atala.prism.walletcore | ||
|
||
import platform.Foundation.NSProcessInfo | ||
|
||
internal actual object Platform { | ||
actual val OS: String | ||
get() { | ||
val processInfo = NSProcessInfo.processInfo() | ||
return "${processInfo.operatingSystemName()}-${processInfo.operatingSystemVersionString()}" | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
wallet-core-sdk/src/tvosArm64Main/kotlin/io/iohk/atala/prism/walletcore/Platform.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.walletcore | ||
|
||
import platform.UIKit.UIDevice | ||
|
||
internal actual object Platform { | ||
actual val OS: String | ||
get() = "${UIDevice.currentDevice.systemName()}-${UIDevice.currentDevice.systemVersion}" | ||
} |
8 changes: 8 additions & 0 deletions
8
wallet-core-sdk/src/tvosX64Main/kotlin/io/iohk/atala/prism/walletcore/Platform.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.walletcore | ||
|
||
import platform.UIKit.UIDevice | ||
|
||
internal actual object Platform { | ||
actual val OS: String | ||
get() = "${UIDevice.currentDevice.systemName()}-${UIDevice.currentDevice.systemVersion}" | ||
} |
11 changes: 11 additions & 0 deletions
11
wallet-core-sdk/src/watchosArm32Main/kotlin/io/iohk/atala/prism/walletcore/Platform.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,11 @@ | ||
package io.iohk.atala.prism.walletcore | ||
|
||
import platform.WatchKit.WKInterfaceDevice | ||
|
||
internal actual object Platform { | ||
actual val OS: String | ||
get() { | ||
val wkInterfaceDevice = WKInterfaceDevice.currentDevice() | ||
return "${wkInterfaceDevice.systemName}-${wkInterfaceDevice.systemVersion}" | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
wallet-core-sdk/src/watchosArm64Main/kotlin/io/iohk/atala/prism/walletcore/Platform.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,11 @@ | ||
package io.iohk.atala.prism.walletcore | ||
|
||
import platform.WatchKit.WKInterfaceDevice | ||
|
||
internal actual object Platform { | ||
actual val OS: String | ||
get() { | ||
val wkInterfaceDevice = WKInterfaceDevice.currentDevice() | ||
return "${wkInterfaceDevice.systemName}-${wkInterfaceDevice.systemVersion}" | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
wallet-core-sdk/src/watchosX64Main/kotlin/io/iohk/atala/prism/walletcore/Platform.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,11 @@ | ||
package io.iohk.atala.prism.walletcore | ||
|
||
import platform.WatchKit.WKInterfaceDevice | ||
|
||
internal actual object Platform { | ||
actual val OS: String | ||
get() { | ||
val wkInterfaceDevice = WKInterfaceDevice.currentDevice() | ||
return "${wkInterfaceDevice.systemName}-${wkInterfaceDevice.systemVersion}" | ||
} | ||
} |
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,42 @@ | ||
Pod::Spec.new do |spec| | ||
spec.name = 'wallet_core_sdk' | ||
spec.version = '1.0.0-alpha' | ||
spec.homepage = '' | ||
spec.source = { :http=> ''} | ||
spec.authors = 'IOG' | ||
spec.license = '' | ||
spec.summary = 'Wallet-Core-SDK' | ||
spec.vendored_frameworks = 'build/cocoapods/framework/wallet-core-sdk.framework' | ||
spec.libraries = 'c++' | ||
spec.ios.deployment_target = '13.0' | ||
spec.osx.deployment_target = '12.0' | ||
spec.tvos.deployment_target = '13.0' | ||
spec.watchos.deployment_target = '8.0' | ||
|
||
|
||
spec.pod_target_xcconfig = { | ||
'KOTLIN_PROJECT_PATH' => ':wallet-core-sdk', | ||
'PRODUCT_MODULE_NAME' => 'wallet-core-sdk', | ||
} | ||
|
||
spec.script_phases = [ | ||
{ | ||
:name => 'Build wallet_core_sdk', | ||
:execution_position => :before_compile, | ||
:shell_path => '/bin/sh', | ||
:script => <<-SCRIPT | ||
if [ "YES" = "$OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED" ]; then | ||
echo "Skipping Gradle build task invocation due to OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED environment variable set to \"YES\"" | ||
exit 0 | ||
fi | ||
set -ev | ||
REPO_ROOT="$PODS_TARGET_SRCROOT" | ||
"$REPO_ROOT/../gradlew" -p "$REPO_ROOT" $KOTLIN_PROJECT_PATH:syncFramework \ | ||
-Pkotlin.native.cocoapods.platform=$PLATFORM_NAME \ | ||
-Pkotlin.native.cocoapods.archs="$ARCHS" \ | ||
-Pkotlin.native.cocoapods.configuration="$CONFIGURATION" | ||
SCRIPT | ||
} | ||
] | ||
|
||
end |
Oops, something went wrong.