File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change 55 */
66plugins {
77 kotlin(" jvm" )
8- ` maven`
8+ maven
99 `maven- publish`
1010}
1111
@@ -41,6 +41,18 @@ subprojects {
4141 }
4242 }
4343
44+
45+ // this is the default but it's better to be explicit (e.g. it may change in Kotlin 1.5)
46+ tasks.compileKotlin {
47+ kotlinOptions.jvmTarget = " 1.6"
48+ }
49+ tasks.compileTestKotlin {
50+ kotlinOptions.jvmTarget = " 1.6"
51+ }
52+
53+ // FIXME - we can remove this when we implement generated services as multiplatform.
54+ setOutgoingVariantMetadata()
55+
4456 val sourcesJar by tasks.creating(Jar ::class ) {
4557 group = " publishing"
4658 description = " Assembles Kotlin sources jar"
@@ -63,3 +75,13 @@ subprojects {
6375
6476 apply (from = rootProject.file(" gradle/publish.gradle" ))
6577}
78+
79+
80+ // fixes outgoing variant metadata: https://github.com/awslabs/smithy-kotlin/issues/258
81+ fun Project.setOutgoingVariantMetadata () {
82+ tasks.withType<JavaCompile >() {
83+ val javaVersion = JavaVersion .VERSION_1_8 .toString()
84+ sourceCompatibility = javaVersion
85+ targetCompatibility = javaVersion
86+ }
87+ }
You can’t perform that action at this time.
0 commit comments