-
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
23 changed files
with
271 additions
and
17 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file added
BIN
+185 KB
...sformedMetadataLibraries/org.jetbrains.kotlin-kotlin-stdlib-2.1.10-commonMain-ITmP6A.klib
Binary file not shown.
Binary file added
BIN
+1.51 KB
...tadataLibraries/org.jetbrains.kotlin-kotlin-test-2.1.10-annotationsCommonMain-D3q3YQ.klib
Binary file not shown.
Binary file added
BIN
+5.89 KB
...etadataLibraries/org.jetbrains.kotlin-kotlin-test-2.1.10-assertionsCommonMain-D3q3YQ.klib
Binary file not shown.
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
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#Mon Nov 07 16:21:11 YEKT 2022 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip | ||
distributionPath=wrapper/dists | ||
zipStorePath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStoreBase=GRADLE_USER_HOME |
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 @@ | ||
/build |
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,99 @@ | ||
plugins { | ||
alias(libs.plugins.kotlin.multiplatform) | ||
alias(libs.plugins.android.kotlin.multiplatform.library) | ||
} | ||
|
||
kotlin { | ||
|
||
// Target declarations - add or remove as needed below. These define | ||
// which platforms this KMP module supports. | ||
// See: https://kotlinlang.org/docs/multiplatform-discover-project.html#targets | ||
androidLibrary { | ||
namespace = "cloud.mindbox.mindbox_common" | ||
compileSdk = 35 | ||
minSdk = 21 | ||
|
||
withHostTestBuilder { | ||
} | ||
|
||
withDeviceTestBuilder { | ||
sourceSetTreeName = "test" | ||
}.configure { | ||
instrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" | ||
} | ||
} | ||
|
||
// For iOS targets, this is also where you should | ||
// configure native binary output. For more information, see: | ||
// https://kotlinlang.org/docs/multiplatform-build-native-binaries.html#build-xcframeworks | ||
|
||
// A step-by-step guide on how to include this library in an XCode | ||
// project can be found here: | ||
// https://developer.android.com/kotlin/multiplatform/migrate | ||
val xcfName = "mindbox-commonKit" | ||
|
||
iosX64 { | ||
binaries.framework { | ||
baseName = xcfName | ||
} | ||
} | ||
|
||
iosArm64 { | ||
binaries.framework { | ||
baseName = xcfName | ||
} | ||
} | ||
|
||
iosSimulatorArm64 { | ||
binaries.framework { | ||
baseName = xcfName | ||
} | ||
} | ||
|
||
// Source set declarations. | ||
// Declaring a target automatically creates a source set with the same name. By default, the | ||
// Kotlin Gradle Plugin creates additional source sets that depend on each other, since it is | ||
// common to share sources between related targets. | ||
// See: https://kotlinlang.org/docs/multiplatform-hierarchy.html | ||
sourceSets { | ||
commonMain { | ||
dependencies { | ||
implementation(libs.kotlin.stdlib) | ||
implementation(libs.ktor.client.core) | ||
} | ||
} | ||
|
||
commonTest { | ||
dependencies { | ||
implementation(libs.kotlin.test) | ||
} | ||
} | ||
|
||
androidMain { | ||
dependencies { | ||
// Add Android-specific dependencies here. Note that this source set depends on | ||
// commonMain by default and will correctly pull the Android artifacts of any KMP | ||
// dependencies declared in commonMain. | ||
} | ||
} | ||
|
||
getByName("androidDeviceTest") { | ||
dependencies { | ||
implementation(libs.runner) | ||
implementation(libs.test.core) | ||
implementation(libs.androidx.junit) | ||
} | ||
} | ||
|
||
iosMain { | ||
dependencies { | ||
// Add iOS-specific dependencies here. This a source set created by Kotlin Gradle | ||
// Plugin (KGP) that each specific iOS target (e.g., iosX64) depends on as | ||
// part of KMP’s default source set hierarchy. Note that this source set depends | ||
// on common by default and will correctly pull the iOS artifacts of any | ||
// KMP dependencies declared in commonMain. | ||
} | ||
} | ||
} | ||
|
||
} |
24 changes: 24 additions & 0 deletions
24
...mmon/src/androidDeviceTest/kotlin/cloud/mindbox/mindbox_common/ExampleInstrumentedTest.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,24 @@ | ||
package cloud.mindbox.mindbox_common | ||
|
||
import androidx.test.platform.app.InstrumentationRegistry | ||
import androidx.test.ext.junit.runners.AndroidJUnit4 | ||
|
||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
|
||
import org.junit.Assert.* | ||
|
||
/** | ||
* Instrumented test, which will execute on an Android device. | ||
* | ||
* See [testing documentation](http://d.android.com/tools/testing). | ||
*/ | ||
@RunWith(AndroidJUnit4::class) | ||
class ExampleInstrumentedTest { | ||
@Test | ||
fun useAppContext() { | ||
// Context of the app under test. | ||
val appContext = InstrumentationRegistry.getInstrumentation().targetContext | ||
assertEquals("cloud.mindbox.mindbox_common.test", appContext.packageName) | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
mindbox-common/src/androidHostTest/kotlin/cloud/mindbox/mindbox_common/ExampleUnitTest.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,16 @@ | ||
package cloud.mindbox.mindbox_common | ||
|
||
import kotlin.test.Test | ||
import kotlin.test.assertEquals | ||
|
||
/** | ||
* Example local unit test, which will execute on the development machine (host). | ||
* | ||
* See [testing documentation](http://d.android.com/tools/testing). | ||
*/ | ||
class ExampleUnitTest { | ||
@Test | ||
fun addition_isCorrect() { | ||
assertEquals(4, 2 + 2) | ||
} | ||
} |
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,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> | ||
|
||
</manifest> |
5 changes: 5 additions & 0 deletions
5
mindbox-common/src/androidMain/kotlin/cloud/mindbox/mindbox_common/Platform.android.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 cloud.mindbox.mindbox_common | ||
|
||
actual fun platform() = "Android" | ||
|
||
actual fun commonVersion() = "1.0.0-" + platform() |
22 changes: 22 additions & 0 deletions
22
mindbox-common/src/commonMain/kotlin/cloud/mindbox/mindbox_common/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,22 @@ | ||
package cloud.mindbox.mindbox_common | ||
|
||
import io.ktor.client.HttpClient | ||
import io.ktor.client.request.get | ||
import io.ktor.client.statement.bodyAsText | ||
|
||
expect fun platform(): String | ||
|
||
expect fun commonVersion(): String | ||
|
||
object MindboxCommon { | ||
private val client = HttpClient() | ||
|
||
fun commonFunction(): String { | ||
return commonVersion() | ||
} | ||
|
||
suspend fun getConfig(): String { | ||
val response = client.get("https://ktor.io/docs/") | ||
return response.bodyAsText() | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
mindbox-common/src/iosMain/kotlin/cloud/mindbox/mindbox_common/Platform.ios.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 cloud.mindbox.mindbox_common | ||
|
||
actual fun platform() = "iOS" | ||
|
||
actual fun commonVersion() = "1.0.0-" + platform() |
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
Oops, something went wrong.