Implement language settings API for Kotlin source sets

This commit is contained in:
Sergey Igushkin
2018-08-09 12:53:39 +03:00
parent 2c04e2b95c
commit 5815d6a70c
9 changed files with 298 additions and 22 deletions
@@ -0,0 +1,18 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.gradle.plugin
interface LanguageSettingsBuilder {
var languageVersion: String?
var apiVersion: String?
var progressiveMode: Boolean
fun enableLanguageFeature(name: String)
val enabledLanguageFeatures: Set<String>
}
@@ -9,19 +9,22 @@ import groovy.lang.Closure
import org.gradle.api.Named
import org.gradle.api.file.SourceDirectorySet
import org.jetbrains.kotlin.gradle.plugin.HasKotlinDependencies
import org.jetbrains.kotlin.gradle.plugin.LanguageSettingsBuilder
interface KotlinSourceSet : Named, HasKotlinDependencies {
val kotlin: SourceDirectorySet
fun kotlin(configureClosure: Closure<Any?>): SourceDirectorySet
val resources: SourceDirectorySet
fun kotlin(configureClosure: Closure<Any?>): SourceDirectorySet
val languageSettings: LanguageSettingsBuilder
fun languageSettings(configureClosure: Closure<Any?>): LanguageSettingsBuilder
fun dependsOn(other: KotlinSourceSet)
val dependsOn: Set<KotlinSourceSet>
companion object {
const val COMMON_MAIN_SOURCE_SET_NAME = "commonMain"
const val COMMON_TEST_SOURCE_SET_NAME = "commonTest"
}
fun dependsOn(other: KotlinSourceSet)
val dependsOn: Set<KotlinSourceSet>
}