diff options
Diffstat (limited to 'language-web/build.gradle')
-rw-r--r-- | language-web/build.gradle | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/language-web/build.gradle b/language-web/build.gradle index 5cf7e684..dcb69406 100644 --- a/language-web/build.gradle +++ b/language-web/build.gradle | |||
@@ -12,7 +12,8 @@ dependencies { | |||
12 | def webpackOutputDir = "${buildDir}/webpack" | 12 | def webpackOutputDir = "${buildDir}/webpack" |
13 | def productionResources = "${webpackOutputDir}/production" | 13 | def productionResources = "${webpackOutputDir}/production" |
14 | def mainClass = 'org.eclipse.viatra.solver.language.web.ServerLauncher' | 14 | def mainClass = 'org.eclipse.viatra.solver.language.web.ServerLauncher' |
15 | def currentNodeEnv = System.getenv('NODE_ENV') ?: 'development' | 15 | def devMode = System.getenv('NODE_ENV') != 'production' |
16 | def currentNodeEnv = devMode ? 'development' : 'production' | ||
16 | 17 | ||
17 | apply plugin: 'com.moowork.node' | 18 | apply plugin: 'com.moowork.node' |
18 | 19 | ||
@@ -59,7 +60,11 @@ shadowJar { | |||
59 | } | 60 | } |
60 | 61 | ||
61 | task jettyRun(type: JavaExec) { | 62 | task jettyRun(type: JavaExec) { |
62 | dependsOn webpackDevelopment | 63 | if (devMode) { |
64 | dependsOn webpackDevelopment | ||
65 | } else { | ||
66 | dependsOn webpackProduction | ||
67 | } | ||
63 | dependsOn sourceSets.main.runtimeClasspath | 68 | dependsOn sourceSets.main.runtimeClasspath |
64 | classpath = sourceSets.main.runtimeClasspath.filter{it.exists()} | 69 | classpath = sourceSets.main.runtimeClasspath.filter{it.exists()} |
65 | main = mainClass | 70 | main = mainClass |