[Gradle, JS] Enable Dukat by default with false generateExternals

This commit is contained in:
Ilya Goncharov
2020-06-05 19:36:34 +03:00
parent f285a31a5a
commit 0f47a38042
3 changed files with 7 additions and 7 deletions
@@ -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()
@@ -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
}
@@ -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 {