@@ -79,6 +79,23 @@ buildscript {
79
79
80
80
CacheRedirector . configureBuildScript(buildscript, rootProject)
81
81
}
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
+
82
99
// todo:KLUDGE: Hierarchical project structures are not fully supported in IDEA, enable only for a regular built
83
100
if (! Idea . active) {
84
101
ext. set(" kotlin.mpp.enableGranularSourceSetsMetadata" , " true" )
@@ -187,22 +204,6 @@ configure(subprojects.findAll { !sourceless.contains(it.name) && it.name != core
187
204
188
205
apply plugin : " bom-conventions"
189
206
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
-
206
207
if (build_snapshot_train) {
207
208
println " Hacking test tasks, removing stress and flaky tests"
208
209
allprojects {
0 commit comments