aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2019-10-22 11:24:57 +0300
committerGravatar Vitaly Takmazov2019-10-22 11:24:57 +0300
commit53807dc25b6215594ad34f9c63e68ed79bc343ec (patch)
tree486caa850a59c1829c8ff95521d541f7c867c5a8
parent643b08a8ba94f41e8242c92175d5dec16ebfb103 (diff)
Gradle: drop node plugin, exec yarn directly
-rw-r--r--build.gradle17
1 files 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