diff options
author | 2021-06-30 00:27:32 +0200 | |
---|---|---|
committer | 2021-06-30 00:27:32 +0200 | |
commit | 2df1e4a7eb7b5540280410c62490f57209905e0a (patch) | |
tree | d76595ecb4aa95a8c5a190959f5fd75e0c7e5c1e | |
parent | Webpack subresource integrity (diff) | |
download | refinery-2df1e4a7eb7b5540280410c62490f57209905e0a.tar.gz refinery-2df1e4a7eb7b5540280410c62490f57209905e0a.tar.zst refinery-2df1e4a7eb7b5540280410c62490f57209905e0a.zip |
Install nodejs and npm from Gradle
-rw-r--r-- | gradle.properties | 2 | ||||
-rw-r--r-- | language-web/build.gradle | 10 |
2 files changed, 12 insertions, 0 deletions
diff --git a/gradle.properties b/gradle.properties index 499732a1..8b4f3793 100644 --- a/gradle.properties +++ b/gradle.properties | |||
@@ -5,6 +5,8 @@ jettyVersion=9.4.42.v20210604 | |||
5 | junitVersion=5.7.2 | 5 | junitVersion=5.7.2 |
6 | mweVersion=1.6.1 | 6 | mweVersion=1.6.1 |
7 | mwe2Version=2.12.1 | 7 | mwe2Version=2.12.1 |
8 | nodeVersion=14.17.1 | ||
9 | npmVersion=7.19.0 | ||
8 | slf4JVersion=1.7.31 | 10 | slf4JVersion=1.7.31 |
9 | xtextVersion=2.26.0.M1 | 11 | xtextVersion=2.26.0.M1 |
10 | xtextAntlrGeneratorVersion=2.1.1 \ No newline at end of file | 12 | xtextAntlrGeneratorVersion=2.1.1 \ No newline at end of file |
diff --git a/language-web/build.gradle b/language-web/build.gradle index dcb69406..e04af7cb 100644 --- a/language-web/build.gradle +++ b/language-web/build.gradle | |||
@@ -17,10 +17,17 @@ def currentNodeEnv = devMode ? 'development' : 'production' | |||
17 | 17 | ||
18 | apply plugin: 'com.moowork.node' | 18 | apply plugin: 'com.moowork.node' |
19 | 19 | ||
20 | node { | ||
21 | version = nodeVersion | ||
22 | npmVersion = project.ext.npmVersion | ||
23 | download = true | ||
24 | } | ||
25 | |||
20 | for (environment in ['production', 'development']) { | 26 | for (environment in ['production', 'development']) { |
21 | def taskName = 'webpack' + environment.substring(0, 1).toUpperCase() + environment.substring(1); | 27 | def taskName = 'webpack' + environment.substring(0, 1).toUpperCase() + environment.substring(1); |
22 | task(taskName, type: NpmTask) { | 28 | task(taskName, type: NpmTask) { |
23 | dependsOn ':language:generateXtext' | 29 | dependsOn ':language:generateXtext' |
30 | dependsOn npmInstall | ||
24 | inputs.dir 'src/main/css' | 31 | inputs.dir 'src/main/css' |
25 | inputs.dir 'src/main/html' | 32 | inputs.dir 'src/main/html' |
26 | inputs.dir 'src/main/js' | 33 | inputs.dir 'src/main/js' |
@@ -34,6 +41,7 @@ for (environment in ['production', 'development']) { | |||
34 | 41 | ||
35 | apply plugin: 'application' | 42 | apply plugin: 'application' |
36 | mainClassName = mainClass | 43 | mainClassName = mainClass |
44 | distTar.enabled = false | ||
37 | distZip.enabled = false | 45 | distZip.enabled = false |
38 | 46 | ||
39 | jar { | 47 | jar { |
@@ -44,6 +52,7 @@ jar { | |||
44 | } | 52 | } |
45 | 53 | ||
46 | apply plugin: 'com.github.johnrengelman.shadow' | 54 | apply plugin: 'com.github.johnrengelman.shadow' |
55 | shadowDistTar.enabled = false | ||
47 | shadowDistZip.enabled = false | 56 | shadowDistZip.enabled = false |
48 | 57 | ||
49 | shadowJar { | 58 | shadowJar { |
@@ -76,6 +85,7 @@ task jettyRun(type: JavaExec) { | |||
76 | 85 | ||
77 | task webpackServe(type: NpmTask) { | 86 | task webpackServe(type: NpmTask) { |
78 | dependsOn ':language:generateXtext' | 87 | dependsOn ':language:generateXtext' |
88 | dependsOn npmInstall | ||
79 | outputs.dir "${webpackOutputDir}/hmr" | 89 | outputs.dir "${webpackOutputDir}/hmr" |
80 | args = ['run', 'serve'] | 90 | args = ['run', 'serve'] |
81 | setEnvironment NODE_ENV: 'hmr' | 91 | setEnvironment NODE_ENV: 'hmr' |