-
Notifications
You must be signed in to change notification settings - Fork 114
Expand file tree
/
Copy pathbuild.gradle
More file actions
102 lines (83 loc) · 2.22 KB
/
Copy pathbuild.gradle
File metadata and controls
102 lines (83 loc) · 2.22 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
plugins {
id 'com.axelor.app'
id 'com.github.node-gradle.node' version '7.1.0'
}
ext {
myHomeAppDir = 'my-home'
}
axelor {
title = 'Axelor :: DEMO'
}
allprojects {
apply plugin: 'idea'
apply plugin: 'eclipse'
group = 'com.axelor'
version = '8.2.0'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
afterEvaluate {
test {
useJUnitPlatform()
beforeTest { descriptor ->
logger.lifecycle('Running: ' + descriptor)
}
}
}
}
dependencies {
// add module dependencies
implementation project(':modules:demo-contact')
implementation project(':modules:demo-sale')
implementation project(':modules:demo-project')
implementation project(':modules:demo-custom')
}
war {
archiveFileName = 'open-platform-demo.war'
}
i18n {
extraSources = ["${myHomeAppDir}/src"]
}
apply from: 'gradle/style.gradle'
////
// My home app
////
node {
version = '24.13.1'
pnpmVersion = '10.33.4'
download = true
nodeProjectDir = file("${myHomeAppDir}")
// Set distBaseUrl to null to prevent the Node plugin from injecting its own repository.
// Else is bypass the centralized repository declarations (settings.gradle)
distBaseUrl = null
}
tasks.register('buildMyHomeApp', PnpmTask) {
def frontDist = file("${myHomeAppDir}/dist")
outputs.dir(frontDist)
// the up-to-date doesn't work as the plugin is used two times : here in root project
// and when using aop includeBuild to built the main front.
// Instead, build my-home application if the dist doesn't exist or if the task is invoked explicitly
onlyIf {
boolean outputExists = frontDist.exists() && frontDist.list()?.length > 0
boolean isExplicitlyRequested = gradle.startParameter.taskNames.any { requestedTask ->
requestedTask == name || requestedTask == path
}
return isExplicitlyRequested || !outputExists
}
dependsOn 'pnpmInstall'
args = ['run', 'build']
}
clean {
delete "${myHomeAppDir}/dist"
delete "${myHomeAppDir}/node_modules"
}
tasks.register("copyMyHomeApp", Copy) {
dependsOn 'buildMyHomeApp'
from tasks.named('buildMyHomeApp').get().outputs
into layout.buildDirectory.dir("webapp/${myHomeAppDir}")
}
tasks.named("copyWebapp") {
dependsOn 'copyMyHomeApp'
}