Gradle, native: Pass --progressive to both compile and link tasks
This commit is contained in:
+9
-8
@@ -124,12 +124,19 @@ abstract class AbstractKotlinNativeCompile<T : KotlinCommonToolOptions> : Abstra
|
|||||||
val additionalCompilerOptions: Collection<String>
|
val additionalCompilerOptions: Collection<String>
|
||||||
@Input get() = kotlinOptions.freeCompilerArgs
|
@Input get() = kotlinOptions.freeCompilerArgs
|
||||||
|
|
||||||
// region DSL for compiler options
|
// region Compiler options.
|
||||||
@get:Internal
|
@get:Internal
|
||||||
abstract val kotlinOptions: T
|
abstract val kotlinOptions: T
|
||||||
abstract fun kotlinOptions(fn: T.() -> Unit)
|
abstract fun kotlinOptions(fn: T.() -> Unit)
|
||||||
abstract fun kotlinOptions(fn: Closure<*>)
|
abstract fun kotlinOptions(fn: Closure<*>)
|
||||||
|
|
||||||
|
@get:Internal
|
||||||
|
val languageSettings: LanguageSettingsBuilder?
|
||||||
|
get() = project.kotlinExtension.sourceSets.findByName(compilation.defaultSourceSetName)?.languageSettings
|
||||||
|
|
||||||
|
@get:Input
|
||||||
|
val progressiveMode: Boolean
|
||||||
|
get() = languageSettings?.progressiveMode ?: false
|
||||||
// endregion.
|
// endregion.
|
||||||
|
|
||||||
val kotlinNativeVersion: String
|
val kotlinNativeVersion: String
|
||||||
@@ -193,6 +200,7 @@ abstract class AbstractKotlinNativeCompile<T : KotlinCommonToolOptions> : Abstra
|
|||||||
addKey("-Werror", kotlinOptions.allWarningsAsErrors)
|
addKey("-Werror", kotlinOptions.allWarningsAsErrors)
|
||||||
addKey("-nowarn", kotlinOptions.suppressWarnings)
|
addKey("-nowarn", kotlinOptions.suppressWarnings)
|
||||||
addKey("-verbose", kotlinOptions.verbose)
|
addKey("-verbose", kotlinOptions.verbose)
|
||||||
|
addKey("-progressive", progressiveMode)
|
||||||
|
|
||||||
if (!defaultsOnly) {
|
if (!defaultsOnly) {
|
||||||
addAll(additionalCompilerOptions)
|
addAll(additionalCompilerOptions)
|
||||||
@@ -266,18 +274,12 @@ open class KotlinNativeCompile : AbstractKotlinNativeCompile<KotlinCommonOptions
|
|||||||
// endregion.
|
// endregion.
|
||||||
|
|
||||||
// region Language settings imported from a SourceSet.
|
// region Language settings imported from a SourceSet.
|
||||||
val languageSettings: LanguageSettingsBuilder?
|
|
||||||
@Internal get() = project.kotlinExtension.sourceSets.findByName(compilation.defaultSourceSetName)?.languageSettings
|
|
||||||
|
|
||||||
val languageVersion: String?
|
val languageVersion: String?
|
||||||
@Optional @Input get() = languageSettings?.languageVersion
|
@Optional @Input get() = languageSettings?.languageVersion
|
||||||
|
|
||||||
val apiVersion: String?
|
val apiVersion: String?
|
||||||
@Optional @Input get() = languageSettings?.apiVersion
|
@Optional @Input get() = languageSettings?.apiVersion
|
||||||
|
|
||||||
val progressiveMode: Boolean
|
|
||||||
@Input get() = languageSettings?.progressiveMode ?: false
|
|
||||||
|
|
||||||
val enabledLanguageFeatures: Set<String>
|
val enabledLanguageFeatures: Set<String>
|
||||||
@Input get() = languageSettings?.enabledLanguageFeatures ?: emptySet()
|
@Input get() = languageSettings?.enabledLanguageFeatures ?: emptySet()
|
||||||
|
|
||||||
@@ -327,7 +329,6 @@ open class KotlinNativeCompile : AbstractKotlinNativeCompile<KotlinCommonOptions
|
|||||||
// Language features.
|
// Language features.
|
||||||
addArgIfNotNull("-language-version", languageVersion)
|
addArgIfNotNull("-language-version", languageVersion)
|
||||||
addArgIfNotNull("-api-version", apiVersion)
|
addArgIfNotNull("-api-version", apiVersion)
|
||||||
addKey("-progressive", progressiveMode)
|
|
||||||
enabledLanguageFeatures.forEach { featureName ->
|
enabledLanguageFeatures.forEach { featureName ->
|
||||||
add("-XXLanguage:+$featureName")
|
add("-XXLanguage:+$featureName")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user