From f00be8c6d4b1d420119f9f08d400719fd62d2d39 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 22 Oct 2019 11:49:27 +0300 Subject: yarn and yarnCompile tasks --- build.gradle | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 242cb14f..b637ae6c 100644 --- a/build.gradle +++ b/build.gradle @@ -46,9 +46,18 @@ apply plugin: 'io.github.swagger2markup' apply plugin: 'org.asciidoctor.convert' task yarn(type: Exec) { + inputs.file('yarn.lock') + outputs.file('yarn.lock') + if (DefaultNativePlatform.getCurrentOperatingSystem().isWindows()) { + commandLine 'cmd', '/c', 'yarn' + } else { + commandLine 'yarn' + } +} + +task yarnCompile(type: Exec) { inputs.files(fileTree('node_modules')) inputs.files(fileTree('src')) - inputs.file('yarn.lock') inputs.file('webpack.config.js') outputs.dir('src/main/resources/static') if (DefaultNativePlatform.getCurrentOperatingSystem().isWindows()) { @@ -181,7 +190,8 @@ bootRun { sourceResources sourceSets.main } -processResources.dependsOn 'yarn' +yarnCompile.dependsOn 'yarn' +processResources.dependsOn 'yarnCompile' sourceCompatibility = JavaVersion.VERSION_11 targetCompatibility = JavaVersion.VERSION_11 -- cgit v1.2.3