Revert "Drop tasks inheritance from 'AbstractCompile' and 'SourceTask'"
This reverts commit e9498c8978.
This commit is contained in:
@@ -106,6 +106,8 @@ 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.destinationDirectory })
|
from(compileTestDevelopmentExecutableKotlinJs.map { it.destinationDir })
|
||||||
|
|
||||||
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.destinationDirectory
|
from compileKotlin2Js.destinationDir
|
||||||
|
|
||||||
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.destinationDirectory")
|
it.replace("from buildDir", "from compileKotlin2Js.destinationDir")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-13
@@ -5,7 +5,6 @@
|
|||||||
|
|
||||||
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
|
||||||
@@ -128,23 +127,14 @@ class ConfigurationAvoidanceIT : KGPBaseTest() {
|
|||||||
@DisplayName("JS early configuration resolution")
|
@DisplayName("JS early configuration resolution")
|
||||||
@GradleTest
|
@GradleTest
|
||||||
fun testEarlyConfigurationsResolutionKotlinJs(gradleVersion: GradleVersion) {
|
fun testEarlyConfigurationsResolutionKotlinJs(gradleVersion: GradleVersion) {
|
||||||
testEarlyConfigurationsResolution(
|
testEarlyConfigurationsResolution("kotlin-js-browser-project", gradleVersion, kts = true)
|
||||||
"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
|
||||||
buildOptions: BuildOptions = defaultBuildOptions
|
) = project(projectName, gradleVersion) {
|
||||||
) = project(projectName, gradleVersion, buildOptions = buildOptions) {
|
|
||||||
(if (kts) buildGradleKts else buildGradle).appendText(
|
(if (kts) buildGradleKts else buildGradle).appendText(
|
||||||
//language=Gradle
|
//language=Gradle
|
||||||
"""${'\n'}
|
"""${'\n'}
|
||||||
|
|||||||
+7
-2
@@ -9,7 +9,10 @@ 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.*
|
import kotlin.io.path.createDirectories
|
||||||
|
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")
|
||||||
@@ -63,7 +66,9 @@ open class IncrementalJavaChangeDefaultIT : IncrementalCompilationJavaChangesBas
|
|||||||
}
|
}
|
||||||
build("compileKotlin", "--rerun-tasks") {
|
build("compileKotlin", "--rerun-tasks") {
|
||||||
assertTasksExecuted(":compileKotlin")
|
assertTasksExecuted(":compileKotlin")
|
||||||
assertTrue(kotlinClassesDir().notExists())
|
val compiledKotlinClasses = kotlinClassesDir().allFilesWithExtension("class").toList()
|
||||||
|
|
||||||
|
assertTrue(compiledKotlinClasses.isEmpty())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-4
@@ -94,7 +94,8 @@ 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
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -317,12 +318,13 @@ 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 = "org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompileTool<*>"
|
val taskClass = if (isNative) "org.jetbrains.kotlin.gradle.tasks.AbstractKotlinNativeCompile<*, *>" else "AbstractCompile"
|
||||||
val expression = """(tasks.getByName("$taskName") as $taskClass).libraries.toList()"""
|
val expression = """(tasks.getByName("$taskName") as $taskClass).${if (isNative) "libraries" else "classpath"}.toList()"""
|
||||||
checkPrintedItems(subproject, expression, checkModulesInClasspath, checkModulesNotInClasspath)
|
checkPrintedItems(subproject, expression, checkModulesInClasspath, checkModulesNotInClasspath)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-8
@@ -1176,14 +1176,7 @@ 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(
|
project("cleanTask", gradleVersion) {
|
||||||
"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")
|
||||||
|
|||||||
+2
-5
@@ -551,15 +551,12 @@ 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 (isBuildGradleKts) {
|
val taskClass = if (isNative) "org.jetbrains.kotlin.gradle.tasks.AbstractKotlinNativeCompile<*, *>" else "AbstractCompile"
|
||||||
"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)
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-9
@@ -5,9 +5,11 @@
|
|||||||
|
|
||||||
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
|
||||||
|
|
||||||
|
|
||||||
@@ -17,14 +19,7 @@ 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(
|
project("cleanTask", gradleVersion) {
|
||||||
"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.destinationDirectory)
|
test.testClassesDirs = files(project.tasks.compileTestKotlin.destinationDir)
|
||||||
|
|
||||||
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.destinationDirectory = file("fooCustomNameForiosSimLib")
|
linkTask.destinationDir = 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.destinationDirectory = file("customNameForLinuxLib")
|
linkTask.destinationDir = 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.destinationDirectory = file("customNameForMacosLib")
|
linkTask.destinationDir = 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.destinationDirectory = file("fooDummyiOS")
|
linkTask.destinationDir = file("fooDummyiOS")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-1
@@ -8,8 +8,12 @@ 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.*
|
||||||
@@ -289,7 +293,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.destinationDirectory.get().asFile] = module
|
dirToModule[task.destinationDir] = 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,6 +35,7 @@ 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
|
||||||
@@ -62,7 +63,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.from(kotlinCompileTask.classpath)
|
task.classpath = task.project.files(Callable { kotlinCompileTask.classpath })
|
||||||
task.kotlinTaskPluginClasspath.from(
|
task.kotlinTaskPluginClasspath.from(
|
||||||
providerFactory.provider { kotlinCompileTask.pluginClasspath }
|
providerFactory.provider { kotlinCompileTask.pluginClasspath }
|
||||||
)
|
)
|
||||||
@@ -118,17 +119,16 @@ abstract class KaptGenerateStubsTask @Inject constructor(
|
|||||||
@get:Incremental
|
@get:Incremental
|
||||||
abstract val additionalSources: ConfigurableFileCollection
|
abstract val additionalSources: ConfigurableFileCollection
|
||||||
|
|
||||||
override fun setSource(vararg source: Any) {
|
override fun source(vararg sources: Any): SourceTask {
|
||||||
super.setSource(sourceRootsContainer.add(sources))
|
return super.source(sourceRootsContainer.add(sources))
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun setSource(source: Any) {
|
override fun setSource(sources: 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 =
|
||||||
!destinationDirectory.get().asFile.isParentOf(source) &&
|
!destinationDir.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.destinationDirectory.get().asFile
|
args.destinationAsFile = this.destinationDir
|
||||||
}
|
}
|
||||||
|
|
||||||
@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,
|
||||||
destinationDirectory.get().asFile,
|
destinationDir,
|
||||||
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,
|
||||||
destinationDirectory.get().asFile,
|
destinationDir,
|
||||||
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.setSource(commonSources)
|
platformTask.source(commonSources)
|
||||||
platformTask.commonSourceSet.from(commonSources)
|
platformTask.commonSourceSet.from(commonSources)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-3
@@ -36,6 +36,7 @@ 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.*
|
||||||
@@ -64,7 +65,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 : AbstractKotlinCompileTool<*>>(
|
abstract class KotlinCompilationProcessor<out T : SourceTask>(
|
||||||
open val kotlinCompilation: KotlinCompilationData<*>
|
open val kotlinCompilation: KotlinCompilationData<*>
|
||||||
) {
|
) {
|
||||||
abstract val kotlinTask: TaskProvider<out T>
|
abstract val kotlinTask: TaskProvider<out T>
|
||||||
@@ -122,7 +123,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.from({ kotlinCompilation.compileDependencyFiles })
|
it.classpath = project.files({ kotlinCompilation.compileDependencyFiles })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1048,7 +1049,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.setSource(sources.dir)
|
it.source(sources.dir)
|
||||||
it.dependsOn(sources)
|
it.dependsOn(sources)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-12
@@ -2,6 +2,7 @@ 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
|
||||||
@@ -12,7 +13,6 @@ 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,20 +89,13 @@ class SubpluginEnvironment(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal fun addCompilationSourcesToExternalCompileTask(
|
internal fun addCompilationSourcesToExternalCompileTask(compilation: KotlinCompilation<*>, task: TaskProvider<out AbstractCompile>) {
|
||||||
compilation: KotlinCompilation<*>,
|
|
||||||
task: TaskProvider<out AbstractKotlinCompileTool<*>>
|
|
||||||
) {
|
|
||||||
if (compilation is KotlinJvmAndroidCompilation) {
|
if (compilation is KotlinJvmAndroidCompilation) {
|
||||||
compilation.androidVariant.forEachKotlinSourceSet { sourceSet ->
|
compilation.androidVariant.forEachKotlinSourceSet { sourceSet -> task.configure { it.source(sourceSet.kotlin) } }
|
||||||
task.configure { it.setSource(sourceSet.kotlin) }
|
compilation.androidVariant.forEachJavaSourceDir { sources -> task.configure { it.source(sources.dir) } }
|
||||||
}
|
|
||||||
compilation.androidVariant.forEachJavaSourceDir { sources ->
|
|
||||||
task.configure { it.setSource(sources.dir) }
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
task.configure { taskInstance ->
|
task.configure { taskInstance ->
|
||||||
compilation.allKotlinSourceSets.forEach { sourceSet -> taskInstance.setSource(sourceSet.kotlin) }
|
compilation.allKotlinSourceSets.forEach { sourceSet -> taskInstance.source(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.
|
||||||
setSource(Callable(sources))
|
source(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
|
||||||
|
|||||||
+2
-1
@@ -7,6 +7,7 @@ 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
|
||||||
@@ -56,7 +57,7 @@ open class KotlinCompilationTaskConfigurator(
|
|||||||
val commonSources = getCommonSourcesForFragmentCompilation(fragment)
|
val commonSources = getCommonSourcesForFragmentCompilation(fragment)
|
||||||
|
|
||||||
compileTask.configure {
|
compileTask.configure {
|
||||||
it.setSource(allSources)
|
it.source(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")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-2
@@ -17,6 +17,7 @@ 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
|
||||||
@@ -48,7 +49,7 @@ class Android25ProjectHandler(
|
|||||||
) {
|
) {
|
||||||
val preJavaKotlinOutput = project.files(project.provider {
|
val preJavaKotlinOutput = project.files(project.provider {
|
||||||
mutableListOf<File>().apply {
|
mutableListOf<File>().apply {
|
||||||
add(kotlinTask.get().destinationDirectory.get().asFile)
|
add(kotlinTask.get().destinationDir)
|
||||||
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))
|
||||||
@@ -59,7 +60,7 @@ class Android25ProjectHandler(
|
|||||||
|
|
||||||
val preJavaClasspathKey = variantData.registerPreJavacGeneratedBytecode(preJavaKotlinOutput)
|
val preJavaClasspathKey = variantData.registerPreJavacGeneratedBytecode(preJavaKotlinOutput)
|
||||||
kotlinTask.configure { kotlinTaskInstance ->
|
kotlinTask.configure { kotlinTaskInstance ->
|
||||||
kotlinTaskInstance.classpath
|
kotlinTaskInstance.classpath = project.files()
|
||||||
.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.setSource(getLayoutDirectories(project, sourceSet.res.srcDirs))
|
it.source(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.from(configuration)
|
it.classpath = configuration
|
||||||
it.destinationDirectory.set(it.dceOptions.outputDirectory?.let { File(it) } ?: outputDir)
|
it.destinationDir = it.dceOptions.outputDirectory?.let { File(it) } ?: outputDir
|
||||||
it.setSource((kotlinTask.get() as Kotlin2JsCompile).outputFileProperty)
|
it.source((kotlinTask.get() as Kotlin2JsCompile).outputFileProperty.get())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+12
-18
@@ -7,9 +7,10 @@ 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.ProjectLayout
|
import org.gradle.api.file.FileTree
|
||||||
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
|
||||||
@@ -25,7 +26,6 @@ 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,9 +36,8 @@ import javax.inject.Inject
|
|||||||
|
|
||||||
@CacheableTask
|
@CacheableTask
|
||||||
abstract class KotlinJsIrLink @Inject constructor(
|
abstract class KotlinJsIrLink @Inject constructor(
|
||||||
private val objectFactory: ObjectFactory,
|
objectFactory: ObjectFactory,
|
||||||
workerExecutor: WorkerExecutor,
|
workerExecutor: WorkerExecutor
|
||||||
private val projectLayout: ProjectLayout
|
|
||||||
) : Kotlin2JsCompile(
|
) : Kotlin2JsCompile(
|
||||||
KotlinJsOptionsImpl(),
|
KotlinJsOptionsImpl(),
|
||||||
objectFactory,
|
objectFactory,
|
||||||
@@ -82,8 +81,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
|
||||||
@get:Internal
|
@Internal
|
||||||
abstract override val sources: ConfigurableFileCollection
|
override fun getSource(): FileTree = super.getSource()
|
||||||
|
|
||||||
private val buildDir = project.buildDir
|
private val buildDir = project.buildDir
|
||||||
|
|
||||||
@@ -93,18 +92,13 @@ abstract class KotlinJsIrLink @Inject constructor(
|
|||||||
@get:PathSensitive(PathSensitivity.RELATIVE)
|
@get:PathSensitive(PathSensitivity.RELATIVE)
|
||||||
internal abstract val entryModule: DirectoryProperty
|
internal abstract val entryModule: DirectoryProperty
|
||||||
|
|
||||||
override val destinationDirectory: DirectoryProperty
|
override fun getDestinationDir(): File {
|
||||||
get() = objectFactory.directoryProperty().apply {
|
return if (kotlinOptions.outputFile == null) {
|
||||||
set(
|
super.getDestinationDir()
|
||||||
destinationDirectory.flatMap { dir ->
|
} else {
|
||||||
if (kotlinOptions.outputFile == null) {
|
outputFile.parentFile
|
||||||
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()
|
||||||
|
|||||||
+2
-1
@@ -26,6 +26,7 @@ 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
|
||||||
@@ -136,7 +137,7 @@ constructor(
|
|||||||
binary.linkSyncTaskName
|
binary.linkSyncTaskName
|
||||||
) { task ->
|
) { task ->
|
||||||
task.from(
|
task.from(
|
||||||
project.layout.file(binary.linkTask.flatMap { it.destinationDirectory.map { it.asFile } })
|
project.layout.file(binary.linkTask.map { it.destinationDir })
|
||||||
)
|
)
|
||||||
|
|
||||||
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.destinationDirectory.get().asFile.absoluteFile.normalize().absolutePath
|
task.destinationDir.absoluteFile.normalize().absolutePath
|
||||||
} else {
|
} else {
|
||||||
File(task.destinationDirectory.get().asFile, "$baseName.$KLIB_TYPE").absoluteFile.normalize().absolutePath
|
File(task.destinationDir, "$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.destinationDirectory.set(taskOutputDir)
|
task.destinationDir = taskOutputDir
|
||||||
}
|
}
|
||||||
|
|
||||||
val klibModuleName = target.project.klibModuleName(baseName)
|
val klibModuleName = target.project.klibModuleName(baseName)
|
||||||
|
|||||||
+8
-13
@@ -26,6 +26,7 @@ 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
|
||||||
@@ -265,13 +266,9 @@ open class KotlinBrowserJs @Inject constructor(target: KotlinJsTarget) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
entryProperty.set(
|
entryProperty.set(
|
||||||
project.layout.file(
|
project.layout.file(actualDceTaskProvider.map {
|
||||||
actualDceTaskProvider
|
it.destinationDir.resolve(compilation.compileKotlinTask.outputFileProperty.get().name)
|
||||||
.map {
|
})
|
||||||
it.destinationDirectory.file(compilation.compileKotlinTask.outputFileProperty.get().name)
|
|
||||||
}
|
|
||||||
.flatMap { it.map { it.asFile } }
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
resolveFromModulesFirst = true
|
resolveFromModulesFirst = true
|
||||||
@@ -308,14 +305,12 @@ open class KotlinBrowserJs @Inject constructor(target: KotlinJsTarget) :
|
|||||||
|
|
||||||
it.kotlinFilesOnly = true
|
it.kotlinFilesOnly = true
|
||||||
|
|
||||||
it.classpath.from(project.configurations.getByName(compilation.runtimeDependencyConfigurationName))
|
it.classpath = project.configurations.getByName(compilation.runtimeDependencyConfigurationName)
|
||||||
it.destinationDirectory.set(
|
it.destinationDir = it.dceOptions.outputDirectory?.let { File(it) }
|
||||||
it.dceOptions.outputDirectory?.let { File(it) }
|
?: compilation.npmProject.dir.resolve(if (dev) DCE_DEV_DIR else DCE_DIR)
|
||||||
?: 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.setSource(kotlinTask.map { it.outputFileProperty })
|
it.source(kotlinTask.map { it.outputFileProperty.get() })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+17
-23
@@ -224,29 +224,23 @@ 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 = createWebpackConfig()
|
val config = KotlinWebpackConfig(
|
||||||
|
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(
|
||||||
@@ -274,7 +268,7 @@ constructor(
|
|||||||
@Internal get() = true
|
@Internal get() = true
|
||||||
|
|
||||||
override val requiredNpmDependencies: Set<RequiredKotlinJsDependency>
|
override val requiredNpmDependencies: Set<RequiredKotlinJsDependency>
|
||||||
@Internal get() = createWebpackConfig(true).getRequiredDependencies(versions)
|
@Internal get() = createRunner().config.getRequiredDependencies(versions)
|
||||||
|
|
||||||
private val isContinuous = project.gradle.startParameter.isContinuous
|
private val isContinuous = project.gradle.startParameter.isContinuous
|
||||||
|
|
||||||
|
|||||||
+4
-4
@@ -6,11 +6,13 @@
|
|||||||
@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
|
||||||
|
|
||||||
@@ -43,9 +45,7 @@ class KotlinWithJavaCompilation<KotlinOptionsType : KotlinCommonOptions>(
|
|||||||
fun source(javaSourceSet: SourceSet) {
|
fun source(javaSourceSet: SourceSet) {
|
||||||
with(target.project) {
|
with(target.project) {
|
||||||
afterEvaluate {
|
afterEvaluate {
|
||||||
tasks.named<AbstractKotlinCompile<*>>(compileKotlinTaskName).configure {
|
(tasks.getByName(compileKotlinTaskName) as AbstractKotlinCompile<*>).source(javaSourceSet.java)
|
||||||
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.setSource(sourceFiles)
|
task.source(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,6 +32,7 @@ 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
|
||||||
@@ -62,6 +63,7 @@ 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.flatMap { it.destinationDirectory.map { it.asFile }}, frameworkLinkTask)
|
project.createSyncFrameworkTask(frameworkLinkTask.map { it.destinationDir }, frameworkLinkTask)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun createSyncTask(
|
private fun createSyncTask(
|
||||||
|
|||||||
+48
-57
@@ -15,13 +15,11 @@ 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.jetbrains.kotlin.cli.common.arguments.CommonCompilerArguments
|
import org.gradle.api.tasks.compile.AbstractCompile
|
||||||
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
|
||||||
@@ -128,11 +126,7 @@ private fun Collection<File>.filterKlibsPassedToCompiler(): List<File> = filter
|
|||||||
}
|
}
|
||||||
|
|
||||||
// endregion
|
// endregion
|
||||||
abstract class AbstractKotlinNativeCompile<
|
abstract class AbstractKotlinNativeCompile<T : KotlinCommonToolOptions, K : KotlinNativeCompilationData<*>> : AbstractCompile() {
|
||||||
T : KotlinCommonToolOptions,
|
|
||||||
K : KotlinNativeCompilationData<*>,
|
|
||||||
M : CommonToolArguments
|
|
||||||
> : AbstractKotlinCompileTool<M>() {
|
|
||||||
@get:Internal
|
@get:Internal
|
||||||
abstract val compilation: K
|
abstract val compilation: K
|
||||||
|
|
||||||
@@ -157,6 +151,15 @@ abstract class AbstractKotlinNativeCompile<
|
|||||||
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:
|
||||||
@@ -171,8 +174,10 @@ abstract class AbstractKotlinNativeCompile<
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated("For native tasks use 'libraries' instead", ReplaceWith("libraries"))
|
@Deprecated("For native tasks use 'libraries' instead", ReplaceWith("libraries"))
|
||||||
override val classpath: ConfigurableFileCollection
|
override fun getClasspath(): FileCollection = libraries
|
||||||
get() = objects.fileCollection().from(libraries)
|
override fun setClasspath(configuration: FileCollection?) {
|
||||||
|
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 }
|
||||||
@@ -207,24 +212,23 @@ abstract class AbstractKotlinNativeCompile<
|
|||||||
internal val useEmbeddableCompilerJar: Boolean
|
internal val useEmbeddableCompilerJar: Boolean
|
||||||
get() = project.nativeUseEmbeddableCompilerJar
|
get() = project.nativeUseEmbeddableCompilerJar
|
||||||
|
|
||||||
@get:Internal
|
@Internal
|
||||||
open val outputFile: Provider<File>
|
open val outputFile: Provider<File> = project.provider {
|
||||||
get() = destinationDirectory.map {
|
val prefix = outputKind.prefix(konanTarget)
|
||||||
val prefix = outputKind.prefix(konanTarget)
|
val suffix = outputKind.suffix(konanTarget)
|
||||||
val suffix = outputKind.suffix(konanTarget)
|
val filename = "$prefix${baseName}$suffix".let {
|
||||||
val filename = "$prefix${baseName}$suffix".let {
|
when {
|
||||||
when {
|
outputKind == FRAMEWORK ->
|
||||||
outputKind == FRAMEWORK ->
|
it.asValidFrameworkName()
|
||||||
it.asValidFrameworkName()
|
outputKind in listOf(STATIC, DYNAMIC) || outputKind == PROGRAM && konanTarget == KonanTarget.WASM32 ->
|
||||||
outputKind in listOf(STATIC, DYNAMIC) || outputKind == PROGRAM && konanTarget == KonanTarget.WASM32 ->
|
it.replace('-', '_')
|
||||||
it.replace('-', '_')
|
else -> it
|
||||||
else -> it
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
it.file(filename).asFile
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
destinationDir.resolve(filename)
|
||||||
|
}
|
||||||
|
|
||||||
// endregion
|
// endregion
|
||||||
@Internal
|
@Internal
|
||||||
val compilerPluginOptions = CompilerPluginOptions()
|
val compilerPluginOptions = CompilerPluginOptions()
|
||||||
@@ -246,12 +250,12 @@ abstract class AbstractKotlinNativeCompile<
|
|||||||
|
|
||||||
// Used by IDE via reflection.
|
// Used by IDE via reflection.
|
||||||
@get:Internal
|
@get:Internal
|
||||||
override val serializedCompilerArguments: List<String>
|
val serializedCompilerArguments: List<String>
|
||||||
get() = buildCommonArgs()
|
get() = buildCommonArgs()
|
||||||
|
|
||||||
// Used by IDE via reflection.
|
// Used by IDE via reflection.
|
||||||
@get:Internal
|
@get:Internal
|
||||||
override val defaultSerializedCompilerArguments: List<String>
|
val defaultSerializedCompilerArguments: List<String>
|
||||||
get() = buildCommonArgs(true)
|
get() = buildCommonArgs(true)
|
||||||
|
|
||||||
private val languageSettingsBuilder by project.provider {
|
private val languageSettingsBuilder by project.provider {
|
||||||
@@ -297,20 +301,17 @@ abstract class AbstractKotlinNativeCompile<
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 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
|
||||||
abstract class KotlinNativeCompile
|
open 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<*>, StubK2NativeCompilerArguments>(),
|
) : AbstractKotlinNativeCompile<KotlinCommonOptions, KotlinNativeCompilationData<*>>(),
|
||||||
KotlinCompile<KotlinCommonOptions> {
|
KotlinCompile<KotlinCommonOptions> {
|
||||||
|
|
||||||
@get:Input
|
@get:Input
|
||||||
@@ -394,14 +395,6 @@ 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()
|
||||||
@@ -447,7 +440,7 @@ constructor(
|
|||||||
shortModuleName,
|
shortModuleName,
|
||||||
friendModule,
|
friendModule,
|
||||||
sharedCompilationData,
|
sharedCompilationData,
|
||||||
sources.asFileTree,
|
source,
|
||||||
commonSourcesTree
|
commonSourcesTree
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -459,12 +452,12 @@ constructor(
|
|||||||
* A task producing a final binary from a compilation.
|
* A task producing a final binary from a compilation.
|
||||||
*/
|
*/
|
||||||
@CacheableTask
|
@CacheableTask
|
||||||
abstract class KotlinNativeLink
|
open class KotlinNativeLink
|
||||||
@Inject
|
@Inject
|
||||||
constructor(
|
constructor(
|
||||||
@Internal
|
@Internal
|
||||||
val binary: NativeBinary
|
val binary: NativeBinary
|
||||||
) : AbstractKotlinNativeCompile<KotlinCommonToolOptions, KotlinNativeCompilation, StubK2NativeCompilerArguments>() {
|
) : AbstractKotlinNativeCompile<KotlinCommonToolOptions, KotlinNativeCompilation>() {
|
||||||
@get:Internal
|
@get:Internal
|
||||||
final override val compilation: KotlinNativeCompilation
|
final override val compilation: KotlinNativeCompilation
|
||||||
get() = binary.compilation
|
get() = binary.compilation
|
||||||
@@ -479,13 +472,19 @@ 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() }
|
||||||
|
|
||||||
override val sources: ConfigurableFileCollection = objects
|
@IgnoreEmptyDirectories
|
||||||
.fileCollection()
|
@InputFiles
|
||||||
.from(intermediateLibrary)
|
@SkipWhenEmpty
|
||||||
.apply { disallowChanges() }
|
override fun getSource(): FileTree =
|
||||||
|
objects.fileCollection().from(intermediateLibrary).asFileTree
|
||||||
|
|
||||||
override val destinationDirectory: DirectoryProperty = objects.directoryProperty().apply {
|
@OutputDirectory
|
||||||
set(binary.outputDirectory)
|
override fun getDestinationDir(): File {
|
||||||
|
return binary.outputDirectory
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun setDestinationDir(destinationDir: File) {
|
||||||
|
binary.outputDirectory = destinationDir
|
||||||
}
|
}
|
||||||
|
|
||||||
override val outputKind: CompilerOutputKind
|
override val outputKind: CompilerOutputKind
|
||||||
@@ -573,14 +572,6 @@ 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(sources, sourceFilesExtensions.get())
|
SourceRoots.KotlinOnly.create(getSource(), 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 = destinationDirectory.get().asFile.canonicalPath
|
destination = destinationDir.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()
|
||||||
|
|||||||
+13
-4
@@ -16,11 +16,14 @@
|
|||||||
|
|
||||||
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
|
||||||
@@ -70,6 +73,11 @@ 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
|
||||||
}
|
}
|
||||||
@@ -93,12 +101,13 @@ 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.asFileTree.files
|
classpath
|
||||||
}
|
}
|
||||||
// TODO: use PatternFilterable here!
|
val inputFiles = (listOf(source) + classpathFiles
|
||||||
val inputFiles = sources.asFileTree.files.plus(classpathFiles)
|
|
||||||
.filter { !kotlinFilesOnly || isDceCandidate(it) }
|
.filter { !kotlinFilesOnly || isDceCandidate(it) }
|
||||||
.map { it.path }
|
.map { objects.fileCollection().from(it).asFileTree })
|
||||||
|
.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: FileCollection,
|
taskSource: FileTree,
|
||||||
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: FileCollection,
|
taskSource: FileTree,
|
||||||
sourceFilesExtensions: List<String>
|
sourceFilesExtensions: List<String>
|
||||||
) = KotlinOnly(
|
) = KotlinOnly(
|
||||||
taskSource.filter { it.isKotlinFile(sourceFilesExtensions) }
|
taskSource.filter { it.isKotlinFile(sourceFilesExtensions) }
|
||||||
|
|||||||
+27
-40
@@ -5,7 +5,6 @@
|
|||||||
|
|
||||||
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
|
||||||
@@ -14,6 +13,7 @@ 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,7 +22,6 @@ 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
|
||||||
@@ -78,40 +77,26 @@ 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>
|
||||||
: DefaultTask(),
|
: AbstractCompile(),
|
||||||
//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)
|
||||||
abstract val sources: ConfigurableFileCollection
|
internal val stableSources: FileCollection = project.files(
|
||||||
|
{ source }
|
||||||
|
)
|
||||||
|
|
||||||
/**
|
@Incremental
|
||||||
* Sets the source for this task.
|
override fun getClasspath(): FileCollection {
|
||||||
* The given source object is evaluated as per [org.gradle.api.Project.files].
|
return super.getClasspath()
|
||||||
*/
|
|
||||||
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())
|
||||||
@@ -418,7 +403,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(
|
||||||
sources,
|
stableSources,
|
||||||
classpath,
|
classpath,
|
||||||
commonSourceSet
|
commonSourceSet
|
||||||
)
|
)
|
||||||
@@ -523,7 +508,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.destinationDirectory.get().asFile
|
val destinationDir: File = taskProvider.destinationDir
|
||||||
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
|
||||||
@@ -643,7 +628,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(sources, sourceRootsContainer, sourceFilesExtensions.get())
|
SourceRoots.ForJvm.create(source, 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.
|
||||||
@@ -661,8 +646,10 @@ abstract class KotlinCompile @Inject constructor(
|
|||||||
logger.kotlinDebug { "Set $this.usePreciseJavaTracking=$value" }
|
logger.kotlinDebug { "Set $this.usePreciseJavaTracking=$value" }
|
||||||
}
|
}
|
||||||
|
|
||||||
@get:Internal // To support compile avoidance (ClasspathSnapshotProperties.classpathSnapshot will be used as input instead)
|
@Internal // To support compile avoidance (ClasspathSnapshotProperties.classpathSnapshot will be used as input instead)
|
||||||
override abstract val classpath: ConfigurableFileCollection
|
override fun getClasspath(): FileCollection {
|
||||||
|
return super.getClasspath()
|
||||||
|
}
|
||||||
|
|
||||||
@get:Input
|
@get:Input
|
||||||
abstract val useKotlinAbiSnapshot: Property<Boolean>
|
abstract val useKotlinAbiSnapshot: Property<Boolean>
|
||||||
@@ -691,7 +678,7 @@ abstract class KotlinCompile @Inject constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override val incrementalProps: List<FileCollection>
|
override val incrementalProps: List<FileCollection>
|
||||||
get() = listOf(sources, commonSourceSet, classpathSnapshotProperties.classpath, classpathSnapshotProperties.classpathSnapshot)
|
get() = listOf(stableSources, 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>
|
||||||
@@ -872,15 +859,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(source: Any) {
|
override fun setSource(sources: Any) {
|
||||||
sourceRootsContainer.set(source)
|
sourceRootsContainer.set(sources)
|
||||||
super.setSource(source)
|
super.setSource(sources)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 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 setSource(vararg source: Any) {
|
override fun source(vararg sources: Any): SourceTask {
|
||||||
sourceRootsContainer.add(*source)
|
sourceRootsContainer.add(*sources)
|
||||||
super.setSource(*source)
|
return super.source(*sources)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getClasspathChanges(inputChanges: InputChanges): ClasspathChanges = when {
|
private fun getClasspathChanges(inputChanges: InputChanges): ClasspathChanges = when {
|
||||||
@@ -1031,7 +1018,7 @@ abstract class Kotlin2JsCompile @Inject constructor(
|
|||||||
(kotlinOptions as KotlinJsOptionsImpl).updateArguments(args)
|
(kotlinOptions as KotlinJsOptionsImpl).updateArguments(args)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getSourceRoots() = SourceRoots.KotlinOnly.create(sources, sourceFilesExtensions.get())
|
override fun getSourceRoots() = SourceRoots.KotlinOnly.create(getSource(), sourceFilesExtensions.get())
|
||||||
|
|
||||||
@get:InputFiles
|
@get:InputFiles
|
||||||
@get:IgnoreEmptyDirectories
|
@get:IgnoreEmptyDirectories
|
||||||
@@ -1128,7 +1115,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