Fix resourcesDir that cannot be imported due to not being a File
This commit is contained in:
+3
-1
@@ -9,9 +9,11 @@ import org.gradle.api.Named
|
||||
import org.gradle.api.attributes.HasAttributes
|
||||
import org.gradle.api.file.ConfigurableFileCollection
|
||||
import org.gradle.api.file.FileCollection
|
||||
import java.io.File
|
||||
|
||||
interface KotlinCompilationOutput {
|
||||
var resourcesDir: Any
|
||||
var resourcesDirProvider: Any
|
||||
val resourcesDir: File
|
||||
val classesDirs: ConfigurableFileCollection
|
||||
|
||||
val allOutputs: FileCollection
|
||||
|
||||
+10
-3
@@ -10,11 +10,12 @@ import org.gradle.api.file.ConfigurableFileCollection
|
||||
import org.gradle.api.file.FileCollection
|
||||
import org.jetbrains.kotlin.gradle.plugin.KotlinCompilationOutput
|
||||
import org.jetbrains.kotlin.gradle.utils.isGradleVersionAtLeast
|
||||
import java.io.File
|
||||
import java.util.concurrent.Callable
|
||||
|
||||
class DefaultKotlinCompilationOutput(
|
||||
project: Project,
|
||||
override var resourcesDir: Any
|
||||
private val project: Project,
|
||||
override var resourcesDirProvider: Any
|
||||
) : KotlinCompilationOutput, Callable<FileCollection> {
|
||||
|
||||
override val classesDirs: ConfigurableFileCollection = project.files()
|
||||
@@ -24,6 +25,9 @@ class DefaultKotlinCompilationOutput(
|
||||
from(Callable { resourcesDir })
|
||||
}
|
||||
|
||||
override val resourcesDir: File
|
||||
get() = project.file(resourcesDirProvider)
|
||||
|
||||
override fun call(): FileCollection = allOutputs
|
||||
}
|
||||
|
||||
@@ -34,7 +38,10 @@ class KotlinWithJavaCompilationOutput(
|
||||
private val javaSourceSetOutput
|
||||
get() = compilation.javaSourceSet.output
|
||||
|
||||
override var resourcesDir: Any
|
||||
override val resourcesDir: File
|
||||
get() = javaSourceSetOutput.resourcesDir
|
||||
|
||||
override var resourcesDirProvider: Any
|
||||
get() = javaSourceSetOutput.resourcesDir
|
||||
set(value) { javaSourceSetOutput.setResourcesDir(value) }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user