Alfred Lopez
09/09/2021, 1:44 PMrootProject.plugins.withType(NodeJsRootPlugin::class) {
var nodeJsRootExt = rootProject.the<NodeJsRootExtension>()
nodeJsRootExt.download = false
nodeJsRootExt.nodeVersion = "16.15.4"
}
rootProject.plugins.withType(YarnPlugin::class) {
var gsmlYarnRootExt = rootProject.the<YarnRootExtension>()
gsmlYarnRootExt.download = false
gsmlYarnRootExt.version = "1.22.11"
}
For some reason, the build “sees” the assigned version numbers, but it ignores the download = false. Also, I’m using plugin version 1.5.20, and the YarnRootExtension class clearly has “download” as a field, but IntelliJ says otherwise and when I Cmd+Click to go to the definition of the class, the property is not there, which means to me that gradle is not pulling in the latest for some reason.
Do any of you have any insight to this?
Thanks!turansky
09/09/2021, 5:34 PMAlfred Lopez
09/10/2021, 3:41 PMIlya Goncharov [JB]
09/13/2021, 8:34 PMdownloadBaseUrl
in Yarn extensionAlfred Lopez
09/13/2021, 8:38 PMAlfred Lopez
09/21/2021, 8:12 PMIlya Goncharov [JB]
09/22/2021, 9:41 AMAlfred Lopez
09/22/2021, 7:32 PMAlfred Lopez
09/22/2021, 7:34 PMAlfred Lopez
09/23/2021, 4:21 PMproject.rootProject.plugins.withType(NodeJsRootPlugin::class) {
project.extensions.configure(NodeJsRootExtension::class) {
this.download = false
this.nodeVersion = "16.9.0"
}
}
tasks.whenTaskAdded {
val unwantedTasks = listOf(
"kotlinNodeJsSetup",
"kotlinYarnSetup"
)
println("Adding task ${this.name}...")
if(unwantedTasks.contains(this.name)) {
println("Disabling ${this.name}...")
this.enabled = false
project.extensions.configure(NodeJsRootExtension::class) {
println("Extension download is set to ${this.download}...")
println("Extension installationDir is set to ${this.installationDir}...")
println("Extension nodeDownloadBaseUrl is set to ${this.nodeDownloadBaseUrl}...")
println("Extension nodeVersion is set to ${this.nodeVersion}...")
println("Extension nodeCommand is set to ${this.nodeCommand}...")
this.download = false
println(" Set download to ${this.download}...")
}
}
}
When I run it, I get the following output...Alfred Lopez
09/23/2021, 4:21 PM> Configure project :
Adding task jsProcessResources...
Adding task jsMainClasses...
Adding task jsTestProcessResources...
Adding task jsTestClasses...
Adding task compileKotlinJs...
Adding task jsSourcesJar...
Adding task compileTestKotlinJs...
Adding task jsJar...
Adding task allTests...
Adding task jsTest...
Adding task kotlinNodeJsSetup...
Disabling kotlinNodeJsSetup...
Extension download is set to true...
Extension installationDir is set to /Users/lopealf/.gradle/nodejs...
Extension nodeDownloadBaseUrl is set to <https://nodejs.org/dist>...
Extension nodeVersion is set to 14.17.0...
Extension nodeCommand is set to node...
Set download to false...
Adding task kotlinNpmInstall...
Adding task kotlinNpmCachesSetup...
Adding task packageJsonUmbrella...
Adding task kotlinYarnSetup...
Disabling kotlinYarnSetup...
Extension download is set to false...
Extension installationDir is set to /Users/lopealf/.gradle/nodejs...
Extension nodeDownloadBaseUrl is set to <https://nodejs.org/dist>...
Extension nodeVersion is set to 14.17.0...
Extension nodeCommand is set to node...
Set download to false...
Adding task rootPackageJson...
Adding task yarnKotlinClean...
Adding task nodeKotlinClean...
Adding task compileTestProductionExecutableKotlinJs...
Adding task jsTestTestProductionExecutableCompileSync...
Adding task compileTestDevelopmentExecutableKotlinJs...
Adding task jsTestTestDevelopmentExecutableCompileSync...
Adding task jsPackageJson...
Adding task jsPublicPackageJson...
Adding task jsGenerateExternalsIntegrated...
Adding task jsGenerateExternals...
Adding task jsTestPackageJson...
Adding task jsTestPublicPackageJson...
Adding task jsNodeTest...
Adding task cleanAllTests...
Adding task compileProductionExecutableKotlinJs...
Adding task jsProductionExecutableCompileSync...
Adding task jsNodeProductionRun...
Adding task jsRun...
Adding task compileDevelopmentExecutableKotlinJs...
Adding task jsDevelopmentExecutableCompileSync...
Adding task jsNodeDevelopmentRun...
Adding task jsNodeRun...
Adding task cleanDist...
Adding task stageForNpm...
Adding task publish...
Adding task pack...
NPM Repository [local] is invalid. Skipping...
Adding task assembleJsNpmPublication...
Adding task packJsNpmPublication...
Adding task publishJsNpmPublicationToManulife...
Adding task metadataCommonMainClasses...
Adding task compileCommonMainKotlinMetadata...
Adding task transformCommonMainDependenciesMetadata...
Adding task transformMainDependenciesMetadata...
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':kotlinNodeJsSetup'.
> Could not resolve all files for configuration ':detachedConfiguration1'.
> Could not resolve org.nodejs:node:16.9.0.
Required by:
project :
> Could not resolve org.nodejs:node:16.9.0.
> Could not get resource '<https://nodejs.org/dist/v16.9.0/node-v16.9.0-darwin-x64.tar.gz>'.
> Could not HEAD '<https://nodejs.org/dist/v16.9.0/node-v16.9.0-darwin-x64.tar.gz>'.
> The server may not support the client's requested TLS protocol versions: (TLSv1.2, TLSv1.3). You may need to configure the client to allow other protocols to be used. See: <https://docs.gradle.org/7.2/userguide/build_environment.html#gradle_system_properties>
> PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Now, I'm behind a corporate firewall and our Artifactory's path to node (if any) is not in the same format as what the plugin is set.