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.
DCA11Y-1145: cover test case with project with submodules
- Loading branch information
Showing
13 changed files
with
153 additions
and
3 deletions.
There are no files selected for viewing
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
3 changes: 3 additions & 0 deletions
3
frontend-maven-plugin/src/it/node-version-manager/fnm/with-modules/.bash_profile
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,3 @@ | ||
FNM_DIR=$HOME/.fnm | ||
PATH=$FNM_DIR:$PATH | ||
eval "$(fnm env --use-on-cd --version-file-strategy=recursive --shell bash)" |
1 change: 1 addition & 0 deletions
1
frontend-maven-plugin/src/it/node-version-manager/fnm/with-modules/.gitignore
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 @@ | ||
node_modules |
1 change: 1 addition & 0 deletions
1
frontend-maven-plugin/src/it/node-version-manager/fnm/with-modules/.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 |
9 changes: 9 additions & 0 deletions
9
frontend-maven-plugin/src/it/node-version-manager/fnm/with-modules/install-fnm.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,9 @@ | ||
#!/bin/bash | ||
|
||
# invoker env variables are not loaded yet | ||
export HOME="$(dirname "$0")" | ||
|
||
export FNM_DIR="$HOME/.fnm"; | ||
mkdir "$FNM_DIR" | ||
|
||
curl -fsSL https://fnm.vercel.app/install | bash -s -- --install-dir "$FNM_DIR" --skip-shell --force-install |
3 changes: 3 additions & 0 deletions
3
frontend-maven-plugin/src/it/node-version-manager/fnm/with-modules/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,3 @@ | ||
invoker.environmentVariables.HOME=${basedir}/target/it/node-version-manager/fnm/with-modules | ||
invoker.environmentVariables.FNM_DIR=${basedir}/target/it/node-version-manager/fnm/with-modules/.fnm | ||
invoker.environmentVariables.XDG_DATA_HOME=${basedir}/target/it/node-version-manager/fnm/with-modules |
47 changes: 47 additions & 0 deletions
47
frontend-maven-plugin/src/it/node-version-manager/fnm/with-modules/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>fnm-with-modules</artifactId> | ||
<version>0</version> | ||
<packaging>pom</packaging> | ||
|
||
<modules> | ||
<module>sub-module</module> | ||
</modules> | ||
|
||
|
||
<build> | ||
<pluginManagement> | ||
<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> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</pluginManagement> | ||
|
||
<plugins> | ||
<plugin> | ||
<groupId>com.github.eirslett</groupId> | ||
<artifactId>frontend-maven-plugin</artifactId> | ||
|
||
<executions> | ||
<execution> | ||
<id>install node</id> | ||
<goals> | ||
<goal>install-node-and-npm</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
3 changes: 3 additions & 0 deletions
3
frontend-maven-plugin/src/it/node-version-manager/fnm/with-modules/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,3 @@ | ||
def p = "bash $basedir/install-fnm.sh".execute() | ||
p.waitFor() | ||
println p.text |
27 changes: 27 additions & 0 deletions
27
...nd-maven-plugin/src/it/node-version-manager/fnm/with-modules/sub-module/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/node-version-manager/fnm/with-modules/sub-module/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" | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
frontend-maven-plugin/src/it/node-version-manager/fnm/with-modules/sub-module/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,36 @@ | ||
<?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> | ||
|
||
<parent> | ||
<groupId>com.github.eirslett</groupId> | ||
<artifactId>fnm-with-modules</artifactId> | ||
<version>0</version> | ||
</parent> | ||
|
||
<artifactId>fnm-with-modules-sub-module</artifactId> | ||
<packaging>pom</packaging> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>com.github.eirslett</groupId> | ||
<artifactId>frontend-maven-plugin</artifactId> | ||
|
||
<executions> | ||
<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> |
7 changes: 7 additions & 0 deletions
7
frontend-maven-plugin/src/it/node-version-manager/fnm/with-modules/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,7 @@ | ||
import org.codehaus.plexus.util.FileUtils | ||
|
||
String buildLog = FileUtils.fileRead(new File(basedir, 'build.log')) | ||
assert buildLog.contains('Installing node with FNM') : 'Node has been installed with a different version manager' | ||
|
||
assert !new File(basedir, 'node').exists() : "Node was installed bypassing version manager" | ||
assert new File(basedir, 'sub-module/node_modules').exists() : "Node modules were not installed in the base directory" |
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