Skip to content

Commit 4a8a692

Browse files
committed
Move subprojects configuration upwards
1 parent 4720575 commit 4a8a692

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

build.gradle

+17-16
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,23 @@ buildscript {
7979

8080
CacheRedirector.configureBuildScript(buildscript, rootProject)
8181
}
82+
83+
// Configure subprojects with Kotlin sources
84+
configure(subprojects.findAll { !sourceless.contains(it.name) }) {
85+
// Use atomicfu plugin, it also adds all the necessary dependencies
86+
apply plugin: 'kotlinx-atomicfu'
87+
88+
// Configure options for all Kotlin compilation tasks
89+
tasks.withType(AbstractKotlinCompile).all {
90+
kotlinOptions.freeCompilerArgs += OptInPreset.optInAnnotations.collect { "-Xopt-in=" + it }
91+
kotlinOptions.freeCompilerArgs += "-progressive"
92+
// Disable KT-36770 for RxJava2 integration
93+
kotlinOptions.freeCompilerArgs += "-XXLanguage:-ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated"
94+
// Remove null assertions to get smaller bytecode on Android
95+
kotlinOptions.freeCompilerArgs += ["-Xno-param-assertions", "-Xno-receiver-assertions", "-Xno-call-assertions"]
96+
}
97+
}
98+
8299
// todo:KLUDGE: Hierarchical project structures are not fully supported in IDEA, enable only for a regular built
83100
if (!Idea.active) {
84101
ext.set("kotlin.mpp.enableGranularSourceSetsMetadata", "true")
@@ -187,22 +204,6 @@ configure(subprojects.findAll { !sourceless.contains(it.name) && it.name != core
187204

188205
apply plugin: "bom-conventions"
189206

190-
// Configure subprojects with Kotlin sources
191-
configure(subprojects.findAll { !sourceless.contains(it.name) }) {
192-
// Use atomicfu plugin, it also adds all the necessary dependencies
193-
apply plugin: 'kotlinx-atomicfu'
194-
195-
// Configure options for all Kotlin compilation tasks
196-
tasks.withType(AbstractKotlinCompile).all {
197-
kotlinOptions.freeCompilerArgs += OptInPreset.optInAnnotations.collect { "-Xopt-in=" + it }
198-
kotlinOptions.freeCompilerArgs += "-progressive"
199-
// Disable KT-36770 for RxJava2 integration
200-
kotlinOptions.freeCompilerArgs += "-XXLanguage:-ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated"
201-
// Remove null assertions to get smaller bytecode on Android
202-
kotlinOptions.freeCompilerArgs += ["-Xno-param-assertions", "-Xno-receiver-assertions", "-Xno-call-assertions"]
203-
}
204-
}
205-
206207
if (build_snapshot_train) {
207208
println "Hacking test tasks, removing stress and flaky tests"
208209
allprojects {

0 commit comments

Comments
 (0)