Skip to content

Commit 441336c

Browse files
authored
Move Maven publishing to subprojects (#410)
Signed-off-by: Philip K. Warren <[email protected]>
1 parent 38c1c7e commit 441336c

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

build.gradle.kts

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,32 @@ allprojects {
9595
jdkVersion.set(8)
9696
}
9797
}
98+
}
99+
100+
subprojects {
101+
tasks.withType<KotlinJvmCompile> {
102+
compilerOptions {
103+
jvmTarget.set(JvmTarget.JVM_1_8)
104+
languageVersion.set(KotlinVersion.KOTLIN_1_8)
105+
apiVersion.set(KotlinVersion.KOTLIN_1_8)
106+
if (JavaVersion.current().isJava9Compatible && project.name != "android") {
107+
freeCompilerArgs.add("-Xjdk-release=1.8")
108+
}
109+
}
110+
}
111+
tasks.withType<JavaCompile> {
112+
val defaultArgs = listOf("-Xdoclint:none", "-Xlint:none", "-nowarn")
113+
if (JavaVersion.current().isJava9Compatible) {
114+
doFirst {
115+
options.compilerArgs = listOf("--release", "8") + defaultArgs
116+
}
117+
} else {
118+
options.compilerArgs = defaultArgs
119+
}
120+
sourceCompatibility = JavaVersion.VERSION_1_8.toString()
121+
targetCompatibility = JavaVersion.VERSION_1_8.toString()
122+
options.encoding = Charsets.UTF_8.toString()
123+
}
98124
plugins.withId("com.vanniktech.maven.publish.base") {
99125
configure<MavenPublishBaseExtension> {
100126
val isAutoReleased = project.hasProperty("signingInMemoryKey")
@@ -129,29 +155,3 @@ allprojects {
129155
}
130156
}
131157
}
132-
133-
subprojects {
134-
tasks.withType<KotlinJvmCompile> {
135-
compilerOptions {
136-
jvmTarget.set(JvmTarget.JVM_1_8)
137-
languageVersion.set(KotlinVersion.KOTLIN_1_8)
138-
apiVersion.set(KotlinVersion.KOTLIN_1_8)
139-
if (JavaVersion.current().isJava9Compatible && project.name != "android") {
140-
freeCompilerArgs.add("-Xjdk-release=1.8")
141-
}
142-
}
143-
}
144-
tasks.withType<JavaCompile> {
145-
val defaultArgs = listOf("-Xdoclint:none", "-Xlint:none", "-nowarn")
146-
if (JavaVersion.current().isJava9Compatible) {
147-
doFirst {
148-
options.compilerArgs = listOf("--release", "8") + defaultArgs
149-
}
150-
} else {
151-
options.compilerArgs = defaultArgs
152-
}
153-
sourceCompatibility = JavaVersion.VERSION_1_8.toString()
154-
targetCompatibility = JavaVersion.VERSION_1_8.toString()
155-
options.encoding = Charsets.UTF_8.toString()
156-
}
157-
}

0 commit comments

Comments
 (0)