Review fixes: prohibit setting classpath, use lazy provider for destination dir
This commit is contained in:
committed by
Ilya Matveev
parent
8dc5af35c5
commit
4368ad2b1c
+1
@@ -34,6 +34,7 @@ import org.gradle.util.GradleVersion
|
|||||||
import org.jetbrains.kotlin.cli.common.arguments.CommonCompilerArguments
|
import org.jetbrains.kotlin.cli.common.arguments.CommonCompilerArguments
|
||||||
import org.jetbrains.kotlin.gradle.plugin.*
|
import org.jetbrains.kotlin.gradle.plugin.*
|
||||||
import org.jetbrains.kotlin.gradle.plugin.experimental.*
|
import org.jetbrains.kotlin.gradle.plugin.experimental.*
|
||||||
|
import org.jetbrains.kotlin.gradle.plugin.experimental.CInteropSettings
|
||||||
import org.jetbrains.kotlin.gradle.plugin.experimental.internal.*
|
import org.jetbrains.kotlin.gradle.plugin.experimental.internal.*
|
||||||
import org.jetbrains.kotlin.gradle.plugin.experimental.tasks.CInteropTask
|
import org.jetbrains.kotlin.gradle.plugin.experimental.tasks.CInteropTask
|
||||||
import org.jetbrains.kotlin.gradle.plugin.experimental.tasks.KotlinNativeCompile
|
import org.jetbrains.kotlin.gradle.plugin.experimental.tasks.KotlinNativeCompile
|
||||||
|
|||||||
+10
-2
@@ -56,6 +56,12 @@ open class KotlinNativeCompile @Inject constructor(internal val binary: Abstract
|
|||||||
val libraries: Configuration
|
val libraries: Configuration
|
||||||
@InputFiles get() = binary.klibraries
|
@InputFiles get() = binary.klibraries
|
||||||
|
|
||||||
|
override fun getClasspath(): FileCollection = libraries
|
||||||
|
|
||||||
|
override fun setClasspath(configuration: FileCollection?) {
|
||||||
|
throw UnsupportedOperationException("Use klibraries to set compile classpath in Kotlin/Native")
|
||||||
|
}
|
||||||
|
|
||||||
val optimized: Boolean @Input get() = binary.optimized
|
val optimized: Boolean @Input get() = binary.optimized
|
||||||
val debuggable: Boolean @Input get() = binary.debuggable
|
val debuggable: Boolean @Input get() = binary.debuggable
|
||||||
|
|
||||||
@@ -114,8 +120,10 @@ open class KotlinNativeCompile @Inject constructor(internal val binary: Abstract
|
|||||||
|
|
||||||
// initializing AbstractCompile properties
|
// initializing AbstractCompile properties
|
||||||
init {
|
init {
|
||||||
classpath = libraries
|
@Suppress("LeakingThis")
|
||||||
destinationDir = if (outputFile.isDirectory) outputFile else outputFile.parentFile
|
setDestinationDir(project.provider {
|
||||||
|
if (outputFile.isDirectory) outputFile else outputFile.parentFile
|
||||||
|
})
|
||||||
sourceCompatibility = "1.6"
|
sourceCompatibility = "1.6"
|
||||||
targetCompatibility = "1.6"
|
targetCompatibility = "1.6"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user