forked from eirslett/frontend-maven-plugin
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
305 additions
and
14 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
frontend-maven-plugin/src/it/provided-node-dir/invoker.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# ignoring windows for now | ||
invoker.os.family=!windows,unix,mac |
1 change: 1 addition & 0 deletions
1
frontend-maven-plugin/src/it/provided-node-dir/with-env-var/.nvmrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v20.15.1 |
18 changes: 18 additions & 0 deletions
18
frontend-maven-plugin/src/it/provided-node-dir/with-env-var/install-nvm.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
# invoker env variables are not loaded yet | ||
export HOME="$(dirname "$0")" | ||
|
||
export NVM_DIR="$HOME/.nvm"; | ||
mkdir "$NVM_DIR" | ||
echo "NVM_DIR set"; | ||
|
||
( | ||
git clone https://github.com/nvm-sh/nvm.git "$NVM_DIR" && | ||
cd "$NVM_DIR" && | ||
git checkout `git describe --abbrev=0 --tags --match "v[0-9]*" $(git rev-list --tags --max-count=1)` | ||
); | ||
echo "NVM checked out"; | ||
|
||
. "$NVM_DIR/nvm.sh" \ | ||
&& nvm install v20.15.1 |
2 changes: 2 additions & 0 deletions
2
frontend-maven-plugin/src/it/provided-node-dir/with-env-var/invoker.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
invoker.environmentVariables.HOME=${basedir}/target/it/provided-node-dir/with-env-var | ||
invoker.environmentVariables.AFMP_INSTALLED_NODE_DIRECTORY=${basedir}/target/it/provided-node-dir/with-env-var/.nvm/versions/node/v20.15.1/bin |
27 changes: 27 additions & 0 deletions
27
frontend-maven-plugin/src/it/provided-node-dir/with-env-var/package-lock.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
10 changes: 10 additions & 0 deletions
10
frontend-maven-plugin/src/it/provided-node-dir/with-env-var/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"name": "example", | ||
"version": "0.0.1", | ||
"dependencies": { | ||
"classnames": "^2.3.2" | ||
}, | ||
"scripts": { | ||
"prebuild": "npm install" | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
frontend-maven-plugin/src/it/provided-node-dir/with-env-var/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>com.github.eirslett</groupId> | ||
<artifactId>example</artifactId> | ||
<version>0</version> | ||
<packaging>pom</packaging> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>com.github.eirslett</groupId> | ||
<artifactId>frontend-maven-plugin</artifactId> | ||
<!-- NB! Set <version> to the latest released version of frontend-maven-plugin, like in README.md --> | ||
<version>@project.version@</version> | ||
|
||
<configuration> | ||
<workingDirectory>${basedir}</workingDirectory> | ||
<!-- FMP should warn about version mismatch between provided node and requested node version --> | ||
<nodeVersion>v20.16.0</nodeVersion> | ||
</configuration> | ||
|
||
<executions> | ||
<execution> | ||
<id>install node</id> | ||
<goals> | ||
<goal>install-node-and-npm</goal> | ||
</goals> | ||
</execution> | ||
<execution> | ||
<id>npm ci</id> | ||
<goals> | ||
<goal>npm</goal> | ||
</goals> | ||
<!-- Optional configuration which provides for running any npm command --> | ||
<configuration> | ||
<arguments>ci</arguments> | ||
</configuration> | ||
</execution> | ||
|
||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
2 changes: 2 additions & 0 deletions
2
frontend-maven-plugin/src/it/provided-node-dir/with-env-var/prebuild.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
def p = "bash $basedir/install-nvm.sh".execute() | ||
p.waitForProcessOutput(System.out, System.err) |
9 changes: 9 additions & 0 deletions
9
frontend-maven-plugin/src/it/provided-node-dir/with-env-var/verify.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import org.codehaus.plexus.util.FileUtils | ||
|
||
// assert | ||
assert !new File(basedir, 'node/node').exists() : "Node was installed in the custom install directory" | ||
assert new File(basedir, 'node_modules').exists() : "Node modules were not installed in the base directory" | ||
|
||
String buildLog = FileUtils.fileRead(new File(basedir, 'build.log')) | ||
assert !buildLog.contains('Using NVM') : 'Node has been installed with a version manager but should use provided node' | ||
assert buildLog.contains('Provided node executable has version v20.15.1, but v20.16.0 was requested in configuration.') : 'FMP should warn about version mismatch' |
1 change: 1 addition & 0 deletions
1
frontend-maven-plugin/src/it/provided-node-dir/with-property/.nvmrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v20.15.1 |
18 changes: 18 additions & 0 deletions
18
frontend-maven-plugin/src/it/provided-node-dir/with-property/install-nvm.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
# invoker env variables are not loaded yet | ||
export HOME="$(dirname "$0")" | ||
|
||
export NVM_DIR="$HOME/.nvm"; | ||
mkdir "$NVM_DIR" | ||
echo "NVM_DIR set"; | ||
|
||
( | ||
git clone https://github.com/nvm-sh/nvm.git "$NVM_DIR" && | ||
cd "$NVM_DIR" && | ||
git checkout `git describe --abbrev=0 --tags --match "v[0-9]*" $(git rev-list --tags --max-count=1)` | ||
); | ||
echo "NVM checked out"; | ||
|
||
. "$NVM_DIR/nvm.sh" \ | ||
&& nvm install v20.15.1 |
1 change: 1 addition & 0 deletions
1
frontend-maven-plugin/src/it/provided-node-dir/with-property/invoker.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
invoker.environmentVariables.HOME=${basedir}/target/it/provided-node-dir/with-property |
27 changes: 27 additions & 0 deletions
27
frontend-maven-plugin/src/it/provided-node-dir/with-property/package-lock.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
10 changes: 10 additions & 0 deletions
10
frontend-maven-plugin/src/it/provided-node-dir/with-property/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"name": "example", | ||
"version": "0.0.1", | ||
"dependencies": { | ||
"classnames": "^2.3.2" | ||
}, | ||
"scripts": { | ||
"prebuild": "npm install" | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
frontend-maven-plugin/src/it/provided-node-dir/with-property/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>com.github.eirslett</groupId> | ||
<artifactId>example</artifactId> | ||
<version>0</version> | ||
<packaging>pom</packaging> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>com.github.eirslett</groupId> | ||
<artifactId>frontend-maven-plugin</artifactId> | ||
<!-- NB! Set <version> to the latest released version of frontend-maven-plugin, like in README.md --> | ||
<version>@project.version@</version> | ||
|
||
<configuration> | ||
<workingDirectory>${basedir}</workingDirectory> | ||
<installedNodeDirectory>${basedir}/.nvm/versions/node/v20.15.1/bin</installedNodeDirectory> | ||
<!-- FMP should warn about version mismatch between provided node and requested node version --> | ||
<nodeVersion>v20.16.0</nodeVersion> | ||
</configuration> | ||
|
||
<executions> | ||
<execution> | ||
<id>install node</id> | ||
<goals> | ||
<goal>install-node-and-npm</goal> | ||
</goals> | ||
</execution> | ||
<execution> | ||
<id>npm ci</id> | ||
<goals> | ||
<goal>npm</goal> | ||
</goals> | ||
<!-- Optional configuration which provides for running any npm command --> | ||
<configuration> | ||
<arguments>ci</arguments> | ||
</configuration> | ||
</execution> | ||
|
||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
2 changes: 2 additions & 0 deletions
2
frontend-maven-plugin/src/it/provided-node-dir/with-property/prebuild.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
def p = "bash $basedir/install-nvm.sh".execute() | ||
p.waitForProcessOutput(System.out, System.err) |
9 changes: 9 additions & 0 deletions
9
frontend-maven-plugin/src/it/provided-node-dir/with-property/verify.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import org.codehaus.plexus.util.FileUtils | ||
|
||
// assert | ||
assert !new File(basedir, 'node/node').exists() : "Node was installed in the custom install directory" | ||
assert new File(basedir, 'node_modules').exists() : "Node modules were not installed in the base directory" | ||
|
||
String buildLog = FileUtils.fileRead(new File(basedir, 'build.log')) | ||
assert !buildLog.contains('Using NVM') : 'Node has been installed with a version manager but should use provided node' | ||
assert buildLog.contains('Provided node executable has version v20.15.1, but v20.16.0 was requested in configuration.') : 'FMP should warn about version mismatch' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.