Skip to content

Commit

Permalink
Give NPM registry option for downloading node tools (#2208)
Browse files Browse the repository at this point in the history
(cherry picked from commit a5337ee)
  • Loading branch information
HoustonPutman committed Jan 19, 2024
1 parent cccae34 commit b448f01
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
7 changes: 7 additions & 0 deletions gradle/node.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@
configure([project(":solr:packaging"), project(":solr:solr-ref-guide"), project(":solr:webapp")]) {
apply plugin: "com.github.node-gradle.node"

def npmRegistry = "${ -> propertyOrEnvOrDefault("solr.npm.registry", "SOLR_NPM_REGISTRY", '') }"
if (!npmRegistry.isEmpty()) {
tasks.npmSetup {
args.addAll(['--registry', npmRegistry])
}
}

ext {
rootNodeDir = "$rootDir/.gradle/node"
nodeProjectDir = file("$rootNodeDir/$project.name")
Expand Down
12 changes: 12 additions & 0 deletions help/localSettings.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,15 @@ and save a project-local 'gradle.properties' file from a template,
with some default settings which you can modify.

See your 'gradle.properties' file for more details of those settings.

Building without access to the internet
---------------------------------------

-- Node --
There are a few tasks that rely on downloading node tools from NPM.
These include the Reference Guide build, the integration (e2e) tests and the webapp build.
Some of these can be disabled, however other tasks such as building the solr webapp often cannot be disabled.

In order to set a NPM registry for Gradle to connect to, please use either:
- The "SOLR_NPM_REGISTRY" environment variable
- The "-Psolr.npm.registry" Gradle property.

0 comments on commit b448f01

Please sign in to comment.