Skip to content

Commit 5e102ff

Browse files
committed
Delete Android configuration
1 parent d998e9c commit 5e102ff

File tree

1 file changed

+1
-61
lines changed

1 file changed

+1
-61
lines changed

aws-crt-kotlin/build.gradle.kts

Lines changed: 1 addition & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ plugins {
1313
val sdkVersion: String by project
1414
group = properties["publishGroupName"] ?: error("missing publishGroupName")
1515
version = sdkVersion
16-
description = "Kotlin Multiplatform bindings for AWS SDK Common Runtime"
16+
description = "Kotlin Multiplatform bindings for AWS Common Runtime"
1717

1818
// See: https://kotlinlang.org/docs/reference/opt-in-requirements.html#opting-in-to-using-api
1919
val optinAnnotations = listOf("kotlin.RequiresOptIn")
@@ -24,42 +24,6 @@ configureKmpTargets()
2424
kotlin {
2525
explicitApi()
2626

27-
jvm {
28-
attributes {
29-
attribute<org.gradle.api.attributes.java.TargetJvmEnvironment>(
30-
TargetJvmEnvironment.TARGET_JVM_ENVIRONMENT_ATTRIBUTE,
31-
objects.named(TargetJvmEnvironment.STANDARD_JVM),
32-
)
33-
}
34-
}
35-
36-
// KMP doesn't support sharing source sets for multiple JVM targets OR JVM + Android targets.
37-
// We can manually declare a `jvmCommon` target and wire it up. It will compile fine but Intellij does
38-
// not support this and the developer experience is abysmal. Kotlin/Native suffers a similar problem and
39-
// we can use the same solution. Simply, if Intellij is running (i.e. the one invoking this script) then
40-
// assume we are only building for JVM. Otherwise declare the additional JVM target for Android and
41-
// set the sourceSet the same for both but with different runtime dependencies.
42-
// See:
43-
// * https://kotlinlang.org/docs/mpp-share-on-platforms.html#share-code-in-libraries
44-
// * https://kotlinlang.org/docs/mpp-set-up-targets.html#distinguish-several-targets-for-one-platform
45-
if (!IDEA_ACTIVE) {
46-
47-
// NOTE: We don't actually need the Android plugin. All of the Android specifics are handled in aws-crt-java,
48-
// we just need a variant with a different dependency set + some distinguishing attributes.
49-
jvm("android") {
50-
attributes {
51-
attribute(
52-
org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType.Companion.attribute,
53-
org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType.androidJvm,
54-
)
55-
attribute(
56-
TargetJvmEnvironment.TARGET_JVM_ENVIRONMENT_ATTRIBUTE,
57-
objects.named(TargetJvmEnvironment.ANDROID),
58-
)
59-
}
60-
}
61-
}
62-
6327
sourceSets {
6428
val commonMain by getting {
6529
dependencies {
@@ -83,30 +47,6 @@ kotlin {
8347
implementation(libs.mockserver.netty)
8448
}
8549
}
86-
87-
if (!IDEA_ACTIVE) {
88-
val androidMain by getting {
89-
// re-use the jvm (desktop) sourceSet. We only really care about declaring a variant with a different set
90-
// of runtime dependencies
91-
kotlin.srcDir("jvm/src")
92-
dependsOn(commonMain)
93-
dependencies {
94-
// we need symbols we can resolve during compilation but at runtime (i.e. on device) we depend on the Android dependency
95-
compileOnly(libs.crt.java)
96-
val crtJavaVersion = libs.versions.crt.java.version.get()
97-
implementation("software.amazon.awssdk.crt:aws-crt-android:$crtJavaVersion@aar")
98-
99-
// FIXME - temporary integration with CompletableFuture while we work out a POC on the jvm target
100-
implementation(libs.kotlinx.coroutines.jdk8)
101-
}
102-
}
103-
104-
// disable compilation of android test source set. It is the same as the jvmTest sourceSet/tests. This
105-
// sourceSet only exists to create a new variant that is the same in every way except the runtime
106-
// dependency on aws-crt-android. To test this we would need to run it on device/emulator.
107-
tasks.getByName("androidTest").enabled = false
108-
tasks.getByName("compileTestKotlinAndroid").enabled = false
109-
}
11050
}
11151

11252
sourceSets.all {

0 commit comments

Comments
 (0)