Add @Input to compiler args and compiler JAR. Add up-to-date-ness tests.
Issue #KT-20036 Fixed Issue #KT-3463 Fixed Issue #KT-16299 Fixed Issue #KT-16915 Fixed (cherry picked from commit e6d867f)
This commit is contained in:
committed by
Sergey Igushkin
parent
ba649d0869
commit
5f593ac3f8
+4
@@ -22,6 +22,7 @@ import org.gradle.api.file.SourceDirectorySet
|
||||
import org.gradle.api.logging.Logger
|
||||
import org.gradle.api.plugins.BasePluginConvention
|
||||
import org.gradle.api.tasks.Input
|
||||
import org.gradle.api.tasks.InputFiles
|
||||
import org.gradle.api.tasks.SourceTask
|
||||
import org.gradle.api.tasks.TaskAction
|
||||
import org.gradle.api.tasks.compile.AbstractCompile
|
||||
@@ -59,6 +60,7 @@ abstract class AbstractKotlinCompileTool<T : CommonToolArguments>() : AbstractCo
|
||||
var compilerJarFile: File? = null
|
||||
var compilerClasspath: List<File>? = null
|
||||
|
||||
@get:InputFiles
|
||||
internal val computedCompilerClasspath: List<File>
|
||||
get() = compilerClasspath?.takeIf { it.isNotEmpty() }
|
||||
?: compilerJarFile?.let {
|
||||
@@ -67,6 +69,7 @@ abstract class AbstractKotlinCompileTool<T : CommonToolArguments>() : AbstractCo
|
||||
}
|
||||
?: findKotlinCompilerClasspath(project).takeIf { it.isNotEmpty() }
|
||||
?: throw IllegalStateException("Could not find Kotlin Compiler classpath. Please specify $name.compilerClasspath")
|
||||
|
||||
protected abstract fun findKotlinCompilerClasspath(project: Project): List<File>
|
||||
}
|
||||
|
||||
@@ -105,6 +108,7 @@ abstract class AbstractKotlinCompile<T : CommonCompilerArguments>() : AbstractKo
|
||||
get() = (classpath + additionalClasspath)
|
||||
.filterTo(LinkedHashSet(), File::exists)
|
||||
|
||||
@get:Input
|
||||
override val serializedCompilerArguments: List<String>
|
||||
get() {
|
||||
val arguments = createCompilerArgs()
|
||||
|
||||
Reference in New Issue
Block a user