From ea9c8c9a6d52370464c6ef37a3fbf1f08696aae6 Mon Sep 17 00:00:00 2001 From: Steve Storey Date: Wed, 12 Jun 2024 22:11:58 +0100 Subject: [PATCH] Add a corepack integration example. --- .../src/it/corepack-integration/.yarnrc.yml | 3 ++ .../src/it/corepack-integration/package.json | 8 +++ .../src/it/corepack-integration/pom.xml | 49 +++++++++++++++++++ .../src/it/corepack-integration/verify.groovy | 6 +++ 4 files changed, 66 insertions(+) create mode 100644 frontend-maven-plugin/src/it/corepack-integration/.yarnrc.yml create mode 100644 frontend-maven-plugin/src/it/corepack-integration/package.json create mode 100644 frontend-maven-plugin/src/it/corepack-integration/pom.xml create mode 100644 frontend-maven-plugin/src/it/corepack-integration/verify.groovy diff --git a/frontend-maven-plugin/src/it/corepack-integration/.yarnrc.yml b/frontend-maven-plugin/src/it/corepack-integration/.yarnrc.yml new file mode 100644 index 000000000..0cd45f54d --- /dev/null +++ b/frontend-maven-plugin/src/it/corepack-integration/.yarnrc.yml @@ -0,0 +1,3 @@ +enableGlobalCache: false + +nodeLinker: node-modules diff --git a/frontend-maven-plugin/src/it/corepack-integration/package.json b/frontend-maven-plugin/src/it/corepack-integration/package.json new file mode 100644 index 000000000..3519bdcfe --- /dev/null +++ b/frontend-maven-plugin/src/it/corepack-integration/package.json @@ -0,0 +1,8 @@ +{ + "name": "example", + "version": "0.0.1", + "dependencies": { + "less": "~3.0.2" + }, + "packageManager": "yarn@4.1.1" +} diff --git a/frontend-maven-plugin/src/it/corepack-integration/pom.xml b/frontend-maven-plugin/src/it/corepack-integration/pom.xml new file mode 100644 index 000000000..27b6ff4f0 --- /dev/null +++ b/frontend-maven-plugin/src/it/corepack-integration/pom.xml @@ -0,0 +1,49 @@ + + + 4.0.0 + + com.github.eirslett + example + 0 + pom + + + + + com.github.eirslett + frontend-maven-plugin + + @project.version@ + + + target + + + + + + install node and corepack + + install-node-and-corepack + + + v20.12.2 + 0.25.2 + + + + + yarn install + + corepack + + + yarn install --no-immutable + + + + + + + + diff --git a/frontend-maven-plugin/src/it/corepack-integration/verify.groovy b/frontend-maven-plugin/src/it/corepack-integration/verify.groovy new file mode 100644 index 000000000..1355cd8ec --- /dev/null +++ b/frontend-maven-plugin/src/it/corepack-integration/verify.groovy @@ -0,0 +1,6 @@ +assert new File(basedir, 'target/node').exists() : "Node was not installed in the custom install directory"; +assert new File(basedir, 'node_modules').exists() : "Node modules were not installed in the base directory"; +assert new File(basedir, 'node_modules/less/package.json').exists() : "Less dependency has not been installed successfully"; + +String buildLog = new File(basedir, 'build.log').text +assert buildLog.contains('BUILD SUCCESS') : 'build was not successful'