From 58279fdb5deaec6089d415d443c6bf94499fbb3b Mon Sep 17 00:00:00 2001 From: alexeyzvegintcev Date: Tue, 9 May 2017 22:59:27 +0300 Subject: [PATCH] POC: Added runApp gradle task that runs front and back --- grails-server/build.gradle | 27 +++++++++++++++++++++++++++ vue-app/.gitignore | 1 + 2 files changed, 28 insertions(+) diff --git a/grails-server/build.gradle b/grails-server/build.gradle index 012da80..20094c8 100644 --- a/grails-server/build.gradle +++ b/grails-server/build.gradle @@ -10,6 +10,19 @@ buildscript { } } +plugins { + id "com.moowork.node" version "1.1.1" +} + +node { + version = '6.10.3' + npmVersion = '3.10.10' + distBaseUrl = 'https://nodejs.org/dist' + download = true + workDir = file("${project.projectDir}/../vue-app") + nodeModulesDir = file("${project.projectDir}/../vue-app") +} + version "0.1" group "grails.server" @@ -60,3 +73,17 @@ bootRun { jvmArgs('-Dspring.output.ansi.enabled=always') addResources = true } + +// have an issue with stopin npm tasks https://github.com/srs/gradle-node-plugin/issues/143 +task runDev(type: NpmTask, dependsOn: 'npmInstall') { + workingDir = file("${project.projectDir}/../vue-app") + args=["run", "dev"] +} + +task runApp { + doLast { + println 'App is running' + } +} +runApp.dependsOn runDev +runApp.dependsOn bootRun diff --git a/vue-app/.gitignore b/vue-app/.gitignore index 3e1d210..f0f7a02 100644 --- a/vue-app/.gitignore +++ b/vue-app/.gitignore @@ -1,6 +1,7 @@ .DS_Store node_modules/ dist/ +node-v*/ npm-debug.log* yarn-debug.log* yarn-error.log*