From 53807dc25b6215594ad34f9c63e68ed79bc343ec Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 22 Oct 2019 11:24:57 +0300 Subject: Gradle: drop node plugin, exec yarn directly --- build.gradle | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/build.gradle b/build.gradle index 6218cdde..de529d95 100644 --- a/build.gradle +++ b/build.gradle @@ -1,3 +1,5 @@ +import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform + buildscript { repositories { mavenCentral() @@ -10,7 +12,6 @@ buildscript { } plugins { id 'org.springframework.boot' version '2.2.0.RELEASE' apply false - id "com.moowork.node" version "1.3.1" apply false id("org.asciidoctor.convert") version "2.3.0" apply false } @@ -41,17 +42,20 @@ dependencyUpdates.resolutionStrategy = { } apply plugin: 'java' apply plugin: 'org.springframework.boot' -apply plugin: 'com.moowork.node' apply plugin: 'io.github.swagger2markup' apply plugin: 'org.asciidoctor.convert' -task compileFrontend(type: YarnTask) { +task yarn(type: Exec) { inputs.files(fileTree('node_modules')) inputs.files(fileTree('src')) - inputs.file('package.json') + inputs.file('yarn.lock') inputs.file('webpack.config.js') outputs.dir('src/main/resources/static') - args = ['run', 'compile'] + if (DefaultNativePlatform.getCurrentOperatingSystem().isWindows()) { + commandLine 'cmd', '/c', 'yarn', 'run', 'compile' + } else { + commandLine 'yarn', 'run', 'compile' + } } ext { @@ -180,8 +184,7 @@ bootRun { sourceResources sourceSets.main } -compileFrontend.dependsOn 'yarn' -processResources.dependsOn 'compileFrontend' +processResources.dependsOn 'yarn' sourceCompatibility = JavaVersion.VERSION_11 targetCompatibility = JavaVersion.VERSION_11 -- cgit v1.2.3