[Gradle] Apply Language Settings in the correct Lifecycle Stages
After introduction of KGP Lifecycle stages the application of Language Settings to Targets and Compilation (from source set level) wasn't synchronized. Which led to data flow race. Delaying this application to correct stages solves the data flow race. ^KT-59063
This commit is contained in:
committed by
Space Team
parent
b097292ddf
commit
67d933185a
+1
-1
@@ -241,7 +241,7 @@ open class KotlinNativeTargetConfigurator<T : KotlinNativeTarget> : AbstractKotl
|
||||
project.syncLanguageSettingsToLinkTask(binary)
|
||||
}
|
||||
}
|
||||
project.runOnceAfterEvaluated("Sync native compilation language settings to compiler options") {
|
||||
project.launchInStage(KotlinPluginLifecycle.Stage.FinaliseCompilations) {
|
||||
target.compilations.all { compilation ->
|
||||
compilation.compilerOptions.syncLanguageSettings(compilation.defaultSourceSet.languageSettings)
|
||||
}
|
||||
|
||||
+1
-1
@@ -48,7 +48,7 @@ internal abstract class AbstractKotlinCompileConfig<TASK : AbstractKotlinCompile
|
||||
|
||||
init {
|
||||
configureTaskProvider { taskProvider ->
|
||||
project.runOnceAfterEvaluated("apply properties and language settings to ${taskProvider.name}") {
|
||||
project.launchInStage(KotlinPluginLifecycle.Stage.AfterFinaliseCompilations) {
|
||||
taskProvider.configure {
|
||||
// KaptGenerateStubs will receive value from linked KotlinCompile task
|
||||
if (it is KaptGenerateStubsTask) return@configure
|
||||
|
||||
Reference in New Issue
Block a user