掲示板

Liferay DXP Gradle Build with NodeJS

thumbnail
7年前 に Boris Gligorijević によって更新されました。

Liferay DXP Gradle Build with NodeJS

New Member 投稿: 6 参加年月日: 15/08/17 最新の投稿
Dear Liferay colleagues,

We are trying to setup a Gradle build for Liferay DXP project which will build all modules, including theme-related projects which use NodeJS.
The thing we want to avoid is having an external dependency on the downloadNode task.

I have seen https://github.com/liferay/liferay-portal/tree/master/modules/sdk/gradle-plugins-node.

Is there a way to tell the Gradle to use the centralized Node installation and not try to grab the version from the internet each time?
I tried setting the -PnodeDownload=false and similar, but then no system Node is taken into account, the build just fails.

Any ideas? Thanks!
thumbnail
7年前 に Boris Gligorijević によって更新されました。

RE: Liferay DXP Gradle Build with NodeJS

New Member 投稿: 6 参加年月日: 15/08/17 最新の投稿
Andrea, the creator/contributor of Gradle Node Plugin, has helped us a lot, so let me share his answer:

The "nodeDownload" is the only property that can be changed via "-P" command line argument, the other ones must be changed via script. Properties like "nodeExeUrl" are not project properties, but rather properties of the "node" extension object. You can do something like this in the root build.gradle of your Liferay Workspace:

subprojects {
plugins.withId("com.liferay.node") {
node {
nodeExeUrl = "https://something.com/dist/v6.0.0/win-x64/node.exe"
}
}
}