Add extension operators plus and minus for FileCollection to make them resolve into gradle api, rather than collection api.
This commit is contained in:
+2
-2
@@ -46,7 +46,7 @@ fun Project.initKapt(
|
||||
val stubsDir = File(getBuildDir(), "tmp/kapt/$variantName/classFileStubs")
|
||||
kotlinTask.extensions.extraProperties.set("kaptStubsDir", stubsDir)
|
||||
|
||||
javaTask.classpath = javaTask.classpath + files(stubsDir)
|
||||
javaTask.classpath += files(stubsDir)
|
||||
|
||||
kotlinTask.doFirst {
|
||||
kotlinAfterJavaTask.source(kotlinTask.source)
|
||||
@@ -226,7 +226,7 @@ public class AnnotationProcessingManager(
|
||||
}
|
||||
|
||||
private fun JavaCompile.appendClasspath(file: File) {
|
||||
setClasspath(getClasspath() + project.files(file))
|
||||
classpath += project.files(file)
|
||||
}
|
||||
|
||||
private fun addWrappersToCompilerArgs(javaTask: JavaCompile, wrapperFqNames: String) {
|
||||
|
||||
+4
@@ -25,6 +25,7 @@ import kotlin.properties.Delegates
|
||||
import org.gradle.api.tasks.Delete
|
||||
import groovy.lang.Closure
|
||||
import org.gradle.api.artifacts.Configuration
|
||||
import org.gradle.api.file.FileCollection
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinTasksProvider
|
||||
import java.util.ServiceLoader
|
||||
import org.gradle.api.logging.*
|
||||
@@ -538,6 +539,9 @@ open class GradleUtils(val scriptHandler: ScriptHandler, val project: ProjectInt
|
||||
public fun resolveJsLibrary(): File = resolveDependencies(kotlinJsLibraryCoordinates()).first()
|
||||
}
|
||||
|
||||
internal operator fun FileCollection.plus(other: FileCollection) = this.plus(other)
|
||||
internal operator fun FileCollection.minus(other: FileCollection) = this.minus(other)
|
||||
|
||||
fun AbstractCompile.storeKaptAnnotationsFile(kapt: AnnotationProcessingManager) {
|
||||
extensions.extraProperties.set("kaptAnnotationsFile", kapt.getAnnotationFile())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user