[Gradle, JS] Enable Dukat by default with false generateExternals
This commit is contained in:
+6
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
@@ -30,6 +30,11 @@ class PackageJsonDukatExecutor(
|
||||
get() = inputsFile.isFile && prevVersion == version && !packageJsonIsUpdated
|
||||
|
||||
fun execute() {
|
||||
if (typeDefinitions.isEmpty()) {
|
||||
npmProject.externalsDirRoot.deleteRecursively()
|
||||
return
|
||||
}
|
||||
|
||||
// delete file to run visit on error even without package.json updates
|
||||
versionFile.delete()
|
||||
|
||||
|
||||
-3
@@ -44,9 +44,6 @@ open class NodeJsRootExtension(val rootProject: Project) : ConfigurationPhaseAwa
|
||||
private val projectProperties = PropertiesProvider(rootProject)
|
||||
|
||||
inner class Experimental {
|
||||
val generateKotlinExternals: Boolean
|
||||
get() = projectProperties.jsGenerateExternals == true
|
||||
|
||||
val discoverTypes: Boolean
|
||||
get() = projectProperties.jsDiscoverTypes == true
|
||||
}
|
||||
|
||||
+1
-3
@@ -33,9 +33,7 @@ internal class KotlinRootNpmResolver internal constructor(
|
||||
get() = nodeJs.rootProject
|
||||
|
||||
val plugins = mutableListOf<RootResolverPlugin>().also {
|
||||
if (nodeJs.experimental.generateKotlinExternals) {
|
||||
it.add(DukatRootResolverPlugin(this))
|
||||
}
|
||||
it.add(DukatRootResolverPlugin(this))
|
||||
}
|
||||
|
||||
enum class State {
|
||||
|
||||
Reference in New Issue
Block a user