Move conditional task caching setup into the task constructors;
Add 'kotlin.caching.enabled' flag to switch the caching for all tasks;
Rename and change semantics of cache support checks: make two instead
of one, `isBuildCacheSupported` and `isBuildCacheEnabledForKotlin`;
Remove FileOptionKind entries that are redundant at the moment;
Improvements in BuildCacheIT.kt and other refactoring suggestions from
the review
https://upsource.jetbrains.com/kotlin/review/KOTLIN-CR-1647
This commit is contained in:
+11
-4
@@ -21,22 +21,29 @@ import org.gradle.api.tasks.SourceSet
|
||||
import org.gradle.api.tasks.compile.AbstractCompile
|
||||
import java.io.File
|
||||
|
||||
open class SubpluginOption(val key: String, open val value: String)
|
||||
open class SubpluginOption(val key: String, val value: String)
|
||||
|
||||
class FilesSubpluginOption(
|
||||
key: String,
|
||||
val kind: FileOptionKind,
|
||||
val files: List<File>,
|
||||
val kind: FilesOptionKind = FilesOptionKind.INTERNAL,
|
||||
value: String = files.joinToString(File.pathSeparator) { it.canonicalPath })
|
||||
: SubpluginOption(key, value)
|
||||
|
||||
class WrapperSubpluginOption(
|
||||
class CompositeSubpluginOption(
|
||||
key: String,
|
||||
value: String,
|
||||
val originalOptions: List<SubpluginOption>)
|
||||
: SubpluginOption(key, value)
|
||||
|
||||
enum class FileOptionKind { INPUT_FILES, CLASSPATH_INPUT, OUTPUT_FILES, OUTPUT_DIRS, INTERNAL }
|
||||
/** Defines how the files option should be handled with regard to Gradle model */
|
||||
enum class FilesOptionKind {
|
||||
/** The files option is an implementation detail and should not be treated as an input or an output. */
|
||||
INTERNAL
|
||||
|
||||
// More options might be added when use cases appear for them,
|
||||
// such as output directories, inputs or classpath options.
|
||||
}
|
||||
|
||||
interface KotlinGradleSubplugin<in KotlinCompile : AbstractCompile> {
|
||||
fun isApplicable(project: Project, task: AbstractCompile): Boolean
|
||||
|
||||
Reference in New Issue
Block a user