diff options
Diffstat (limited to 'language-web/build.gradle')
-rw-r--r-- | language-web/build.gradle | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/language-web/build.gradle b/language-web/build.gradle index ff0f9e9c..6599d465 100644 --- a/language-web/build.gradle +++ b/language-web/build.gradle | |||
@@ -12,6 +12,7 @@ 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 | 16 | ||
16 | apply plugin: 'com.moowork.node' | 17 | apply plugin: 'com.moowork.node' |
17 | 18 | ||
@@ -63,14 +64,18 @@ task jettyRun(type: JavaExec) { | |||
63 | classpath = sourceSets.main.runtimeClasspath.filter{it.exists()} | 64 | classpath = sourceSets.main.runtimeClasspath.filter{it.exists()} |
64 | main = mainClass | 65 | main = mainClass |
65 | standardInput = System.in | 66 | standardInput = System.in |
67 | environment BASE_RESOURCE: "${webpackOutputDir}/${currentNodeEnv}" | ||
66 | group = 'run' | 68 | group = 'run' |
67 | description = 'Starts an example Jetty server with your language' | 69 | description = 'Start a Jetty web server serving the Xtex API and assets' |
68 | environment( | 70 | } |
69 | DEV_MODE: 'true', | 71 | |
70 | LISTEN_ADDRESS: 'localhost', | 72 | task webpackServe(type: NpmTask) { |
71 | LISTEN_PORT: '1313', | 73 | dependsOn ':language:generateXtext' |
72 | BASE_RESOURCE: "${webpackOutputDir}/development" | 74 | outputs.dir "${webpackOutputDir}/hmr" |
73 | ) | 75 | args = ['run', 'serve'] |
76 | setEnvironment NODE_ENV: 'hmr' | ||
77 | group = 'run' | ||
78 | description = 'Start a Webpack dev server with hot module replacement' | ||
74 | } | 79 | } |
75 | 80 | ||
76 | eclipse { | 81 | eclipse { |