diff options
author | 2021-09-20 15:53:41 +0200 | |
---|---|---|
committer | 2021-09-20 15:53:41 +0200 | |
commit | 50de7f7e60540e7dd157aa83dffec0da9c5ca608 (patch) | |
tree | 69f0ce98be0b3c32fc324c95489cc540ec95a9e6 /language-web/build.gradle | |
parent | Data structure for predicate representation (diff) | |
parent | Force LF line endings in frontend files (diff) | |
download | refinery-50de7f7e60540e7dd157aa83dffec0da9c5ca608.tar.gz refinery-50de7f7e60540e7dd157aa83dffec0da9c5ca608.tar.zst refinery-50de7f7e60540e7dd157aa83dffec0da9c5ca608.zip |
Merge branch 'web-demo' of https://github.com/viatra/VIATRA-Generator.git into web-demo
Diffstat (limited to 'language-web/build.gradle')
-rw-r--r-- | language-web/build.gradle | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/language-web/build.gradle b/language-web/build.gradle index a2acb3b0..6910fea0 100644 --- a/language-web/build.gradle +++ b/language-web/build.gradle | |||
@@ -7,15 +7,13 @@ dependencies { | |||
7 | compile "org.eclipse.xtext:org.eclipse.xtext.web.servlet:${xtextVersion}" | 7 | compile "org.eclipse.xtext:org.eclipse.xtext.web.servlet:${xtextVersion}" |
8 | compile "org.eclipse.xtend:org.eclipse.xtend.lib:${xtextVersion}" | 8 | compile "org.eclipse.xtend:org.eclipse.xtend.lib:${xtextVersion}" |
9 | compile "org.eclipse.jetty:jetty-server:${jettyVersion}" | 9 | compile "org.eclipse.jetty:jetty-server:${jettyVersion}" |
10 | compile "org.eclipse.jetty:jetty-annotations:${jettyVersion}" | 10 | compile "org.eclipse.jetty:jetty-servlet:${jettyVersion}" |
11 | compile "org.slf4j:slf4j-simple:${slf4JVersion}" | 11 | compile "org.slf4j:slf4j-simple:${slf4JVersion}" |
12 | } | 12 | } |
13 | 13 | ||
14 | def webpackOutputDir = "${buildDir}/webpack" | 14 | def webpackOutputDir = "${buildDir}/webpack" |
15 | def productionResources = "${webpackOutputDir}/production" | 15 | def productionResources = "${webpackOutputDir}/production" |
16 | def mainClass = 'org.eclipse.viatra.solver.language.web.ServerLauncher' | 16 | def mainClass = 'org.eclipse.viatra.solver.language.web.ServerLauncher' |
17 | def devMode = System.getenv('NODE_ENV') != 'production' | ||
18 | def currentNodeEnv = devMode ? 'development' : 'production' | ||
19 | 17 | ||
20 | apply plugin: 'com.moowork.node' | 18 | apply plugin: 'com.moowork.node' |
21 | 19 | ||
@@ -71,18 +69,21 @@ shadowJar { | |||
71 | } | 69 | } |
72 | 70 | ||
73 | task jettyRun(type: JavaExec) { | 71 | task jettyRun(type: JavaExec) { |
74 | if (devMode) { | 72 | shouldRunAfter webpackProduction |
75 | dependsOn webpackDevelopment | ||
76 | } else { | ||
77 | dependsOn webpackProduction | ||
78 | } | ||
79 | dependsOn sourceSets.main.runtimeClasspath | 73 | dependsOn sourceSets.main.runtimeClasspath |
80 | classpath = sourceSets.main.runtimeClasspath.filter{it.exists()} | 74 | classpath = sourceSets.main.runtimeClasspath.filter{it.exists()} |
81 | main = mainClass | 75 | main = mainClass |
82 | standardInput = System.in | 76 | standardInput = System.in |
83 | environment BASE_RESOURCE: "${webpackOutputDir}/${currentNodeEnv}" | 77 | environment BASE_RESOURCE: productionResources |
78 | group = 'run' | ||
79 | description = 'Start a Jetty web server serving the Xtex API and assets (without rebuilding assets).' | ||
80 | } | ||
81 | |||
82 | task jettyRunAssets { | ||
83 | dependsOn webpackProduction | ||
84 | dependsOn jettyRun | ||
84 | group = 'run' | 85 | group = 'run' |
85 | description = 'Start a Jetty web server serving the Xtex API and assets.' | 86 | description = 'Rebuild assets and start a Jetty web server serving the Xtex API and assets.' |
86 | } | 87 | } |
87 | 88 | ||
88 | task webpackServe(type: NpmTask) { | 89 | task webpackServe(type: NpmTask) { |
@@ -98,6 +99,9 @@ task webpackServe(type: NpmTask) { | |||
98 | task eslint(type: NpmTask) { | 99 | task eslint(type: NpmTask) { |
99 | dependsOn npmInstall | 100 | dependsOn npmInstall |
100 | args = ['run', 'eslint'] | 101 | args = ['run', 'eslint'] |
102 | inputs.dir 'src/main/js' | ||
103 | inputs.file 'tsconfig.json' | ||
104 | inputs.file '.eslintrc.js' | ||
101 | group = 'verification' | 105 | group = 'verification' |
102 | description = 'Checks for TypeScript errors.' | 106 | description = 'Checks for TypeScript errors.' |
103 | } | 107 | } |