-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
48 lines (41 loc) · 1.16 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// saved my life: https://dzone.com/articles/integrating-java-and-npm-builds-using-gradle
buildscript {
repositories {
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'com.moowork.gradle:gradle-node-plugin:1.3.1'
}
}
apply plugin: 'base'
apply plugin: 'com.moowork.node' // gradle-node-plugin
task packageYarnApp(type: Zip) {
dependsOn yarn_install
dependsOn yarn_build
baseName 'base-station-2019-frontend'
extension 'jar'
destinationDir file("${projectDir}/build_packageYarnApp")
from('build') {
// optional path under which output will be visible in Java classpath, e.g. static resources path
into 'static'
}
}
// declare a dedicated scope for publishing the packaged JAR
configurations {
yarnResources
}
configurations.default.extendsFrom(configurations.yarnResources)
// expose the artifact created by the packaging task
artifacts {
yarnResources(packageYarnApp.archivePath) {
builtBy packageYarnApp
type 'jar'
}
}
assemble.dependsOn(packageYarnApp)
clean {
delete packageYarnApp.archivePath
}