[Gradle, JS] Dukat change default mode onto source
- Binary only for legacy ^KT-42339 fixed
This commit is contained in:
+2
-2
@@ -107,7 +107,7 @@ class DukatIntegrationIT : BaseGradleIT() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
val externalSrcs = "build/externals/$projectName/src"
|
val externalSrcs = "build/externals/$projectName/src"
|
||||||
project.build("generateExternalsIntegrated") {
|
project.build("compileKotlinJs") {
|
||||||
assertSuccessful()
|
assertSuccessful()
|
||||||
|
|
||||||
assertSingleFileExists(externalSrcs, "index.module_decamelize.kt")
|
assertSingleFileExists(externalSrcs, "index.module_decamelize.kt")
|
||||||
@@ -162,7 +162,7 @@ class DukatIntegrationIT : BaseGradleIT() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
val externalSrcs = "build/externals/$projectName/src"
|
val externalSrcs = "build/externals/$projectName/src"
|
||||||
project.build("generateExternalsIntegrated") {
|
project.build("compileKotlinJs") {
|
||||||
assertSuccessful()
|
assertSuccessful()
|
||||||
|
|
||||||
assertSingleFileExists(externalSrcs, "index.module_decamelize.kt")
|
assertSingleFileExists(externalSrcs, "index.module_decamelize.kt")
|
||||||
|
|||||||
+2
-2
@@ -34,10 +34,10 @@ open class KotlinJsCompilation(
|
|||||||
|
|
||||||
private val kotlinProperties = PropertiesProvider(target.project)
|
private val kotlinProperties = PropertiesProvider(target.project)
|
||||||
|
|
||||||
internal val externalsOutputFormat: ExternalsOutputFormat
|
internal open val externalsOutputFormat: ExternalsOutputFormat
|
||||||
get() = kotlinProperties.externalsOutputFormat ?: defaultExternalsOutputFormat
|
get() = kotlinProperties.externalsOutputFormat ?: defaultExternalsOutputFormat
|
||||||
|
|
||||||
internal open val defaultExternalsOutputFormat: ExternalsOutputFormat = ExternalsOutputFormat.BINARY
|
internal open val defaultExternalsOutputFormat: ExternalsOutputFormat = ExternalsOutputFormat.SOURCE
|
||||||
|
|
||||||
override val kotlinOptions: KotlinJsOptions = KotlinJsOptionsImpl()
|
override val kotlinOptions: KotlinJsOptions = KotlinJsOptionsImpl()
|
||||||
|
|
||||||
|
|||||||
+3
-1
@@ -45,7 +45,9 @@ internal class DukatCompilationResolverPlugin(
|
|||||||
|
|
||||||
val target = compilation.target
|
val target = compilation.target
|
||||||
|
|
||||||
if (target is KotlinJsIrTarget || target is KotlinJsTarget && externalsOutputFormat != ExternalsOutputFormat.SOURCE) {
|
val legacyTargetNotReuseIrTask =
|
||||||
|
target is KotlinJsTarget && (target.irTarget == null || externalsOutputFormat != ExternalsOutputFormat.SOURCE)
|
||||||
|
if (target is KotlinJsIrTarget || legacyTargetNotReuseIrTask) {
|
||||||
compilation.compileKotlinTaskProvider.dependsOn(integratedTask)
|
compilation.compileKotlinTaskProvider.dependsOn(integratedTask)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-2
@@ -17,8 +17,7 @@ class KotlinJsIrCompilation(
|
|||||||
name: String
|
name: String
|
||||||
) : KotlinJsCompilation(target, name) {
|
) : KotlinJsCompilation(target, name) {
|
||||||
|
|
||||||
override val defaultExternalsOutputFormat: ExternalsOutputFormat
|
override val externalsOutputFormat: ExternalsOutputFormat = ExternalsOutputFormat.SOURCE
|
||||||
get() = ExternalsOutputFormat.SOURCE
|
|
||||||
|
|
||||||
internal val allSources: MutableSet<SourceDirectorySet> = mutableSetOf()
|
internal val allSources: MutableSet<SourceDirectorySet> = mutableSetOf()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user