@@ -7,7 +7,6 @@ import aws.sdk.kotlin.gradle.crt.cmakeInstallDir
77import  aws.sdk.kotlin.gradle.crt.configureCrtCMakeBuild 
88import  aws.sdk.kotlin.gradle.crt.disableCrossCompileTargets 
99import  aws.sdk.kotlin.gradle.dsl.configurePublishing 
10- import  aws.sdk.kotlin.gradle.kmp.IDEA_ACTIVE 
1110import  aws.sdk.kotlin.gradle.kmp.configureKmpTargets 
1211import  aws.sdk.kotlin.gradle.util.typedProp 
1312import  org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget 
@@ -23,7 +22,7 @@ plugins {
2322val  sdkVersion:  String  by project
2423group =  properties[" publishGroupName" ? :  error(" missing publishGroupName" 
2524version =  sdkVersion
26- description =  " Kotlin Multiplatform bindings for AWS SDK  Common Runtime" 
25+ description =  " Kotlin Multiplatform bindings for AWS Common Runtime" 
2726
2827//  See: https://kotlinlang.org/docs/reference/opt-in-requirements.html#opting-in-to-using-api
2928val  optinAnnotations =  listOf (" kotlin.RequiresOptIn" " kotlinx.cinterop.ExperimentalForeignApi" 
@@ -45,42 +44,6 @@ kotlin {
4544    //  FIXME - setup docker files and cmake tasks appropriately
4645    //  mingwX64()
4746
48-     jvm {
49-         attributes {
50-             attribute< org.gradle.api.attributes.java.TargetJvmEnvironment > (
51-                 TargetJvmEnvironment .TARGET_JVM_ENVIRONMENT_ATTRIBUTE ,
52-                 objects.named(TargetJvmEnvironment .STANDARD_JVM ),
53-             )
54-         }
55-     }
56- 
57-     //  KMP doesn't support sharing source sets for multiple JVM targets OR JVM + Android targets.
58-     //  We can manually declare a `jvmCommon` target and wire it up. It will compile fine but Intellij does
59-     //  not support this and the developer experience is abysmal. Kotlin/Native suffers a similar problem and
60-     //  we can use the same solution. Simply, if Intellij is running (i.e. the one invoking this script) then
61-     //  assume we are only building for JVM. Otherwise declare the additional JVM target for Android and
62-     //  set the sourceSet the same for both but with different runtime dependencies.
63-     //  See:
64-     //      * https://kotlinlang.org/docs/mpp-share-on-platforms.html#share-code-in-libraries
65-     //      * https://kotlinlang.org/docs/mpp-set-up-targets.html#distinguish-several-targets-for-one-platform
66-     if  (! IDEA_ACTIVE ) {
67- 
68-         //  NOTE: We don't actually need the Android plugin. All of the Android specifics are handled in aws-crt-java,
69-         //  we just need a variant with a different dependency set + some distinguishing attributes.
70-         jvm(" android" 
71-             attributes {
72-                 attribute(
73-                     org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType .Companion .attribute,
74-                     org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType .androidJvm,
75-                 )
76-                 attribute(
77-                     TargetJvmEnvironment .TARGET_JVM_ENVIRONMENT_ATTRIBUTE ,
78-                     objects.named(TargetJvmEnvironment .ANDROID ),
79-                 )
80-             }
81-         }
82-     }
83- 
8447    sourceSets {
8548        val  commonMain by getting {
8649            dependencies {
@@ -110,30 +73,6 @@ kotlin {
11073                implementation(libs.mockserver.netty)
11174            }
11275        }
113- 
114-         if  (! IDEA_ACTIVE ) {
115-             val  androidMain by getting {
116-                 //  re-use the jvm (desktop) sourceSet. We only really care about declaring a variant with a different set
117-                 //  of runtime dependencies
118-                 kotlin.srcDir(" jvm/src" 
119-                 dependsOn(commonMain)
120-                 dependencies {
121-                     //  we need symbols we can resolve during compilation but at runtime (i.e. on device) we depend on the Android dependency
122-                     compileOnly(libs.crt.java)
123-                     val  crtJavaVersion =  libs.versions.crt.java.version.get()
124-                     implementation(" software.amazon.awssdk.crt:aws-crt-android:$crtJavaVersion @aar" 
125- 
126-                     //  FIXME - temporary integration with CompletableFuture while we work out a POC on the jvm target
127-                     implementation(libs.kotlinx.coroutines.jdk8)
128-                 }
129-             }
130- 
131-             //  disable compilation of android test source set. It is the same as the jvmTest sourceSet/tests. This
132-             //  sourceSet only exists to create a new variant that is the same in every way except the runtime
133-             //  dependency on aws-crt-android. To test this we would need to run it on device/emulator.
134-             tasks.getByName(" androidTest" =  false 
135-             tasks.getByName(" compileTestKotlinAndroid" =  false 
136-         }
13776    }
13877
13978    sourceSets.all {
0 commit comments