Restore "Drop tasks inheritance from 'AbstractCompile' and 'SourceTask'"
This reverts commit 2c5d817633.
This commit is contained in:
@@ -106,8 +106,6 @@ tasks.compileJava {
|
|||||||
|
|
||||||
tasks.compileKotlin {
|
tasks.compileKotlin {
|
||||||
kotlinOptions.jvmTarget = "1.8"
|
kotlinOptions.jvmTarget = "1.8"
|
||||||
sourceCompatibility = "1.8"
|
|
||||||
targetCompatibility = "1.8"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
projectTest(parallel = true) {
|
projectTest(parallel = true) {
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ val compileTestDevelopmentExecutableKotlinJs = tasks.named<KotlinJsIrLink>("comp
|
|||||||
val populateNodeModules = tasks.register<Copy>("populateNodeModules") {
|
val populateNodeModules = tasks.register<Copy>("populateNodeModules") {
|
||||||
dependsOn("compileTestDevelopmentExecutableKotlinJs")
|
dependsOn("compileTestDevelopmentExecutableKotlinJs")
|
||||||
dependsOn(nodeModules)
|
dependsOn(nodeModules)
|
||||||
from(compileTestDevelopmentExecutableKotlinJs.map { it.destinationDir })
|
from(compileTestDevelopmentExecutableKotlinJs.map { it.destinationDirectory })
|
||||||
|
|
||||||
from {
|
from {
|
||||||
nodeModules.get().map {
|
nodeModules.get().map {
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ buildDir = "$projectDir/build"
|
|||||||
tasks.register("populateNodeModules", Copy) {
|
tasks.register("populateNodeModules", Copy) {
|
||||||
dependsOn(compileKotlin2Js)
|
dependsOn(compileKotlin2Js)
|
||||||
dependsOn(configurations.nodeModules)
|
dependsOn(configurations.nodeModules)
|
||||||
from compileKotlin2Js.destinationDir
|
from compileKotlin2Js.destinationDirectory
|
||||||
|
|
||||||
from {
|
from {
|
||||||
configurations.nodeModules.collect {
|
configurations.nodeModules.collect {
|
||||||
|
|||||||
+1
-1
@@ -84,7 +84,7 @@ class BuildCacheRelocationIT : KGPBaseTest() {
|
|||||||
testProject.subProject("libraryProject").buildGradle.modify {
|
testProject.subProject("libraryProject").buildGradle.modify {
|
||||||
it.replace("/exampleapp.js", "/web/exampleapp.js")
|
it.replace("/exampleapp.js", "/web/exampleapp.js")
|
||||||
// Fix assembling the JAR from the whole buildDir
|
// Fix assembling the JAR from the whole buildDir
|
||||||
it.replace("from buildDir", "from compileKotlin2Js.destinationDir")
|
it.replace("from buildDir", "from compileKotlin2Js.destinationDirectory")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+13
-3
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.gradle
|
package org.jetbrains.kotlin.gradle
|
||||||
|
|
||||||
|
import org.gradle.api.logging.configuration.WarningMode
|
||||||
import org.gradle.util.GradleVersion
|
import org.gradle.util.GradleVersion
|
||||||
import org.jetbrains.kotlin.gradle.testbase.*
|
import org.jetbrains.kotlin.gradle.testbase.*
|
||||||
import org.junit.jupiter.api.DisplayName
|
import org.junit.jupiter.api.DisplayName
|
||||||
@@ -127,14 +128,23 @@ class ConfigurationAvoidanceIT : KGPBaseTest() {
|
|||||||
@DisplayName("JS early configuration resolution")
|
@DisplayName("JS early configuration resolution")
|
||||||
@GradleTest
|
@GradleTest
|
||||||
fun testEarlyConfigurationsResolutionKotlinJs(gradleVersion: GradleVersion) {
|
fun testEarlyConfigurationsResolutionKotlinJs(gradleVersion: GradleVersion) {
|
||||||
testEarlyConfigurationsResolution("kotlin-js-browser-project", gradleVersion, kts = true)
|
testEarlyConfigurationsResolution(
|
||||||
|
"kotlin-js-browser-project",
|
||||||
|
gradleVersion,
|
||||||
|
kts = true,
|
||||||
|
buildOptions = defaultBuildOptions.copy(
|
||||||
|
// bug in Gradle: https://github.com/gradle/gradle/issues/15796
|
||||||
|
warningMode = if (gradleVersion < GradleVersion.version("7.0")) WarningMode.Summary else defaultBuildOptions.warningMode
|
||||||
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun testEarlyConfigurationsResolution(
|
private fun testEarlyConfigurationsResolution(
|
||||||
projectName: String,
|
projectName: String,
|
||||||
gradleVersion: GradleVersion,
|
gradleVersion: GradleVersion,
|
||||||
kts: Boolean
|
kts: Boolean,
|
||||||
) = project(projectName, gradleVersion) {
|
buildOptions: BuildOptions = defaultBuildOptions
|
||||||
|
) = project(projectName, gradleVersion, buildOptions = buildOptions) {
|
||||||
(if (kts) buildGradleKts else buildGradle).appendText(
|
(if (kts) buildGradleKts else buildGradle).appendText(
|
||||||
//language=Gradle
|
//language=Gradle
|
||||||
"""${'\n'}
|
"""${'\n'}
|
||||||
|
|||||||
+2
-7
@@ -9,10 +9,7 @@ import org.gradle.util.GradleVersion
|
|||||||
import org.jetbrains.kotlin.gradle.testbase.*
|
import org.jetbrains.kotlin.gradle.testbase.*
|
||||||
import org.junit.jupiter.api.DisplayName
|
import org.junit.jupiter.api.DisplayName
|
||||||
import java.nio.file.Path
|
import java.nio.file.Path
|
||||||
import kotlin.io.path.createDirectories
|
import kotlin.io.path.*
|
||||||
import kotlin.io.path.deleteExisting
|
|
||||||
import kotlin.io.path.relativeTo
|
|
||||||
import kotlin.io.path.writeText
|
|
||||||
import kotlin.test.assertTrue
|
import kotlin.test.assertTrue
|
||||||
|
|
||||||
@DisplayName("Default incremental compilation with default precise java tracking")
|
@DisplayName("Default incremental compilation with default precise java tracking")
|
||||||
@@ -66,9 +63,7 @@ open class IncrementalJavaChangeDefaultIT : IncrementalCompilationJavaChangesBas
|
|||||||
}
|
}
|
||||||
build("compileKotlin", "--rerun-tasks") {
|
build("compileKotlin", "--rerun-tasks") {
|
||||||
assertTasksExecuted(":compileKotlin")
|
assertTasksExecuted(":compileKotlin")
|
||||||
val compiledKotlinClasses = kotlinClassesDir().allFilesWithExtension("class").toList()
|
assertTrue(kotlinClassesDir().notExists())
|
||||||
|
|
||||||
assertTrue(compiledKotlinClasses.isEmpty())
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-6
@@ -94,8 +94,7 @@ class KlibBasedMppIT : BaseGradleIT() {
|
|||||||
"published-producer-commonMain.klib",
|
"published-producer-commonMain.klib",
|
||||||
"published-dependency-$hostSpecificSourceSet.klib",
|
"published-dependency-$hostSpecificSourceSet.klib",
|
||||||
"published-dependency-commonMain.klib"
|
"published-dependency-commonMain.klib"
|
||||||
),
|
)
|
||||||
isNative = true
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -318,13 +317,12 @@ class KlibBasedMppIT : BaseGradleIT() {
|
|||||||
private fun BaseGradleIT.Project.checkTaskCompileClasspath(
|
private fun BaseGradleIT.Project.checkTaskCompileClasspath(
|
||||||
taskPath: String,
|
taskPath: String,
|
||||||
checkModulesInClasspath: List<String> = emptyList(),
|
checkModulesInClasspath: List<String> = emptyList(),
|
||||||
checkModulesNotInClasspath: List<String> = emptyList(),
|
checkModulesNotInClasspath: List<String> = emptyList()
|
||||||
isNative: Boolean = false
|
|
||||||
) {
|
) {
|
||||||
val subproject = taskPath.substringBeforeLast(":").takeIf { it.isNotEmpty() && it != taskPath }
|
val subproject = taskPath.substringBeforeLast(":").takeIf { it.isNotEmpty() && it != taskPath }
|
||||||
val taskName = taskPath.removePrefix(subproject.orEmpty())
|
val taskName = taskPath.removePrefix(subproject.orEmpty())
|
||||||
val taskClass = if (isNative) "org.jetbrains.kotlin.gradle.tasks.AbstractKotlinNativeCompile<*, *>" else "AbstractCompile"
|
val taskClass = "org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompileTool<*>"
|
||||||
val expression = """(tasks.getByName("$taskName") as $taskClass).${if (isNative) "libraries" else "classpath"}.toList()"""
|
val expression = """(tasks.getByName("$taskName") as $taskClass).libraries.toList()"""
|
||||||
checkPrintedItems(subproject, expression, checkModulesInClasspath, checkModulesNotInClasspath)
|
checkPrintedItems(subproject, expression, checkModulesInClasspath, checkModulesNotInClasspath)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+8
-1
@@ -1176,7 +1176,14 @@ class GeneralKotlin2JsGradlePluginIT : KGPBaseTest() {
|
|||||||
@DisplayName("nodejs up-to-date check works")
|
@DisplayName("nodejs up-to-date check works")
|
||||||
@GradleTest
|
@GradleTest
|
||||||
fun testNodeJsAndYarnDownload(gradleVersion: GradleVersion) {
|
fun testNodeJsAndYarnDownload(gradleVersion: GradleVersion) {
|
||||||
project("cleanTask", gradleVersion) {
|
project(
|
||||||
|
"cleanTask",
|
||||||
|
gradleVersion,
|
||||||
|
buildOptions = defaultBuildOptions.copy(
|
||||||
|
// bug in Gradle: https://github.com/gradle/gradle/issues/15796
|
||||||
|
warningMode = if (gradleVersion < GradleVersion.version("7.0")) WarningMode.None else defaultBuildOptions.warningMode
|
||||||
|
)
|
||||||
|
) {
|
||||||
build("checkDownloadedFolder")
|
build("checkDownloadedFolder")
|
||||||
|
|
||||||
build("checkIfLastModifiedNotNow", "--rerun-tasks")
|
build("checkIfLastModifiedNotNow", "--rerun-tasks")
|
||||||
|
|||||||
+5
-2
@@ -551,12 +551,15 @@ class KotlinSpecificDependenciesIT : KGPBaseTest() {
|
|||||||
taskPath: String,
|
taskPath: String,
|
||||||
checkModulesInClasspath: List<String> = emptyList(),
|
checkModulesInClasspath: List<String> = emptyList(),
|
||||||
checkModulesNotInClasspath: List<String> = emptyList(),
|
checkModulesNotInClasspath: List<String> = emptyList(),
|
||||||
isNative: Boolean = false,
|
|
||||||
isBuildGradleKts: Boolean = false
|
isBuildGradleKts: Boolean = false
|
||||||
) {
|
) {
|
||||||
val subproject = taskPath.substringBeforeLast(":").takeIf { it.isNotEmpty() && it != taskPath }
|
val subproject = taskPath.substringBeforeLast(":").takeIf { it.isNotEmpty() && it != taskPath }
|
||||||
val taskName = taskPath.removePrefix(subproject.orEmpty())
|
val taskName = taskPath.removePrefix(subproject.orEmpty())
|
||||||
val taskClass = if (isNative) "org.jetbrains.kotlin.gradle.tasks.AbstractKotlinNativeCompile<*, *>" else "AbstractCompile"
|
val taskClass = if (isBuildGradleKts) {
|
||||||
|
"org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompileTool<*>"
|
||||||
|
} else {
|
||||||
|
"org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompileTool<?>"
|
||||||
|
}
|
||||||
val expression = """(tasks.getByName("$taskName") as $taskClass).${if (isNative) "libraries" else "classpath"}.toList()"""
|
val expression = """(tasks.getByName("$taskName") as $taskClass).${if (isNative) "libraries" else "classpath"}.toList()"""
|
||||||
checkPrintedItems(subproject, expression, checkModulesInClasspath, checkModulesNotInClasspath, isBuildGradleKts)
|
checkPrintedItems(subproject, expression, checkModulesInClasspath, checkModulesNotInClasspath, isBuildGradleKts)
|
||||||
}
|
}
|
||||||
|
|||||||
+9
-4
@@ -5,11 +5,9 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.gradle.tasks
|
package org.jetbrains.kotlin.gradle.tasks
|
||||||
|
|
||||||
|
import org.gradle.api.logging.configuration.WarningMode
|
||||||
import org.gradle.util.GradleVersion
|
import org.gradle.util.GradleVersion
|
||||||
import org.jetbrains.kotlin.gradle.BaseGradleIT
|
|
||||||
import org.jetbrains.kotlin.gradle.testbase.*
|
import org.jetbrains.kotlin.gradle.testbase.*
|
||||||
import org.jetbrains.kotlin.gradle.transformProjectWithPluginsDsl
|
|
||||||
import org.junit.Test
|
|
||||||
import org.junit.jupiter.api.DisplayName
|
import org.junit.jupiter.api.DisplayName
|
||||||
|
|
||||||
|
|
||||||
@@ -19,7 +17,14 @@ class CleanDataTaskIT : KGPBaseTest() {
|
|||||||
@DisplayName("nodejs is deleted from Gradle user home")
|
@DisplayName("nodejs is deleted from Gradle user home")
|
||||||
@GradleTest
|
@GradleTest
|
||||||
fun testDownloadedFolderDeletion(gradleVersion: GradleVersion) {
|
fun testDownloadedFolderDeletion(gradleVersion: GradleVersion) {
|
||||||
project("cleanTask", gradleVersion) {
|
project(
|
||||||
|
"cleanTask",
|
||||||
|
gradleVersion,
|
||||||
|
buildOptions = defaultBuildOptions.copy(
|
||||||
|
// bug in Gradle: https://github.com/gradle/gradle/issues/15796
|
||||||
|
warningMode = if (gradleVersion < GradleVersion.version("7.0")) WarningMode.Summary else defaultBuildOptions.warningMode
|
||||||
|
)
|
||||||
|
) {
|
||||||
build("testCleanTask")
|
build("testCleanTask")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -13,7 +13,7 @@ dependencies {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// important to test that destinationDir is configured before evaluation
|
// important to test that destinationDir is configured before evaluation
|
||||||
test.testClassesDirs = files(project.tasks.compileTestKotlin.destinationDir)
|
test.testClassesDirs = files(project.tasks.compileTestKotlin.destinationDirectory)
|
||||||
|
|
||||||
test {
|
test {
|
||||||
testLogging {
|
testLogging {
|
||||||
|
|||||||
+1
-1
@@ -30,7 +30,7 @@ kotlin {
|
|||||||
// Creating static library with a custom name.
|
// Creating static library with a custom name.
|
||||||
staticLib('customNameForiosSimLib') {
|
staticLib('customNameForiosSimLib') {
|
||||||
outputDirectory = file("fooCustomNameForiosSimLib") // outputDir is a `val` property.
|
outputDirectory = file("fooCustomNameForiosSimLib") // outputDir is a `val` property.
|
||||||
linkTask.destinationDir = file("fooCustomNameForiosSimLib")
|
linkTask.destinationDirectory = file("fooCustomNameForiosSimLib")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -39,7 +39,7 @@ kotlin {
|
|||||||
// Creating static library with a custom name.
|
// Creating static library with a custom name.
|
||||||
staticLib('customNameForLinuxLib') {
|
staticLib('customNameForLinuxLib') {
|
||||||
outputDirectory = file("customNameForLinuxLib") // outputDir is a `val` property.
|
outputDirectory = file("customNameForLinuxLib") // outputDir is a `val` property.
|
||||||
linkTask.destinationDir = file("customNameForLinuxLib")
|
linkTask.destinationDirectory = file("customNameForLinuxLib")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -50,7 +50,7 @@ kotlin {
|
|||||||
// Creating static library with a custom name.
|
// Creating static library with a custom name.
|
||||||
staticLib('customNameForMacosLib') {
|
staticLib('customNameForMacosLib') {
|
||||||
outputDirectory = file("customNameForMacosLib") // outputDir is a `val` property.
|
outputDirectory = file("customNameForMacosLib") // outputDir is a `val` property.
|
||||||
linkTask.destinationDir = file("customNameForMacosLib")
|
linkTask.destinationDirectory = file("customNameForMacosLib")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -60,7 +60,7 @@ kotlin {
|
|||||||
// KT-29395 fix
|
// KT-29395 fix
|
||||||
framework {
|
framework {
|
||||||
outputDirectory = file("fooDummyiOS") // outputDir is a `val` property.
|
outputDirectory = file("fooDummyiOS") // outputDir is a `val` property.
|
||||||
linkTask.destinationDir = file("fooDummyiOS")
|
linkTask.destinationDirectory = file("fooDummyiOS")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-5
@@ -8,12 +8,8 @@ package org.jetbrains.kotlin.gradle.mpp
|
|||||||
|
|
||||||
import org.gradle.api.Project
|
import org.gradle.api.Project
|
||||||
import org.gradle.api.artifacts.Configuration
|
import org.gradle.api.artifacts.Configuration
|
||||||
import org.gradle.api.internal.project.ProjectInternal
|
|
||||||
import org.gradle.api.plugins.ExtraPropertiesExtension
|
import org.gradle.api.plugins.ExtraPropertiesExtension
|
||||||
import org.gradle.api.provider.Provider
|
import org.gradle.api.provider.Provider
|
||||||
import org.gradle.testfixtures.ProjectBuilder
|
|
||||||
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
|
|
||||||
import org.jetbrains.kotlin.gradle.dsl.kotlinExtension
|
|
||||||
import org.jetbrains.kotlin.gradle.plugin.*
|
import org.jetbrains.kotlin.gradle.plugin.*
|
||||||
import org.jetbrains.kotlin.gradle.tasks.*
|
import org.jetbrains.kotlin.gradle.tasks.*
|
||||||
import kotlin.test.*
|
import kotlin.test.*
|
||||||
@@ -293,7 +289,7 @@ internal class CompilationSpecificPluginPath {
|
|||||||
.getByName(taskName)
|
.getByName(taskName)
|
||||||
.let {
|
.let {
|
||||||
when (it) {
|
when (it) {
|
||||||
is AbstractKotlinNativeCompile<*, *> -> it.compilerPluginClasspath
|
is AbstractKotlinNativeCompile<*, *, *> -> it.compilerPluginClasspath
|
||||||
is AbstractKotlinCompile<*> -> it.pluginClasspath.from.single()
|
is AbstractKotlinCompile<*> -> it.pluginClasspath.from.single()
|
||||||
else -> error("Unexpected task type with name $taskName. Is it kotlin compile task?")
|
else -> error("Unexpected task type with name $taskName. Is it kotlin compile task?")
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -144,7 +144,7 @@ class KpmCompilerPluginTest {
|
|||||||
.let {
|
.let {
|
||||||
when (it) {
|
when (it) {
|
||||||
is AbstractKotlinCompile<*> -> it.kotlinPluginData
|
is AbstractKotlinCompile<*> -> it.kotlinPluginData
|
||||||
is AbstractKotlinNativeCompile<*, *> -> it.kotlinPluginData
|
is AbstractKotlinNativeCompile<*, *, *> -> it.kotlinPluginData
|
||||||
else -> error("Unknown task type: $it")
|
else -> error("Unknown task type: $it")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -300,7 +300,7 @@ internal open class GradleCompilerRunner(
|
|||||||
task.buildHistoryFile.get().asFile,
|
task.buildHistoryFile.get().asFile,
|
||||||
task.abiSnapshotFile.get().asFile
|
task.abiSnapshotFile.get().asFile
|
||||||
)
|
)
|
||||||
dirToModule[task.destinationDir] = module
|
dirToModule[task.destinationDirectory.get().asFile] = module
|
||||||
task.javaOutputDir.orNull?.asFile?.let { dirToModule[it] = module }
|
task.javaOutputDir.orNull?.asFile?.let { dirToModule[it] = module }
|
||||||
nameToModules.getOrPut(module.name) { HashSet() }.add(module)
|
nameToModules.getOrPut(module.name) { HashSet() }.add(module)
|
||||||
|
|
||||||
|
|||||||
+7
-7
@@ -35,7 +35,6 @@ import org.jetbrains.kotlin.gradle.utils.isParentOf
|
|||||||
import org.jetbrains.kotlin.incremental.classpathAsList
|
import org.jetbrains.kotlin.incremental.classpathAsList
|
||||||
import org.jetbrains.kotlin.incremental.destinationAsFile
|
import org.jetbrains.kotlin.incremental.destinationAsFile
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.util.concurrent.Callable
|
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
@CacheableTask
|
@CacheableTask
|
||||||
@@ -63,7 +62,7 @@ abstract class KaptGenerateStubsTask @Inject constructor(
|
|||||||
val providerFactory = kotlinCompileTask.project.providers
|
val providerFactory = kotlinCompileTask.project.providers
|
||||||
task.useModuleDetection.value(kotlinCompileTask.useModuleDetection).disallowChanges()
|
task.useModuleDetection.value(kotlinCompileTask.useModuleDetection).disallowChanges()
|
||||||
task.moduleName.value(kotlinCompileTask.moduleName).disallowChanges()
|
task.moduleName.value(kotlinCompileTask.moduleName).disallowChanges()
|
||||||
task.classpath = task.project.files(Callable { kotlinCompileTask.classpath })
|
task.classpath.from(kotlinCompileTask.classpath)
|
||||||
task.kotlinTaskPluginClasspath.from(
|
task.kotlinTaskPluginClasspath.from(
|
||||||
providerFactory.provider { kotlinCompileTask.pluginClasspath }
|
providerFactory.provider { kotlinCompileTask.pluginClasspath }
|
||||||
)
|
)
|
||||||
@@ -119,16 +118,17 @@ abstract class KaptGenerateStubsTask @Inject constructor(
|
|||||||
@get:Incremental
|
@get:Incremental
|
||||||
abstract val additionalSources: ConfigurableFileCollection
|
abstract val additionalSources: ConfigurableFileCollection
|
||||||
|
|
||||||
override fun source(vararg sources: Any): SourceTask {
|
override fun setSource(vararg source: Any) {
|
||||||
return super.source(sourceRootsContainer.add(sources))
|
super.setSource(sourceRootsContainer.add(sources))
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun setSource(sources: Any) {
|
override fun setSource(source: Any) {
|
||||||
super.setSource(sourceRootsContainer.set(sources))
|
super.setSource(sourceRootsContainer.set(sources))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: prevent querying destinationDirectory on configuration time
|
||||||
private fun isSourceRootAllowed(source: File): Boolean =
|
private fun isSourceRootAllowed(source: File): Boolean =
|
||||||
!destinationDir.isParentOf(source) &&
|
!destinationDirectory.get().asFile.isParentOf(source) &&
|
||||||
!stubsDir.asFile.get().isParentOf(source) &&
|
!stubsDir.asFile.get().isParentOf(source) &&
|
||||||
generatedSourcesDirs.none { it.isParentOf(source) }
|
generatedSourcesDirs.none { it.isParentOf(source) }
|
||||||
|
|
||||||
@@ -146,7 +146,7 @@ abstract class KaptGenerateStubsTask @Inject constructor(
|
|||||||
|
|
||||||
args.verbose = verbose.get()
|
args.verbose = verbose.get()
|
||||||
args.classpathAsList = this.classpath.filter { it.exists() }.toList()
|
args.classpathAsList = this.classpath.filter { it.exists() }.toList()
|
||||||
args.destinationAsFile = this.destinationDir
|
args.destinationAsFile = this.destinationDirectory.get().asFile
|
||||||
}
|
}
|
||||||
|
|
||||||
@get:Internal
|
@get:Internal
|
||||||
|
|||||||
+2
-2
@@ -90,7 +90,7 @@ class KotlinModelBuilder(private val kotlinPluginVersion: String, private val an
|
|||||||
friendSourceSets.get(),
|
friendSourceSets.get(),
|
||||||
kotlinSourceSet.kotlin.srcDirs,
|
kotlinSourceSet.kotlin.srcDirs,
|
||||||
javaSourceSet.resources.srcDirs,
|
javaSourceSet.resources.srcDirs,
|
||||||
destinationDir,
|
destinationDirectory.get().asFile,
|
||||||
javaSourceSet.output.resourcesDir!!,
|
javaSourceSet.output.resourcesDir!!,
|
||||||
createCompilerArguments()
|
createCompilerArguments()
|
||||||
)
|
)
|
||||||
@@ -116,7 +116,7 @@ class KotlinModelBuilder(private val kotlinPluginVersion: String, private val an
|
|||||||
friendSourceSets.get(),
|
friendSourceSets.get(),
|
||||||
sources,
|
sources,
|
||||||
resources,
|
resources,
|
||||||
destinationDir,
|
destinationDirectory.get().asFile,
|
||||||
compilation.output.resourcesDir,
|
compilation.output.resourcesDir,
|
||||||
createCompilerArguments()
|
createCompilerArguments()
|
||||||
)
|
)
|
||||||
|
|||||||
+1
-1
@@ -175,7 +175,7 @@ open class KotlinPlatformImplementationPluginBase(platformName: String) : Kotlin
|
|||||||
|
|
||||||
val commonSources = getKotlinSourceDirectorySetSafe(commonSourceSet)!!
|
val commonSources = getKotlinSourceDirectorySetSafe(commonSourceSet)!!
|
||||||
for (platformTask in platformTasks) {
|
for (platformTask in platformTasks) {
|
||||||
platformTask.source(commonSources)
|
platformTask.setSource(commonSources)
|
||||||
platformTask.commonSourceSet.from(commonSources)
|
platformTask.commonSourceSet.from(commonSources)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-4
@@ -36,7 +36,6 @@ import org.jetbrains.kotlin.gradle.model.builder.KotlinModelBuilder
|
|||||||
import org.jetbrains.kotlin.gradle.plugin.mpp.*
|
import org.jetbrains.kotlin.gradle.plugin.mpp.*
|
||||||
import org.jetbrains.kotlin.gradle.plugin.mpp.pm20.KotlinCompilationData
|
import org.jetbrains.kotlin.gradle.plugin.mpp.pm20.KotlinCompilationData
|
||||||
import org.jetbrains.kotlin.gradle.plugin.mpp.pm20.isMainCompilationData
|
import org.jetbrains.kotlin.gradle.plugin.mpp.pm20.isMainCompilationData
|
||||||
import org.jetbrains.kotlin.gradle.report.BuildMetricsReporterService
|
|
||||||
import org.jetbrains.kotlin.gradle.scripting.internal.ScriptingGradleSubplugin
|
import org.jetbrains.kotlin.gradle.scripting.internal.ScriptingGradleSubplugin
|
||||||
import org.jetbrains.kotlin.gradle.targets.js.dsl.KotlinJsBinaryMode
|
import org.jetbrains.kotlin.gradle.targets.js.dsl.KotlinJsBinaryMode
|
||||||
import org.jetbrains.kotlin.gradle.targets.js.ir.*
|
import org.jetbrains.kotlin.gradle.targets.js.ir.*
|
||||||
@@ -65,7 +64,7 @@ val KOTLIN_DSL_NAME = "kotlin"
|
|||||||
val KOTLIN_JS_DSL_NAME = "kotlin2js"
|
val KOTLIN_JS_DSL_NAME = "kotlin2js"
|
||||||
val KOTLIN_OPTIONS_DSL_NAME = "kotlinOptions"
|
val KOTLIN_OPTIONS_DSL_NAME = "kotlinOptions"
|
||||||
|
|
||||||
abstract class KotlinCompilationProcessor<out T : SourceTask>(
|
abstract class KotlinCompilationProcessor<out T : AbstractKotlinCompileTool<*>>(
|
||||||
open val kotlinCompilation: KotlinCompilationData<*>
|
open val kotlinCompilation: KotlinCompilationData<*>
|
||||||
) {
|
) {
|
||||||
abstract val kotlinTask: TaskProvider<out T>
|
abstract val kotlinTask: TaskProvider<out T>
|
||||||
@@ -123,7 +122,7 @@ internal abstract class KotlinSourceSetProcessor<T : AbstractKotlinCompile<*>>(
|
|||||||
return register(project, name) {
|
return register(project, name) {
|
||||||
it.description = taskDescription
|
it.description = taskDescription
|
||||||
it.destinationDirectory.set(defaultKotlinDestinationDir)
|
it.destinationDirectory.set(defaultKotlinDestinationDir)
|
||||||
it.classpath = project.files({ kotlinCompilation.compileDependencyFiles })
|
it.classpath.from({ kotlinCompilation.compileDependencyFiles })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1049,7 +1048,7 @@ abstract class AbstractAndroidProjectHandler(private val kotlinConfigurationTool
|
|||||||
val kotlinTask = compilation.compileKotlinTaskProvider
|
val kotlinTask = compilation.compileKotlinTaskProvider
|
||||||
compilation.androidVariant.forEachJavaSourceDir { sources ->
|
compilation.androidVariant.forEachJavaSourceDir { sources ->
|
||||||
kotlinTask.configure {
|
kotlinTask.configure {
|
||||||
it.source(sources.dir)
|
it.setSource(sources.dir)
|
||||||
it.dependsOn(sources)
|
it.dependsOn(sources)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+12
-5
@@ -2,7 +2,6 @@ package org.jetbrains.kotlin.gradle.plugin
|
|||||||
|
|
||||||
import org.gradle.api.Project
|
import org.gradle.api.Project
|
||||||
import org.gradle.api.tasks.TaskProvider
|
import org.gradle.api.tasks.TaskProvider
|
||||||
import org.gradle.api.tasks.compile.AbstractCompile
|
|
||||||
import org.gradle.api.tasks.compile.JavaCompile
|
import org.gradle.api.tasks.compile.JavaCompile
|
||||||
import org.jetbrains.kotlin.gradle.dsl.KotlinCompile
|
import org.jetbrains.kotlin.gradle.dsl.KotlinCompile
|
||||||
import org.jetbrains.kotlin.gradle.logging.kotlinDebug
|
import org.jetbrains.kotlin.gradle.logging.kotlinDebug
|
||||||
@@ -13,6 +12,7 @@ import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinWithJavaCompilation
|
|||||||
import org.jetbrains.kotlin.gradle.targets.js.ir.JsIrBinary
|
import org.jetbrains.kotlin.gradle.targets.js.ir.JsIrBinary
|
||||||
import org.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsIrCompilation
|
import org.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsIrCompilation
|
||||||
import org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile
|
import org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile
|
||||||
|
import org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompileTool
|
||||||
import org.jetbrains.kotlin.gradle.tasks.CompilerPluginOptions
|
import org.jetbrains.kotlin.gradle.tasks.CompilerPluginOptions
|
||||||
import org.jetbrains.kotlin.gradle.tasks.KotlinNativeCompile
|
import org.jetbrains.kotlin.gradle.tasks.KotlinNativeCompile
|
||||||
|
|
||||||
@@ -89,13 +89,20 @@ class SubpluginEnvironment(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal fun addCompilationSourcesToExternalCompileTask(compilation: KotlinCompilation<*>, task: TaskProvider<out AbstractCompile>) {
|
internal fun addCompilationSourcesToExternalCompileTask(
|
||||||
|
compilation: KotlinCompilation<*>,
|
||||||
|
task: TaskProvider<out AbstractKotlinCompileTool<*>>
|
||||||
|
) {
|
||||||
if (compilation is KotlinJvmAndroidCompilation) {
|
if (compilation is KotlinJvmAndroidCompilation) {
|
||||||
compilation.androidVariant.forEachKotlinSourceSet { sourceSet -> task.configure { it.source(sourceSet.kotlin) } }
|
compilation.androidVariant.forEachKotlinSourceSet { sourceSet ->
|
||||||
compilation.androidVariant.forEachJavaSourceDir { sources -> task.configure { it.source(sources.dir) } }
|
task.configure { it.setSource(sourceSet.kotlin) }
|
||||||
|
}
|
||||||
|
compilation.androidVariant.forEachJavaSourceDir { sources ->
|
||||||
|
task.configure { it.setSource(sources.dir) }
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
task.configure { taskInstance ->
|
task.configure { taskInstance ->
|
||||||
compilation.allKotlinSourceSets.forEach { sourceSet -> taskInstance.source(sourceSet.kotlin) }
|
compilation.allKotlinSourceSets.forEach { sourceSet -> taskInstance.setSource(sourceSet.kotlin) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -163,7 +163,7 @@ internal fun addSourcesToKotlinCompileTask(
|
|||||||
fun AbstractKotlinCompile<*>.configureAction() {
|
fun AbstractKotlinCompile<*>.configureAction() {
|
||||||
// In this call, the super-implementation of `source` adds the directories files to the roots of the union file tree,
|
// In this call, the super-implementation of `source` adds the directories files to the roots of the union file tree,
|
||||||
// so it's OK to pass just the source roots.
|
// so it's OK to pass just the source roots.
|
||||||
source(Callable(sources))
|
setSource(Callable(sources))
|
||||||
sourceFilesExtensions.addAll(sourceFileExtensions)
|
sourceFilesExtensions.addAll(sourceFileExtensions)
|
||||||
|
|
||||||
// The `commonSourceSet` is passed to the compiler as-is, converted with toList
|
// The `commonSourceSet` is passed to the compiler as-is, converted with toList
|
||||||
|
|||||||
+1
-2
@@ -7,7 +7,6 @@ package org.jetbrains.kotlin.gradle.plugin.mpp.pm20
|
|||||||
|
|
||||||
import org.gradle.api.Project
|
import org.gradle.api.Project
|
||||||
import org.gradle.api.tasks.TaskProvider
|
import org.gradle.api.tasks.TaskProvider
|
||||||
import org.gradle.api.tasks.compile.AbstractCompile
|
|
||||||
import org.jetbrains.kotlin.gradle.plugin.Kotlin2JvmSourceSetProcessor
|
import org.jetbrains.kotlin.gradle.plugin.Kotlin2JvmSourceSetProcessor
|
||||||
import org.jetbrains.kotlin.gradle.plugin.KotlinNativeTargetConfigurator
|
import org.jetbrains.kotlin.gradle.plugin.KotlinNativeTargetConfigurator
|
||||||
import org.jetbrains.kotlin.gradle.plugin.mpp.addCommonSourcesToKotlinCompileTask
|
import org.jetbrains.kotlin.gradle.plugin.mpp.addCommonSourcesToKotlinCompileTask
|
||||||
@@ -57,7 +56,7 @@ open class KotlinCompilationTaskConfigurator(
|
|||||||
val commonSources = getCommonSourcesForFragmentCompilation(fragment)
|
val commonSources = getCommonSourcesForFragmentCompilation(fragment)
|
||||||
|
|
||||||
compileTask.configure {
|
compileTask.configure {
|
||||||
it.source(allSources)
|
it.setSource(allSources)
|
||||||
it.commonSources.from(commonSources)
|
it.commonSources.from(commonSources)
|
||||||
|
|
||||||
it.configure()
|
it.configure()
|
||||||
|
|||||||
+2
-2
@@ -77,7 +77,7 @@ internal class DefaultLanguageSettingsBuilder : LanguageSettingsBuilder {
|
|||||||
val pluginOptionsTask = compilerPluginOptionsTask.value ?: return null
|
val pluginOptionsTask = compilerPluginOptionsTask.value ?: return null
|
||||||
return when (pluginOptionsTask) {
|
return when (pluginOptionsTask) {
|
||||||
is AbstractKotlinCompile<*> -> pluginOptionsTask.pluginOptions
|
is AbstractKotlinCompile<*> -> pluginOptionsTask.pluginOptions
|
||||||
is AbstractKotlinNativeCompile<*, *> -> pluginOptionsTask.compilerPluginOptions
|
is AbstractKotlinNativeCompile<*, *, *> -> pluginOptionsTask.compilerPluginOptions
|
||||||
else -> error("Unexpected task: $pluginOptionsTask")
|
else -> error("Unexpected task: $pluginOptionsTask")
|
||||||
}.arguments
|
}.arguments
|
||||||
}
|
}
|
||||||
@@ -87,7 +87,7 @@ internal class DefaultLanguageSettingsBuilder : LanguageSettingsBuilder {
|
|||||||
val pluginClasspathTask = compilerPluginOptionsTask.value ?: return null
|
val pluginClasspathTask = compilerPluginOptionsTask.value ?: return null
|
||||||
return when (pluginClasspathTask) {
|
return when (pluginClasspathTask) {
|
||||||
is AbstractKotlinCompile<*> -> pluginClasspathTask.pluginClasspath
|
is AbstractKotlinCompile<*> -> pluginClasspathTask.pluginClasspath
|
||||||
is AbstractKotlinNativeCompile<*, *> -> pluginClasspathTask.compilerPluginClasspath ?: pluginClasspathTask.project.files()
|
is AbstractKotlinNativeCompile<*, *, *> -> pluginClasspathTask.compilerPluginClasspath ?: pluginClasspathTask.project.files()
|
||||||
else -> error("Unexpected task: $pluginClasspathTask")
|
else -> error("Unexpected task: $pluginClasspathTask")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-3
@@ -17,7 +17,6 @@ import org.gradle.api.attributes.Attribute
|
|||||||
import org.gradle.api.attributes.Category
|
import org.gradle.api.attributes.Category
|
||||||
import org.gradle.api.file.FileCollection
|
import org.gradle.api.file.FileCollection
|
||||||
import org.gradle.api.specs.Spec
|
import org.gradle.api.specs.Spec
|
||||||
import org.gradle.api.tasks.PathSensitivity
|
|
||||||
import org.gradle.api.tasks.TaskProvider
|
import org.gradle.api.tasks.TaskProvider
|
||||||
import org.gradle.api.tasks.bundling.AbstractArchiveTask
|
import org.gradle.api.tasks.bundling.AbstractArchiveTask
|
||||||
import org.gradle.api.tasks.compile.AbstractCompile
|
import org.gradle.api.tasks.compile.AbstractCompile
|
||||||
@@ -49,7 +48,7 @@ class Android25ProjectHandler(
|
|||||||
) {
|
) {
|
||||||
val preJavaKotlinOutput = project.files(project.provider {
|
val preJavaKotlinOutput = project.files(project.provider {
|
||||||
mutableListOf<File>().apply {
|
mutableListOf<File>().apply {
|
||||||
add(kotlinTask.get().destinationDir)
|
add(kotlinTask.get().destinationDirectory.get().asFile)
|
||||||
if (Kapt3GradleSubplugin.isEnabled(project)) {
|
if (Kapt3GradleSubplugin.isEnabled(project)) {
|
||||||
// Add Kapt3 output as well, since there's no SyncOutputTask with the new API
|
// Add Kapt3 output as well, since there's no SyncOutputTask with the new API
|
||||||
val kaptClasssesDir = Kapt3GradleSubplugin.getKaptGeneratedClassesDir(project, getVariantName(variantData))
|
val kaptClasssesDir = Kapt3GradleSubplugin.getKaptGeneratedClassesDir(project, getVariantName(variantData))
|
||||||
@@ -60,7 +59,7 @@ class Android25ProjectHandler(
|
|||||||
|
|
||||||
val preJavaClasspathKey = variantData.registerPreJavacGeneratedBytecode(preJavaKotlinOutput)
|
val preJavaClasspathKey = variantData.registerPreJavacGeneratedBytecode(preJavaKotlinOutput)
|
||||||
kotlinTask.configure { kotlinTaskInstance ->
|
kotlinTask.configure { kotlinTaskInstance ->
|
||||||
kotlinTaskInstance.classpath = project.files()
|
kotlinTaskInstance.classpath
|
||||||
.from(variantData.getCompileClasspath(preJavaClasspathKey))
|
.from(variantData.getCompileClasspath(preJavaClasspathKey))
|
||||||
.from(Callable { AndroidGradleWrapper.getRuntimeJars(androidPlugin, androidExt) })
|
.from(Callable { AndroidGradleWrapper.getRuntimeJars(androidPlugin, androidExt) })
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -130,7 +130,7 @@ class AndroidSubplugin : KotlinCompilerPluginSupportPlugin {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
kotlinCompilation.compileKotlinTaskProvider.configure {
|
kotlinCompilation.compileKotlinTaskProvider.configure {
|
||||||
it.source(getLayoutDirectories(project, sourceSet.res.srcDirs))
|
it.setSource(getLayoutDirectories(project, sourceSet.res.srcDirs))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -76,9 +76,9 @@ class KotlinJsDcePlugin : Plugin<Project> {
|
|||||||
val configuration = project.configurations.getByName(kotlinCompilation.compileDependencyConfigurationName)
|
val configuration = project.configurations.getByName(kotlinCompilation.compileDependencyConfigurationName)
|
||||||
|
|
||||||
dceTask.configure {
|
dceTask.configure {
|
||||||
it.classpath = configuration
|
it.classpath.from(configuration)
|
||||||
it.destinationDir = it.dceOptions.outputDirectory?.let { File(it) } ?: outputDir
|
it.destinationDirectory.set(it.dceOptions.outputDirectory?.let { File(it) } ?: outputDir)
|
||||||
it.source((kotlinTask.get() as Kotlin2JsCompile).outputFileProperty.get())
|
it.setSource((kotlinTask.get() as Kotlin2JsCompile).outputFileProperty)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+18
-12
@@ -7,10 +7,9 @@ package org.jetbrains.kotlin.gradle.targets.js.ir
|
|||||||
|
|
||||||
import org.gradle.api.file.ConfigurableFileCollection
|
import org.gradle.api.file.ConfigurableFileCollection
|
||||||
import org.gradle.api.file.DirectoryProperty
|
import org.gradle.api.file.DirectoryProperty
|
||||||
import org.gradle.api.file.FileTree
|
import org.gradle.api.file.ProjectLayout
|
||||||
import org.gradle.api.model.ObjectFactory
|
import org.gradle.api.model.ObjectFactory
|
||||||
import org.gradle.api.tasks.*
|
import org.gradle.api.tasks.*
|
||||||
import org.gradle.internal.hash.FileHasher
|
|
||||||
import org.gradle.workers.WorkerExecutor
|
import org.gradle.workers.WorkerExecutor
|
||||||
import org.jetbrains.kotlin.cli.common.arguments.K2JSCompilerArguments
|
import org.jetbrains.kotlin.cli.common.arguments.K2JSCompilerArguments
|
||||||
import org.jetbrains.kotlin.cli.common.arguments.parseCommandLineArguments
|
import org.jetbrains.kotlin.cli.common.arguments.parseCommandLineArguments
|
||||||
@@ -26,6 +25,7 @@ import org.jetbrains.kotlin.gradle.targets.js.dsl.KotlinJsBinaryMode.DEVELOPMENT
|
|||||||
import org.jetbrains.kotlin.gradle.targets.js.dsl.KotlinJsBinaryMode.PRODUCTION
|
import org.jetbrains.kotlin.gradle.targets.js.dsl.KotlinJsBinaryMode.PRODUCTION
|
||||||
import org.jetbrains.kotlin.gradle.tasks.Kotlin2JsCompile
|
import org.jetbrains.kotlin.gradle.tasks.Kotlin2JsCompile
|
||||||
import org.jetbrains.kotlin.gradle.utils.getValue
|
import org.jetbrains.kotlin.gradle.utils.getValue
|
||||||
|
import org.jetbrains.kotlin.gradle.utils.property
|
||||||
import org.jetbrains.kotlin.gradle.utils.toHexString
|
import org.jetbrains.kotlin.gradle.utils.toHexString
|
||||||
import org.jetbrains.kotlin.statistics.metrics.BooleanMetrics
|
import org.jetbrains.kotlin.statistics.metrics.BooleanMetrics
|
||||||
import org.jetbrains.kotlin.statistics.metrics.StringMetrics
|
import org.jetbrains.kotlin.statistics.metrics.StringMetrics
|
||||||
@@ -36,8 +36,9 @@ import javax.inject.Inject
|
|||||||
|
|
||||||
@CacheableTask
|
@CacheableTask
|
||||||
abstract class KotlinJsIrLink @Inject constructor(
|
abstract class KotlinJsIrLink @Inject constructor(
|
||||||
objectFactory: ObjectFactory,
|
private val objectFactory: ObjectFactory,
|
||||||
workerExecutor: WorkerExecutor
|
workerExecutor: WorkerExecutor,
|
||||||
|
private val projectLayout: ProjectLayout
|
||||||
) : Kotlin2JsCompile(
|
) : Kotlin2JsCompile(
|
||||||
KotlinJsOptionsImpl(),
|
KotlinJsOptionsImpl(),
|
||||||
objectFactory,
|
objectFactory,
|
||||||
@@ -81,8 +82,8 @@ abstract class KotlinJsIrLink @Inject constructor(
|
|||||||
lateinit var mode: KotlinJsBinaryMode
|
lateinit var mode: KotlinJsBinaryMode
|
||||||
|
|
||||||
// Not check sources, only klib module
|
// Not check sources, only klib module
|
||||||
@Internal
|
@get:Internal
|
||||||
override fun getSource(): FileTree = super.getSource()
|
abstract override val sources: ConfigurableFileCollection
|
||||||
|
|
||||||
private val buildDir = project.buildDir
|
private val buildDir = project.buildDir
|
||||||
|
|
||||||
@@ -92,13 +93,18 @@ abstract class KotlinJsIrLink @Inject constructor(
|
|||||||
@get:PathSensitive(PathSensitivity.RELATIVE)
|
@get:PathSensitive(PathSensitivity.RELATIVE)
|
||||||
internal abstract val entryModule: DirectoryProperty
|
internal abstract val entryModule: DirectoryProperty
|
||||||
|
|
||||||
override fun getDestinationDir(): File {
|
override val destinationDirectory: DirectoryProperty
|
||||||
return if (kotlinOptions.outputFile == null) {
|
get() = objectFactory.directoryProperty().apply {
|
||||||
super.getDestinationDir()
|
set(
|
||||||
} else {
|
destinationDirectory.flatMap { dir ->
|
||||||
outputFile.parentFile
|
if (kotlinOptions.outputFile == null) {
|
||||||
|
objectFactory.property(dir)
|
||||||
|
} else {
|
||||||
|
projectLayout.dir(outputFileProperty.map { it.parentFile })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
override fun skipCondition(): Boolean {
|
override fun skipCondition(): Boolean {
|
||||||
return !entryModule.get().asFile.exists()
|
return !entryModule.get().asFile.exists()
|
||||||
|
|||||||
+1
-2
@@ -26,7 +26,6 @@ import org.jetbrains.kotlin.gradle.targets.js.dsl.KotlinJsTargetDsl
|
|||||||
import org.jetbrains.kotlin.gradle.targets.js.npm.npmProject
|
import org.jetbrains.kotlin.gradle.targets.js.npm.npmProject
|
||||||
import org.jetbrains.kotlin.gradle.tasks.locateOrRegisterTask
|
import org.jetbrains.kotlin.gradle.tasks.locateOrRegisterTask
|
||||||
import org.jetbrains.kotlin.gradle.tasks.registerTask
|
import org.jetbrains.kotlin.gradle.tasks.registerTask
|
||||||
import org.jetbrains.kotlin.gradle.utils.listProperty
|
|
||||||
import org.jetbrains.kotlin.gradle.utils.lowerCamelCaseName
|
import org.jetbrains.kotlin.gradle.utils.lowerCamelCaseName
|
||||||
import org.jetbrains.kotlin.gradle.utils.setProperty
|
import org.jetbrains.kotlin.gradle.utils.setProperty
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
@@ -137,7 +136,7 @@ constructor(
|
|||||||
binary.linkSyncTaskName
|
binary.linkSyncTaskName
|
||||||
) { task ->
|
) { task ->
|
||||||
task.from(
|
task.from(
|
||||||
project.layout.file(binary.linkTask.map { it.destinationDir })
|
project.layout.file(binary.linkTask.flatMap { it.destinationDirectory.map { it.asFile } })
|
||||||
)
|
)
|
||||||
|
|
||||||
task.from(project.tasks.named(compilation.processResourcesTaskName))
|
task.from(project.tasks.named(compilation.processResourcesTaskName))
|
||||||
|
|||||||
+3
-3
@@ -97,9 +97,9 @@ open class KotlinJsIrTargetConfigurator() :
|
|||||||
|
|
||||||
compilation.compileKotlinTaskProvider.configure { task ->
|
compilation.compileKotlinTaskProvider.configure { task ->
|
||||||
val outputFilePath = outputFile ?: if (produceUnzippedKlib) {
|
val outputFilePath = outputFile ?: if (produceUnzippedKlib) {
|
||||||
task.destinationDir.absoluteFile.normalize().absolutePath
|
task.destinationDirectory.get().asFile.absoluteFile.normalize().absolutePath
|
||||||
} else {
|
} else {
|
||||||
File(task.destinationDir, "$baseName.$KLIB_TYPE").absoluteFile.normalize().absolutePath
|
File(task.destinationDirectory.get().asFile, "$baseName.$KLIB_TYPE").absoluteFile.normalize().absolutePath
|
||||||
}
|
}
|
||||||
outputFile = outputFilePath
|
outputFile = outputFilePath
|
||||||
|
|
||||||
@@ -112,7 +112,7 @@ open class KotlinJsIrTargetConfigurator() :
|
|||||||
"To fix this, consider using the default outputFile location instead of providing it explicitly."
|
"To fix this, consider using the default outputFile location instead of providing it explicitly."
|
||||||
)
|
)
|
||||||
|
|
||||||
task.destinationDir = taskOutputDir
|
task.destinationDirectory.set(taskOutputDir)
|
||||||
}
|
}
|
||||||
|
|
||||||
val klibModuleName = target.project.klibModuleName(baseName)
|
val klibModuleName = target.project.klibModuleName(baseName)
|
||||||
|
|||||||
+13
-8
@@ -26,7 +26,6 @@ import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpack
|
|||||||
import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackConfig
|
import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackConfig
|
||||||
import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackConfig.Mode
|
import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackConfig.Mode
|
||||||
import org.jetbrains.kotlin.gradle.targets.js.webpack.WebpackDevtool
|
import org.jetbrains.kotlin.gradle.targets.js.webpack.WebpackDevtool
|
||||||
import org.jetbrains.kotlin.gradle.targets.js.webpack.WebpackMajorVersion
|
|
||||||
import org.jetbrains.kotlin.gradle.targets.js.webpack.WebpackMajorVersion.Companion.choose
|
import org.jetbrains.kotlin.gradle.targets.js.webpack.WebpackMajorVersion.Companion.choose
|
||||||
import org.jetbrains.kotlin.gradle.tasks.dependsOn
|
import org.jetbrains.kotlin.gradle.tasks.dependsOn
|
||||||
import org.jetbrains.kotlin.gradle.tasks.registerTask
|
import org.jetbrains.kotlin.gradle.tasks.registerTask
|
||||||
@@ -266,9 +265,13 @@ open class KotlinBrowserJs @Inject constructor(target: KotlinJsTarget) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
entryProperty.set(
|
entryProperty.set(
|
||||||
project.layout.file(actualDceTaskProvider.map {
|
project.layout.file(
|
||||||
it.destinationDir.resolve(compilation.compileKotlinTask.outputFileProperty.get().name)
|
actualDceTaskProvider
|
||||||
})
|
.map {
|
||||||
|
it.destinationDirectory.file(compilation.compileKotlinTask.outputFileProperty.get().name)
|
||||||
|
}
|
||||||
|
.flatMap { it.map { it.asFile } }
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
resolveFromModulesFirst = true
|
resolveFromModulesFirst = true
|
||||||
@@ -305,12 +308,14 @@ open class KotlinBrowserJs @Inject constructor(target: KotlinJsTarget) :
|
|||||||
|
|
||||||
it.kotlinFilesOnly = true
|
it.kotlinFilesOnly = true
|
||||||
|
|
||||||
it.classpath = project.configurations.getByName(compilation.runtimeDependencyConfigurationName)
|
it.classpath.from(project.configurations.getByName(compilation.runtimeDependencyConfigurationName))
|
||||||
it.destinationDir = it.dceOptions.outputDirectory?.let { File(it) }
|
it.destinationDirectory.set(
|
||||||
?: compilation.npmProject.dir.resolve(if (dev) DCE_DEV_DIR else DCE_DIR)
|
it.dceOptions.outputDirectory?.let { File(it) }
|
||||||
|
?: compilation.npmProject.dir.resolve(if (dev) DCE_DEV_DIR else DCE_DIR)
|
||||||
|
)
|
||||||
it.defaultCompilerClasspath.setFrom(project.configurations.named(COMPILER_CLASSPATH_CONFIGURATION_NAME))
|
it.defaultCompilerClasspath.setFrom(project.configurations.named(COMPILER_CLASSPATH_CONFIGURATION_NAME))
|
||||||
|
|
||||||
it.source(kotlinTask.map { it.outputFileProperty.get() })
|
it.setSource(kotlinTask.map { it.outputFileProperty })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+23
-17
@@ -224,23 +224,29 @@ constructor(
|
|||||||
compilation.platformType
|
compilation.platformType
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* [forNpmDependencies] is used to avoid querying [destinationDirectory] before task execution.
|
||||||
|
* Otherwise, Gradle will fail the build.
|
||||||
|
*/
|
||||||
|
private fun createWebpackConfig(forNpmDependencies: Boolean = false) = KotlinWebpackConfig(
|
||||||
|
mode = mode,
|
||||||
|
entry = if (forNpmDependencies) null else entry,
|
||||||
|
reportEvaluatedConfigFile = if (!forNpmDependencies && saveEvaluatedConfigFile) evaluatedConfigFile else null,
|
||||||
|
output = output,
|
||||||
|
outputPath = if (forNpmDependencies) null else destinationDirectory,
|
||||||
|
outputFileName = outputFileName,
|
||||||
|
configDirectory = configDirectory,
|
||||||
|
bundleAnalyzerReportDir = if (!forNpmDependencies && report) reportDir else null,
|
||||||
|
cssSupport = cssSupport,
|
||||||
|
devServer = devServer,
|
||||||
|
devtool = devtool,
|
||||||
|
sourceMaps = sourceMaps,
|
||||||
|
resolveFromModulesFirst = resolveFromModulesFirst,
|
||||||
|
webpackMajorVersion = webpackMajorVersion
|
||||||
|
)
|
||||||
|
|
||||||
private fun createRunner(): KotlinWebpackRunner {
|
private fun createRunner(): KotlinWebpackRunner {
|
||||||
val config = KotlinWebpackConfig(
|
val config = createWebpackConfig()
|
||||||
mode = mode,
|
|
||||||
entry = entry,
|
|
||||||
reportEvaluatedConfigFile = if (saveEvaluatedConfigFile) evaluatedConfigFile else null,
|
|
||||||
output = output,
|
|
||||||
outputPath = destinationDirectory,
|
|
||||||
outputFileName = outputFileName,
|
|
||||||
configDirectory = configDirectory,
|
|
||||||
bundleAnalyzerReportDir = if (report) reportDir else null,
|
|
||||||
cssSupport = cssSupport,
|
|
||||||
devServer = devServer,
|
|
||||||
devtool = devtool,
|
|
||||||
sourceMaps = sourceMaps,
|
|
||||||
resolveFromModulesFirst = resolveFromModulesFirst,
|
|
||||||
webpackMajorVersion = webpackMajorVersion
|
|
||||||
)
|
|
||||||
|
|
||||||
if (platformType == KotlinPlatformType.wasm) {
|
if (platformType == KotlinPlatformType.wasm) {
|
||||||
config.experiments += listOf(
|
config.experiments += listOf(
|
||||||
@@ -268,7 +274,7 @@ constructor(
|
|||||||
@Internal get() = true
|
@Internal get() = true
|
||||||
|
|
||||||
override val requiredNpmDependencies: Set<RequiredKotlinJsDependency>
|
override val requiredNpmDependencies: Set<RequiredKotlinJsDependency>
|
||||||
@Internal get() = createRunner().config.getRequiredDependencies(versions)
|
@Internal get() = createWebpackConfig(true).getRequiredDependencies(versions)
|
||||||
|
|
||||||
private val isContinuous = project.gradle.startParameter.isContinuous
|
private val isContinuous = project.gradle.startParameter.isContinuous
|
||||||
|
|
||||||
|
|||||||
+4
-4
@@ -6,13 +6,11 @@
|
|||||||
@file:Suppress("PackageDirectoryMismatch") // Old package for compatibility
|
@file:Suppress("PackageDirectoryMismatch") // Old package for compatibility
|
||||||
package org.jetbrains.kotlin.gradle.plugin.mpp
|
package org.jetbrains.kotlin.gradle.plugin.mpp
|
||||||
|
|
||||||
import org.gradle.api.file.FileCollection
|
|
||||||
import org.gradle.api.tasks.SourceSet
|
import org.gradle.api.tasks.SourceSet
|
||||||
import org.gradle.api.tasks.TaskProvider
|
import org.gradle.api.tasks.TaskProvider
|
||||||
import org.gradle.api.tasks.compile.JavaCompile
|
import org.gradle.api.tasks.compile.JavaCompile
|
||||||
|
import org.gradle.kotlin.dsl.named
|
||||||
import org.jetbrains.kotlin.gradle.dsl.KotlinCommonOptions
|
import org.jetbrains.kotlin.gradle.dsl.KotlinCommonOptions
|
||||||
import org.jetbrains.kotlin.gradle.plugin.KotlinCompilation
|
|
||||||
import org.jetbrains.kotlin.gradle.plugin.KotlinCompilationOutput
|
|
||||||
import org.jetbrains.kotlin.gradle.plugin.KotlinCompilationWithResources
|
import org.jetbrains.kotlin.gradle.plugin.KotlinCompilationWithResources
|
||||||
import org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile
|
import org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile
|
||||||
|
|
||||||
@@ -45,7 +43,9 @@ class KotlinWithJavaCompilation<KotlinOptionsType : KotlinCommonOptions>(
|
|||||||
fun source(javaSourceSet: SourceSet) {
|
fun source(javaSourceSet: SourceSet) {
|
||||||
with(target.project) {
|
with(target.project) {
|
||||||
afterEvaluate {
|
afterEvaluate {
|
||||||
(tasks.getByName(compileKotlinTaskName) as AbstractKotlinCompile<*>).source(javaSourceSet.java)
|
tasks.named<AbstractKotlinCompile<*>>(compileKotlinTaskName).configure {
|
||||||
|
it.setSource(javaSourceSet.java)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -80,7 +80,7 @@ internal fun addSourcesToKotlinNativeCompileTask(
|
|||||||
addAsCommonSources: Lazy<Boolean>
|
addAsCommonSources: Lazy<Boolean>
|
||||||
) {
|
) {
|
||||||
project.tasks.withType(KotlinNativeCompile::class.java).matching { it.name == taskName }.configureEach { task ->
|
project.tasks.withType(KotlinNativeCompile::class.java).matching { it.name == taskName }.configureEach { task ->
|
||||||
task.source(sourceFiles)
|
task.setSource(sourceFiles)
|
||||||
task.commonSources.from(project.files(Callable { if (addAsCommonSources.value) sourceFiles() else emptyList() }))
|
task.commonSources.from(project.files(Callable { if (addAsCommonSources.value) sourceFiles() else emptyList() }))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
-2
@@ -32,7 +32,6 @@ import org.jetbrains.kotlin.gradle.plugin.mpp.apple.registerEmbedAndSignAppleFra
|
|||||||
import org.jetbrains.kotlin.gradle.plugin.mpp.isMain
|
import org.jetbrains.kotlin.gradle.plugin.mpp.isMain
|
||||||
import org.jetbrains.kotlin.gradle.plugin.mpp.pm20.*
|
import org.jetbrains.kotlin.gradle.plugin.mpp.pm20.*
|
||||||
import org.jetbrains.kotlin.gradle.plugin.mpp.pm20.KpmAwareTargetConfigurator
|
import org.jetbrains.kotlin.gradle.plugin.mpp.pm20.KpmAwareTargetConfigurator
|
||||||
import org.jetbrains.kotlin.gradle.targets.metadata.KotlinMetadataTargetConfigurator
|
|
||||||
import org.jetbrains.kotlin.gradle.targets.metadata.isKotlinGranularMetadataEnabled
|
import org.jetbrains.kotlin.gradle.targets.metadata.isKotlinGranularMetadataEnabled
|
||||||
import org.jetbrains.kotlin.gradle.targets.native.*
|
import org.jetbrains.kotlin.gradle.targets.native.*
|
||||||
import org.jetbrains.kotlin.gradle.targets.native.internal.commonizeCInteropTask
|
import org.jetbrains.kotlin.gradle.targets.native.internal.commonizeCInteropTask
|
||||||
@@ -63,7 +62,6 @@ open class KotlinNativeTargetConfigurator<T : KotlinNativeTarget> : AbstractKotl
|
|||||||
it.group = BasePlugin.BUILD_GROUP
|
it.group = BasePlugin.BUILD_GROUP
|
||||||
it.description = "Links ${binary.outputKind.description} '${binary.name}' for a target '${target.name}'."
|
it.description = "Links ${binary.outputKind.description} '${binary.name}' for a target '${target.name}'."
|
||||||
it.enabled = binary.konanTarget.enabledOnCurrentHost
|
it.enabled = binary.konanTarget.enabledOnCurrentHost
|
||||||
it.destinationDir = binary.outputDirectory
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -220,7 +220,7 @@ open class KotlinCocoapodsPlugin : Plugin<Project> {
|
|||||||
check(targets.size == 1) { "The project has more than one target for the requested platform: `${requestedPlatform.visibleName}`" }
|
check(targets.size == 1) { "The project has more than one target for the requested platform: `${requestedPlatform.visibleName}`" }
|
||||||
|
|
||||||
val frameworkLinkTask = targets.single().binaries.getFramework(POD_FRAMEWORK_PREFIX, requestedBuildType).linkTaskProvider
|
val frameworkLinkTask = targets.single().binaries.getFramework(POD_FRAMEWORK_PREFIX, requestedBuildType).linkTaskProvider
|
||||||
project.createSyncFrameworkTask(frameworkLinkTask.map { it.destinationDir }, frameworkLinkTask)
|
project.createSyncFrameworkTask(frameworkLinkTask.flatMap { it.destinationDirectory.map { it.asFile }}, frameworkLinkTask)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun createSyncTask(
|
private fun createSyncTask(
|
||||||
|
|||||||
+57
-48
@@ -15,11 +15,13 @@ import org.gradle.api.artifacts.component.ModuleComponentSelector
|
|||||||
import org.gradle.api.artifacts.result.DependencyResult
|
import org.gradle.api.artifacts.result.DependencyResult
|
||||||
import org.gradle.api.artifacts.result.ResolvedDependencyResult
|
import org.gradle.api.artifacts.result.ResolvedDependencyResult
|
||||||
import org.gradle.api.file.ConfigurableFileCollection
|
import org.gradle.api.file.ConfigurableFileCollection
|
||||||
|
import org.gradle.api.file.DirectoryProperty
|
||||||
import org.gradle.api.file.FileCollection
|
import org.gradle.api.file.FileCollection
|
||||||
import org.gradle.api.file.FileTree
|
import org.gradle.api.file.FileTree
|
||||||
import org.gradle.api.provider.Provider
|
import org.gradle.api.provider.Provider
|
||||||
import org.gradle.api.tasks.*
|
import org.gradle.api.tasks.*
|
||||||
import org.gradle.api.tasks.compile.AbstractCompile
|
import org.jetbrains.kotlin.cli.common.arguments.CommonCompilerArguments
|
||||||
|
import org.jetbrains.kotlin.cli.common.arguments.CommonToolArguments
|
||||||
import org.jetbrains.kotlin.compilerRunner.*
|
import org.jetbrains.kotlin.compilerRunner.*
|
||||||
import org.jetbrains.kotlin.compilerRunner.KotlinNativeCInteropRunner.Companion.run
|
import org.jetbrains.kotlin.compilerRunner.KotlinNativeCInteropRunner.Companion.run
|
||||||
import org.jetbrains.kotlin.gradle.dsl.KotlinCommonOptions
|
import org.jetbrains.kotlin.gradle.dsl.KotlinCommonOptions
|
||||||
@@ -126,7 +128,11 @@ private fun Collection<File>.filterKlibsPassedToCompiler(): List<File> = filter
|
|||||||
}
|
}
|
||||||
|
|
||||||
// endregion
|
// endregion
|
||||||
abstract class AbstractKotlinNativeCompile<T : KotlinCommonToolOptions, K : KotlinNativeCompilationData<*>> : AbstractCompile() {
|
abstract class AbstractKotlinNativeCompile<
|
||||||
|
T : KotlinCommonToolOptions,
|
||||||
|
K : KotlinNativeCompilationData<*>,
|
||||||
|
M : CommonToolArguments
|
||||||
|
> : AbstractKotlinCompileTool<M>() {
|
||||||
@get:Internal
|
@get:Internal
|
||||||
abstract val compilation: K
|
abstract val compilation: K
|
||||||
|
|
||||||
@@ -151,15 +157,6 @@ abstract class AbstractKotlinNativeCompile<T : KotlinCommonToolOptions, K : Kotl
|
|||||||
compilation.konanTarget
|
compilation.konanTarget
|
||||||
}
|
}
|
||||||
|
|
||||||
// Inputs and outputs
|
|
||||||
@IgnoreEmptyDirectories
|
|
||||||
@InputFiles
|
|
||||||
@SkipWhenEmpty
|
|
||||||
@PathSensitive(PathSensitivity.RELATIVE)
|
|
||||||
override fun getSource(): FileTree {
|
|
||||||
return super.getSource()
|
|
||||||
}
|
|
||||||
|
|
||||||
@get:Classpath
|
@get:Classpath
|
||||||
val libraries: FileCollection by project.provider {
|
val libraries: FileCollection by project.provider {
|
||||||
// Avoid resolving these dependencies during task graph construction when we can't build the target:
|
// Avoid resolving these dependencies during task graph construction when we can't build the target:
|
||||||
@@ -174,10 +171,8 @@ abstract class AbstractKotlinNativeCompile<T : KotlinCommonToolOptions, K : Kotl
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated("For native tasks use 'libraries' instead", ReplaceWith("libraries"))
|
@Deprecated("For native tasks use 'libraries' instead", ReplaceWith("libraries"))
|
||||||
override fun getClasspath(): FileCollection = libraries
|
override val classpath: ConfigurableFileCollection
|
||||||
override fun setClasspath(configuration: FileCollection?) {
|
get() = objects.fileCollection().from(libraries)
|
||||||
throw UnsupportedOperationException("Setting classpath directly is unsupported.")
|
|
||||||
}
|
|
||||||
|
|
||||||
@get:Input
|
@get:Input
|
||||||
val target: String by project.provider { compilation.konanTarget.name }
|
val target: String by project.provider { compilation.konanTarget.name }
|
||||||
@@ -212,22 +207,23 @@ abstract class AbstractKotlinNativeCompile<T : KotlinCommonToolOptions, K : Kotl
|
|||||||
internal val useEmbeddableCompilerJar: Boolean
|
internal val useEmbeddableCompilerJar: Boolean
|
||||||
get() = project.nativeUseEmbeddableCompilerJar
|
get() = project.nativeUseEmbeddableCompilerJar
|
||||||
|
|
||||||
@Internal
|
@get:Internal
|
||||||
open val outputFile: Provider<File> = project.provider {
|
open val outputFile: Provider<File>
|
||||||
val prefix = outputKind.prefix(konanTarget)
|
get() = destinationDirectory.map {
|
||||||
val suffix = outputKind.suffix(konanTarget)
|
val prefix = outputKind.prefix(konanTarget)
|
||||||
val filename = "$prefix${baseName}$suffix".let {
|
val suffix = outputKind.suffix(konanTarget)
|
||||||
when {
|
val filename = "$prefix${baseName}$suffix".let {
|
||||||
outputKind == FRAMEWORK ->
|
when {
|
||||||
it.asValidFrameworkName()
|
outputKind == FRAMEWORK ->
|
||||||
outputKind in listOf(STATIC, DYNAMIC) || outputKind == PROGRAM && konanTarget == KonanTarget.WASM32 ->
|
it.asValidFrameworkName()
|
||||||
it.replace('-', '_')
|
outputKind in listOf(STATIC, DYNAMIC) || outputKind == PROGRAM && konanTarget == KonanTarget.WASM32 ->
|
||||||
else -> it
|
it.replace('-', '_')
|
||||||
|
else -> it
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
destinationDir.resolve(filename)
|
it.file(filename).asFile
|
||||||
}
|
}
|
||||||
|
|
||||||
// endregion
|
// endregion
|
||||||
@Internal
|
@Internal
|
||||||
@@ -250,12 +246,12 @@ abstract class AbstractKotlinNativeCompile<T : KotlinCommonToolOptions, K : Kotl
|
|||||||
|
|
||||||
// Used by IDE via reflection.
|
// Used by IDE via reflection.
|
||||||
@get:Internal
|
@get:Internal
|
||||||
val serializedCompilerArguments: List<String>
|
override val serializedCompilerArguments: List<String>
|
||||||
get() = buildCommonArgs()
|
get() = buildCommonArgs()
|
||||||
|
|
||||||
// Used by IDE via reflection.
|
// Used by IDE via reflection.
|
||||||
@get:Internal
|
@get:Internal
|
||||||
val defaultSerializedCompilerArguments: List<String>
|
override val defaultSerializedCompilerArguments: List<String>
|
||||||
get() = buildCommonArgs(true)
|
get() = buildCommonArgs(true)
|
||||||
|
|
||||||
private val languageSettingsBuilder by project.provider {
|
private val languageSettingsBuilder by project.provider {
|
||||||
@@ -301,17 +297,20 @@ abstract class AbstractKotlinNativeCompile<T : KotlinCommonToolOptions, K : Kotl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Remove it once actual K2NativeCompilerArguments will be available without 'kotlin.native.enabled = true' flag
|
||||||
|
class StubK2NativeCompilerArguments : CommonCompilerArguments()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A task producing a klibrary from a compilation.
|
* A task producing a klibrary from a compilation.
|
||||||
*/
|
*/
|
||||||
@CacheableTask
|
@CacheableTask
|
||||||
open class KotlinNativeCompile
|
abstract class KotlinNativeCompile
|
||||||
@Inject
|
@Inject
|
||||||
constructor(
|
constructor(
|
||||||
@Internal
|
@Internal
|
||||||
@Transient // can't be serialized for Gradle configuration cache
|
@Transient // can't be serialized for Gradle configuration cache
|
||||||
final override val compilation: KotlinNativeCompilationData<*>
|
final override val compilation: KotlinNativeCompilationData<*>
|
||||||
) : AbstractKotlinNativeCompile<KotlinCommonOptions, KotlinNativeCompilationData<*>>(),
|
) : AbstractKotlinNativeCompile<KotlinCommonOptions, KotlinNativeCompilationData<*>, StubK2NativeCompilerArguments>(),
|
||||||
KotlinCompile<KotlinCommonOptions> {
|
KotlinCompile<KotlinCommonOptions> {
|
||||||
|
|
||||||
@get:Input
|
@get:Input
|
||||||
@@ -395,6 +394,14 @@ constructor(
|
|||||||
}
|
}
|
||||||
// endregion.
|
// endregion.
|
||||||
|
|
||||||
|
override fun createCompilerArgs(): StubK2NativeCompilerArguments = StubK2NativeCompilerArguments()
|
||||||
|
|
||||||
|
override fun setupCompilerArgs(
|
||||||
|
args: StubK2NativeCompilerArguments,
|
||||||
|
defaultsOnly: Boolean,
|
||||||
|
ignoreClasspathResolutionErrors: Boolean
|
||||||
|
) = Unit
|
||||||
|
|
||||||
@TaskAction
|
@TaskAction
|
||||||
fun compile() {
|
fun compile() {
|
||||||
val output = outputFile.get()
|
val output = outputFile.get()
|
||||||
@@ -440,7 +447,7 @@ constructor(
|
|||||||
shortModuleName,
|
shortModuleName,
|
||||||
friendModule,
|
friendModule,
|
||||||
sharedCompilationData,
|
sharedCompilationData,
|
||||||
source,
|
sources.asFileTree,
|
||||||
commonSourcesTree
|
commonSourcesTree
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -452,12 +459,12 @@ constructor(
|
|||||||
* A task producing a final binary from a compilation.
|
* A task producing a final binary from a compilation.
|
||||||
*/
|
*/
|
||||||
@CacheableTask
|
@CacheableTask
|
||||||
open class KotlinNativeLink
|
abstract class KotlinNativeLink
|
||||||
@Inject
|
@Inject
|
||||||
constructor(
|
constructor(
|
||||||
@Internal
|
@Internal
|
||||||
val binary: NativeBinary
|
val binary: NativeBinary
|
||||||
) : AbstractKotlinNativeCompile<KotlinCommonToolOptions, KotlinNativeCompilation>() {
|
) : AbstractKotlinNativeCompile<KotlinCommonToolOptions, KotlinNativeCompilation, StubK2NativeCompilerArguments>() {
|
||||||
@get:Internal
|
@get:Internal
|
||||||
final override val compilation: KotlinNativeCompilation
|
final override val compilation: KotlinNativeCompilation
|
||||||
get() = binary.compilation
|
get() = binary.compilation
|
||||||
@@ -472,19 +479,13 @@ constructor(
|
|||||||
@Internal // Taken into account by getSources().
|
@Internal // Taken into account by getSources().
|
||||||
val intermediateLibrary: Provider<File> = project.provider { compilation.compileKotlinTask.outputFile.get() }
|
val intermediateLibrary: Provider<File> = project.provider { compilation.compileKotlinTask.outputFile.get() }
|
||||||
|
|
||||||
@IgnoreEmptyDirectories
|
override val sources: ConfigurableFileCollection = objects
|
||||||
@InputFiles
|
.fileCollection()
|
||||||
@SkipWhenEmpty
|
.from(intermediateLibrary)
|
||||||
override fun getSource(): FileTree =
|
.apply { disallowChanges() }
|
||||||
objects.fileCollection().from(intermediateLibrary).asFileTree
|
|
||||||
|
|
||||||
@OutputDirectory
|
override val destinationDirectory: DirectoryProperty = objects.directoryProperty().apply {
|
||||||
override fun getDestinationDir(): File {
|
set(binary.outputDirectory)
|
||||||
return binary.outputDirectory
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun setDestinationDir(destinationDir: File) {
|
|
||||||
binary.outputDirectory = destinationDir
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override val outputKind: CompilerOutputKind
|
override val outputKind: CompilerOutputKind
|
||||||
@@ -572,6 +573,14 @@ constructor(
|
|||||||
project.configurations.getByName(compilation.apiConfigurationName).files.filterKlibsPassedToCompiler()
|
project.configurations.getByName(compilation.apiConfigurationName).files.filterKlibsPassedToCompiler()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun createCompilerArgs(): StubK2NativeCompilerArguments = StubK2NativeCompilerArguments()
|
||||||
|
|
||||||
|
override fun setupCompilerArgs(
|
||||||
|
args: StubK2NativeCompilerArguments,
|
||||||
|
defaultsOnly: Boolean,
|
||||||
|
ignoreClasspathResolutionErrors: Boolean
|
||||||
|
) = Unit
|
||||||
|
|
||||||
private fun validatedExportedLibraries() {
|
private fun validatedExportedLibraries() {
|
||||||
val exportConfiguration = exportLibraries as? Configuration ?: return
|
val exportConfiguration = exportLibraries as? Configuration ?: return
|
||||||
val apiFiles = apiFilesProvider.get()
|
val apiFiles = apiFilesProvider.get()
|
||||||
|
|||||||
+2
-2
@@ -102,7 +102,7 @@ abstract class KotlinCompileCommon @Inject constructor(
|
|||||||
K2MetadataCompilerArguments()
|
K2MetadataCompilerArguments()
|
||||||
|
|
||||||
override fun getSourceRoots(): SourceRoots =
|
override fun getSourceRoots(): SourceRoots =
|
||||||
SourceRoots.KotlinOnly.create(getSource(), sourceFilesExtensions.get())
|
SourceRoots.KotlinOnly.create(sources, sourceFilesExtensions.get())
|
||||||
|
|
||||||
override fun setupCompilerArgs(args: K2MetadataCompilerArguments, defaultsOnly: Boolean, ignoreClasspathResolutionErrors: Boolean) {
|
override fun setupCompilerArgs(args: K2MetadataCompilerArguments, defaultsOnly: Boolean, ignoreClasspathResolutionErrors: Boolean) {
|
||||||
args.apply { fillDefaultValues() }
|
args.apply { fillDefaultValues() }
|
||||||
@@ -120,7 +120,7 @@ abstract class KotlinCompileCommon @Inject constructor(
|
|||||||
|
|
||||||
with(args) {
|
with(args) {
|
||||||
classpath = classpathList.joinToString(File.pathSeparator)
|
classpath = classpathList.joinToString(File.pathSeparator)
|
||||||
destination = destinationDir.canonicalPath
|
destination = destinationDirectory.get().asFile.canonicalPath
|
||||||
|
|
||||||
friendPaths = this@KotlinCompileCommon.friendPaths.files.map { it.absolutePath }.toTypedArray()
|
friendPaths = this@KotlinCompileCommon.friendPaths.files.map { it.absolutePath }.toTypedArray()
|
||||||
refinesPaths = refinesMetadataPaths.map { it.absolutePath }.toTypedArray()
|
refinesPaths = refinesMetadataPaths.map { it.absolutePath }.toTypedArray()
|
||||||
|
|||||||
+4
-13
@@ -16,14 +16,11 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.gradle.tasks
|
package org.jetbrains.kotlin.gradle.tasks
|
||||||
|
|
||||||
import org.gradle.api.file.FileCollection
|
|
||||||
import org.gradle.api.file.FileTree
|
|
||||||
import org.gradle.api.tasks.CacheableTask
|
import org.gradle.api.tasks.CacheableTask
|
||||||
import org.gradle.api.tasks.Input
|
import org.gradle.api.tasks.Input
|
||||||
import org.gradle.api.tasks.Internal
|
import org.gradle.api.tasks.Internal
|
||||||
import org.gradle.api.tasks.TaskAction
|
import org.gradle.api.tasks.TaskAction
|
||||||
import org.gradle.work.ChangeType
|
import org.gradle.work.ChangeType
|
||||||
import org.gradle.work.Incremental
|
|
||||||
import org.gradle.work.InputChanges
|
import org.gradle.work.InputChanges
|
||||||
import org.jetbrains.kotlin.cli.common.arguments.DevModeOverwritingStrategies
|
import org.jetbrains.kotlin.cli.common.arguments.DevModeOverwritingStrategies
|
||||||
import org.jetbrains.kotlin.cli.common.arguments.K2JSDceArguments
|
import org.jetbrains.kotlin.cli.common.arguments.K2JSDceArguments
|
||||||
@@ -73,11 +70,6 @@ abstract class KotlinJsDce : AbstractKotlinCompileTool<K2JSDceArguments>(), Kotl
|
|||||||
@Input
|
@Input
|
||||||
var jvmArgs = mutableListOf<String>()
|
var jvmArgs = mutableListOf<String>()
|
||||||
|
|
||||||
@Incremental
|
|
||||||
override fun getClasspath(): FileCollection {
|
|
||||||
return super.getClasspath()
|
|
||||||
}
|
|
||||||
|
|
||||||
private val buildDir by lazy {
|
private val buildDir by lazy {
|
||||||
project.buildDir
|
project.buildDir
|
||||||
}
|
}
|
||||||
@@ -101,13 +93,12 @@ abstract class KotlinJsDce : AbstractKotlinCompileTool<K2JSDceArguments>(), Kotl
|
|||||||
.filter { it.changeType == ChangeType.MODIFIED || it.changeType == ChangeType.ADDED }
|
.filter { it.changeType == ChangeType.MODIFIED || it.changeType == ChangeType.ADDED }
|
||||||
.map { it.file }
|
.map { it.file }
|
||||||
} else {
|
} else {
|
||||||
classpath
|
classpath.asFileTree.files
|
||||||
}
|
}
|
||||||
val inputFiles = (listOf(source) + classpathFiles
|
// TODO: use PatternFilterable here!
|
||||||
|
val inputFiles = sources.asFileTree.files.plus(classpathFiles)
|
||||||
.filter { !kotlinFilesOnly || isDceCandidate(it) }
|
.filter { !kotlinFilesOnly || isDceCandidate(it) }
|
||||||
.map { objects.fileCollection().from(it).asFileTree })
|
.map { it.path }
|
||||||
.reduce(FileTree::plus)
|
|
||||||
.files.map { it.path }
|
|
||||||
|
|
||||||
val outputDirArgs = arrayOf("-output-dir", destinationDirectory.get().asFile.path)
|
val outputDirArgs = arrayOf("-output-dir", destinationDirectory.get().asFile.path)
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -30,7 +30,7 @@ internal sealed class SourceRoots(val kotlinSourceFiles: FileCollection) {
|
|||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun create(
|
fun create(
|
||||||
taskSource: FileTree,
|
taskSource: FileCollection,
|
||||||
sourceRoots: FilteringSourceRootsContainer,
|
sourceRoots: FilteringSourceRootsContainer,
|
||||||
sourceFilesExtensions: List<String>
|
sourceFilesExtensions: List<String>
|
||||||
): ForJvm {
|
): ForJvm {
|
||||||
@@ -58,7 +58,7 @@ internal sealed class SourceRoots(val kotlinSourceFiles: FileCollection) {
|
|||||||
class KotlinOnly(kotlinSourceFiles: FileCollection) : SourceRoots(kotlinSourceFiles) {
|
class KotlinOnly(kotlinSourceFiles: FileCollection) : SourceRoots(kotlinSourceFiles) {
|
||||||
companion object {
|
companion object {
|
||||||
fun create(
|
fun create(
|
||||||
taskSource: FileTree,
|
taskSource: FileCollection,
|
||||||
sourceFilesExtensions: List<String>
|
sourceFilesExtensions: List<String>
|
||||||
) = KotlinOnly(
|
) = KotlinOnly(
|
||||||
taskSource.filter { it.isKotlinFile(sourceFilesExtensions) }
|
taskSource.filter { it.isKotlinFile(sourceFilesExtensions) }
|
||||||
|
|||||||
+40
-27
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.gradle.tasks
|
package org.jetbrains.kotlin.gradle.tasks
|
||||||
|
|
||||||
|
import org.gradle.api.DefaultTask
|
||||||
import org.gradle.api.GradleException
|
import org.gradle.api.GradleException
|
||||||
import org.gradle.api.Project
|
import org.gradle.api.Project
|
||||||
import org.gradle.api.Task
|
import org.gradle.api.Task
|
||||||
@@ -13,7 +14,6 @@ import org.gradle.api.file.*
|
|||||||
import org.gradle.api.invocation.Gradle
|
import org.gradle.api.invocation.Gradle
|
||||||
import org.gradle.api.logging.Logger
|
import org.gradle.api.logging.Logger
|
||||||
import org.gradle.api.model.ObjectFactory
|
import org.gradle.api.model.ObjectFactory
|
||||||
import org.gradle.api.model.ReplacedBy
|
|
||||||
import org.gradle.api.provider.ListProperty
|
import org.gradle.api.provider.ListProperty
|
||||||
import org.gradle.api.provider.Property
|
import org.gradle.api.provider.Property
|
||||||
import org.gradle.api.provider.Provider
|
import org.gradle.api.provider.Provider
|
||||||
@@ -22,6 +22,7 @@ import org.gradle.api.services.BuildServiceParameters
|
|||||||
import org.gradle.api.tasks.*
|
import org.gradle.api.tasks.*
|
||||||
import org.gradle.api.tasks.compile.AbstractCompile
|
import org.gradle.api.tasks.compile.AbstractCompile
|
||||||
import org.gradle.api.tasks.compile.JavaCompile
|
import org.gradle.api.tasks.compile.JavaCompile
|
||||||
|
import org.gradle.api.tasks.util.PatternFilterable
|
||||||
import org.gradle.work.ChangeType
|
import org.gradle.work.ChangeType
|
||||||
import org.gradle.work.Incremental
|
import org.gradle.work.Incremental
|
||||||
import org.gradle.work.InputChanges
|
import org.gradle.work.InputChanges
|
||||||
@@ -77,26 +78,40 @@ const val USING_JS_INCREMENTAL_COMPILATION_MESSAGE = "Using Kotlin/JS incrementa
|
|||||||
const val USING_JS_IR_BACKEND_MESSAGE = "Using Kotlin/JS IR backend"
|
const val USING_JS_IR_BACKEND_MESSAGE = "Using Kotlin/JS IR backend"
|
||||||
|
|
||||||
abstract class AbstractKotlinCompileTool<T : CommonToolArguments>
|
abstract class AbstractKotlinCompileTool<T : CommonToolArguments>
|
||||||
: AbstractCompile(),
|
: DefaultTask(),
|
||||||
|
//PatternFilterable,
|
||||||
CompilerArgumentAwareWithInput<T>,
|
CompilerArgumentAwareWithInput<T>,
|
||||||
TaskWithLocalState {
|
TaskWithLocalState {
|
||||||
|
|
||||||
@ReplacedBy("stableSources")
|
|
||||||
override fun getSource() = super.getSource()
|
|
||||||
|
|
||||||
@get:InputFiles
|
@get:InputFiles
|
||||||
@get:SkipWhenEmpty
|
@get:SkipWhenEmpty
|
||||||
@get:IgnoreEmptyDirectories
|
@get:IgnoreEmptyDirectories
|
||||||
@get:PathSensitive(PathSensitivity.RELATIVE)
|
@get:PathSensitive(PathSensitivity.RELATIVE)
|
||||||
internal val stableSources: FileCollection = project.files(
|
abstract val sources: ConfigurableFileCollection
|
||||||
{ source }
|
|
||||||
)
|
|
||||||
|
|
||||||
@Incremental
|
/**
|
||||||
override fun getClasspath(): FileCollection {
|
* Sets the source for this task.
|
||||||
return super.getClasspath()
|
* The given source object is evaluated as per [org.gradle.api.Project.files].
|
||||||
|
*/
|
||||||
|
open fun setSource(source: Any) {
|
||||||
|
sources.from(source)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the source for this task.
|
||||||
|
* The given source object is evaluated as per [org.gradle.api.Project.files].
|
||||||
|
*/
|
||||||
|
open fun setSource(vararg source: Any) {
|
||||||
|
sources.from(source)
|
||||||
|
}
|
||||||
|
|
||||||
|
@get:Classpath
|
||||||
|
@get:Incremental
|
||||||
|
abstract val classpath: ConfigurableFileCollection
|
||||||
|
|
||||||
|
@get:OutputDirectory
|
||||||
|
abstract val destinationDirectory: DirectoryProperty
|
||||||
|
|
||||||
@get:Internal
|
@get:Internal
|
||||||
override val metrics: Property<BuildMetricsReporter> = project.objects
|
override val metrics: Property<BuildMetricsReporter> = project.objects
|
||||||
.property(BuildMetricsReporterImpl())
|
.property(BuildMetricsReporterImpl())
|
||||||
@@ -403,7 +418,7 @@ abstract class AbstractKotlinCompile<T : CommonCompilerArguments> : AbstractKotl
|
|||||||
@get:Internal
|
@get:Internal
|
||||||
protected open val incrementalProps: List<FileCollection>
|
protected open val incrementalProps: List<FileCollection>
|
||||||
get() = listOfNotNull(
|
get() = listOfNotNull(
|
||||||
stableSources,
|
sources,
|
||||||
classpath,
|
classpath,
|
||||||
commonSourceSet
|
commonSourceSet
|
||||||
)
|
)
|
||||||
@@ -508,7 +523,7 @@ class KotlinJvmCompilerArgumentsProvider
|
|||||||
val moduleName: String = taskProvider.moduleName.get()
|
val moduleName: String = taskProvider.moduleName.get()
|
||||||
val friendPaths: FileCollection = taskProvider.friendPaths
|
val friendPaths: FileCollection = taskProvider.friendPaths
|
||||||
val compileClasspath: Iterable<File> = taskProvider.classpath
|
val compileClasspath: Iterable<File> = taskProvider.classpath
|
||||||
val destinationDir: File = taskProvider.destinationDir
|
val destinationDir: File = taskProvider.destinationDirectory.get().asFile
|
||||||
internal val kotlinOptions: List<KotlinJvmOptionsImpl> = listOfNotNull(
|
internal val kotlinOptions: List<KotlinJvmOptionsImpl> = listOfNotNull(
|
||||||
taskProvider.parentKotlinOptionsImpl.orNull as? KotlinJvmOptionsImpl,
|
taskProvider.parentKotlinOptionsImpl.orNull as? KotlinJvmOptionsImpl,
|
||||||
taskProvider.kotlinOptions as KotlinJvmOptionsImpl
|
taskProvider.kotlinOptions as KotlinJvmOptionsImpl
|
||||||
@@ -628,7 +643,7 @@ abstract class KotlinCompile @Inject constructor(
|
|||||||
|
|
||||||
private val jvmSourceRoots by project.provider {
|
private val jvmSourceRoots by project.provider {
|
||||||
// serialize in the task state for configuration caching; avoid building anew in task execution, as it may access the project model
|
// serialize in the task state for configuration caching; avoid building anew in task execution, as it may access the project model
|
||||||
SourceRoots.ForJvm.create(source, sourceRootsContainer, sourceFilesExtensions.get())
|
SourceRoots.ForJvm.create(sources, sourceRootsContainer, sourceFilesExtensions.get())
|
||||||
}
|
}
|
||||||
|
|
||||||
/** A package prefix that is used for locating Java sources in a directory structure with non-full-depth packages.
|
/** A package prefix that is used for locating Java sources in a directory structure with non-full-depth packages.
|
||||||
@@ -646,10 +661,8 @@ abstract class KotlinCompile @Inject constructor(
|
|||||||
logger.kotlinDebug { "Set $this.usePreciseJavaTracking=$value" }
|
logger.kotlinDebug { "Set $this.usePreciseJavaTracking=$value" }
|
||||||
}
|
}
|
||||||
|
|
||||||
@Internal // To support compile avoidance (ClasspathSnapshotProperties.classpathSnapshot will be used as input instead)
|
@get:Internal // To support compile avoidance (ClasspathSnapshotProperties.classpathSnapshot will be used as input instead)
|
||||||
override fun getClasspath(): FileCollection {
|
override abstract val classpath: ConfigurableFileCollection
|
||||||
return super.getClasspath()
|
|
||||||
}
|
|
||||||
|
|
||||||
@get:Input
|
@get:Input
|
||||||
abstract val useKotlinAbiSnapshot: Property<Boolean>
|
abstract val useKotlinAbiSnapshot: Property<Boolean>
|
||||||
@@ -678,7 +691,7 @@ abstract class KotlinCompile @Inject constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override val incrementalProps: List<FileCollection>
|
override val incrementalProps: List<FileCollection>
|
||||||
get() = listOf(stableSources, commonSourceSet, classpathSnapshotProperties.classpath, classpathSnapshotProperties.classpathSnapshot)
|
get() = listOf(sources, commonSourceSet, classpathSnapshotProperties.classpath, classpathSnapshotProperties.classpathSnapshot)
|
||||||
|
|
||||||
// Exclude classpathSnapshotDir from TaskOutputsBackup (see TaskOutputsBackup's kdoc for more info). */
|
// Exclude classpathSnapshotDir from TaskOutputsBackup (see TaskOutputsBackup's kdoc for more info). */
|
||||||
override val taskOutputsBackupExcludes: List<File>
|
override val taskOutputsBackupExcludes: List<File>
|
||||||
@@ -859,15 +872,15 @@ abstract class KotlinCompile @Inject constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// override setSource to track source directory sets and files (for generated android folders)
|
// override setSource to track source directory sets and files (for generated android folders)
|
||||||
override fun setSource(sources: Any) {
|
override fun setSource(source: Any) {
|
||||||
sourceRootsContainer.set(sources)
|
sourceRootsContainer.set(source)
|
||||||
super.setSource(sources)
|
super.setSource(source)
|
||||||
}
|
}
|
||||||
|
|
||||||
// override source to track source directory sets and files (for generated android folders)
|
// override source to track source directory sets and files (for generated android folders)
|
||||||
override fun source(vararg sources: Any): SourceTask {
|
override fun setSource(vararg source: Any) {
|
||||||
sourceRootsContainer.add(*sources)
|
sourceRootsContainer.add(*source)
|
||||||
return super.source(*sources)
|
super.setSource(*source)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getClasspathChanges(inputChanges: InputChanges): ClasspathChanges = when {
|
private fun getClasspathChanges(inputChanges: InputChanges): ClasspathChanges = when {
|
||||||
@@ -1018,7 +1031,7 @@ abstract class Kotlin2JsCompile @Inject constructor(
|
|||||||
(kotlinOptions as KotlinJsOptionsImpl).updateArguments(args)
|
(kotlinOptions as KotlinJsOptionsImpl).updateArguments(args)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getSourceRoots() = SourceRoots.KotlinOnly.create(getSource(), sourceFilesExtensions.get())
|
override fun getSourceRoots() = SourceRoots.KotlinOnly.create(sources, sourceFilesExtensions.get())
|
||||||
|
|
||||||
@get:InputFiles
|
@get:InputFiles
|
||||||
@get:IgnoreEmptyDirectories
|
@get:IgnoreEmptyDirectories
|
||||||
@@ -1115,7 +1128,7 @@ abstract class Kotlin2JsCompile @Inject constructor(
|
|||||||
sourceRoots as SourceRoots.KotlinOnly
|
sourceRoots as SourceRoots.KotlinOnly
|
||||||
|
|
||||||
logger.debug("Calling compiler")
|
logger.debug("Calling compiler")
|
||||||
destinationDir.mkdirs()
|
//destinationDir.mkdirs()
|
||||||
|
|
||||||
if (kotlinOptions.isIrBackendEnabled()) {
|
if (kotlinOptions.isIrBackendEnabled()) {
|
||||||
logger.info(USING_JS_IR_BACKEND_MESSAGE)
|
logger.info(USING_JS_IR_BACKEND_MESSAGE)
|
||||||
|
|||||||
Reference in New Issue
Block a user