-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
62 lines (55 loc) · 1.38 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
buildscript {
repositories {
mavenCentral()
}
}
plugins {
/// Plugin to handle NodeJS
id 'base'
id 'com.github.node-gradle.node' version '3.0.1'
}
configurations {
frontendFiles {
canBeConsumed = true
canBeResolved = false
}
}
/** If the flag -DincludeConfig is passed, we include it */
def includeConfig = project.hasProperty('includeConfig')
node {
version = '18.16.0'
download = true
workDir = file("${project.projectDir}/.gradle/nodejs")
yarnWorkDir = file("${project.projectDir}/.gradle/yarn")
nodeProjectDir = file("${project.projectDir}")
}
task buildFrontend(type: YarnTask) {
outputs.upToDateWhen {
return file("$buildDir/dist").isDirectory()
}
args = ['run', 'pbuild']
dependsOn yarn_install
dependsOn rootProject.tasks.getByName('openApiGenerate')
}
task packageFrontend(type: Zip) {
outputs.upToDateWhen {
return file("$buildDir/lib/dres-frontend.jar").exists()
}
dependsOn buildFrontend
baseName 'dres-frontend'
extension 'jar'
destinationDir file("$buildDir/lib")
from("$buildDir/dist") {
println("includeConfig: "+includeConfig)
if(!includeConfig){
exclude '**/config.json'
}
into 'html'
}
}
artifacts {
frontendFiles(packageFrontend.archiveFile) {
builtBy packageFrontend
type "jar"
}
}