Add immutable LanguageSettings interface and apply it to compilation
LanguageSettingsBuilder extends LanguageSettings
This commit is contained in:
committed by
Sergey Igushkin
parent
54c6ae2cce
commit
de4221afd8
+8
-6
@@ -5,18 +5,20 @@
|
||||
|
||||
package org.jetbrains.kotlin.gradle.plugin
|
||||
|
||||
interface LanguageSettingsBuilder {
|
||||
var languageVersion: String?
|
||||
import org.jetbrains.kotlin.project.model.LanguageSettings
|
||||
|
||||
var apiVersion: String?
|
||||
interface LanguageSettingsBuilder : LanguageSettings {
|
||||
override var languageVersion: String?
|
||||
|
||||
var progressiveMode: Boolean
|
||||
override var apiVersion: String?
|
||||
|
||||
override var progressiveMode: Boolean
|
||||
|
||||
fun enableLanguageFeature(name: String)
|
||||
|
||||
val enabledLanguageFeatures: Set<String>
|
||||
override val enabledLanguageFeatures: Set<String>
|
||||
|
||||
fun useExperimentalAnnotation(name: String)
|
||||
|
||||
val experimentalAnnotationsInUse: Set<String>
|
||||
override val experimentalAnnotationsInUse: Set<String>
|
||||
}
|
||||
+3
-3
@@ -11,7 +11,7 @@ import org.gradle.api.file.SourceDirectorySet
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinCommonOptions
|
||||
import org.jetbrains.kotlin.gradle.plugin.KotlinCompilationOutput
|
||||
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType
|
||||
import org.jetbrains.kotlin.gradle.plugin.LanguageSettingsBuilder
|
||||
import org.jetbrains.kotlin.project.model.LanguageSettings
|
||||
|
||||
interface KotlinCompilationData<T : KotlinCommonOptions> {
|
||||
val project: Project
|
||||
@@ -27,7 +27,7 @@ interface KotlinCompilationData<T : KotlinCommonOptions> {
|
||||
val compileDependencyFiles: FileCollection
|
||||
val output: KotlinCompilationOutput
|
||||
|
||||
val languageSettings: LanguageSettingsBuilder
|
||||
val languageSettings: LanguageSettings
|
||||
val platformType: KotlinPlatformType
|
||||
|
||||
val moduleName: String
|
||||
@@ -61,7 +61,7 @@ interface KotlinVariantCompilationData<T : KotlinCommonOptions> : KotlinCompilat
|
||||
override val compileDependencyFiles: FileCollection
|
||||
get() = owner.compileDependencyFiles
|
||||
|
||||
override val languageSettings: LanguageSettingsBuilder
|
||||
override val languageSettings: LanguageSettings
|
||||
get() = owner.languageSettings
|
||||
|
||||
override val platformType: KotlinPlatformType
|
||||
|
||||
+1
-4
@@ -22,10 +22,7 @@ interface KotlinGradleFragment : KotlinModuleFragment, HasKotlinDependencies, Na
|
||||
|
||||
override fun getName(): String = fragmentName
|
||||
|
||||
// TODO pull up to KotlinModuleFragment
|
||||
// FIXME apply to compilation
|
||||
// FIXME check for consistency
|
||||
val languageSettings: LanguageSettingsBuilder
|
||||
override val languageSettings: LanguageSettingsBuilder
|
||||
|
||||
val project: Project
|
||||
get() = containingModule.project
|
||||
|
||||
Reference in New Issue
Block a user