-
Notifications
You must be signed in to change notification settings - Fork 25
/
build.gradle
230 lines (189 loc) · 6.77 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
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
apply plugin: 'maven'
apply plugin: 'java'
apply plugin: 'com.github.node-gradle.grunt'
apply plugin: 'com.github.node-gradle.node'
group = 'org.ow2.proactive'
version = proactiveDashboardVersion
// Configure the maven repository deployment
install {
repositories.mavenInstaller {
// Set the version
pom.version = proactiveDashboardVersion
// Set the group/namespace for the maven repository deployment.
pom.groupId = 'org.ow2.proactive'
// Give the artifact a 'base name' (The version is added to the 'base name')
pom.artifactId = 'automation-dashboard'
}
}
buildscript {
repositories {
mavenCentral()
maven {
url "http://repository.activeeon.com/content/groups/proactive/"
}
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
// version 1.5.3 is the latest version that supports grunt
classpath 'com.github.node-gradle.grunt:com.github.node-gradle.grunt.gradle.plugin:1.5.3'
classpath 'com.github.node-gradle.node:com.github.node-gradle.node.gradle.plugin:1.5.3'
}
}
node {
// Version of node to use.
version = '14.16.0'
// Version of npm to use.
// npmVersion = '3.8.6'
// Base URL for fetching node distributions (change if you have a mirror).
distBaseUrl = 'http://mirrors.dotsrc.org/nodejs/release'
// If true, it will download node using above parameters.
// If false, it will try to use globally installed node.
download = true
// Set the work directory for unpacking node
workDir = file("${project.buildDir}")
// Set the work directory where node_modules should be located
nodeModulesDir = file("${project.projectDir}")
}
grunt {
// Set the directory where Gruntfile.js should be found
workDir = file("${project.projectDir}")
// Whether colors should output on the terminal
colors = true
// Whether output from Grunt should be buffered - useful when running tasks in parallel
bufferOutput = false
}
repositories {
if (project.hasProperty('local')) {
mavenLocal()
}
mavenCentral()
maven {
url "http://repository.activeeon.com/content/groups/proactive/"
}
}
uploadArchives {
repositories {
mavenDeployer {
snapshotRepository(url: "http://repository.activeeon.com/content/repositories/snapshots/") {
authentication(userName: "${System.getProperty('nexusUsername')}",
password: "${System.getProperty('nexusPassword')}")
}
repository(url: "http://repository.activeeon.com/content/repositories/releases/") {
authentication(userName: "${System.getProperty('nexusUsername')}",
password: "${System.getProperty('nexusPassword')}")
}
}
}
}
jar {
manifest {
}
}
task packageDist(type: Zip) {
from 'dist'
dependsOn grunt_build
}
task packageDev(type: Zip) {
from 'app'
classifier 'dev'
}
task bowerInstall(type: NodeTask) {
script = file('node_modules/bower/bin/bower')
args = ["--config.storage.cache=${gradle.getGradleUserHomeDir()}/caches/bower/cache",
"--config.storage.packages=${gradle.getGradleUserHomeDir()}/caches/bower/packages",
"--config.storage.registry=${gradle.getGradleUserHomeDir()}/caches/bower/registry",
'--allow-root',
'install']
inputs.files file('bower.json')
outputs.files file('bower_components')
dependsOn npmInstall
}
task buildEnterprise(type: GruntTask) {
args = ["build", "--target=enterprise"]
}
task buildCommunity(type: GruntTask) {
args = ["build", "--target=community"]
}
// delete dist folder with clean
clean {
delete "${project.projectDir}/dist"
delete "${project.projectDir}/.tmp"
delete "${project.projectDir}/build"
delete "${project.projectDir}/node_modules"
delete "${project.projectDir}/bower_components"
delete "${project.projectDir}/cloud-automation"
delete "${project.projectDir}/job-planner-portal"
delete "${project.projectDir}/generic-catalog-portal"
delete "${project.projectDir}/notification-portal"
delete "${project.projectDir}/cloud-watch-portal"
delete "${project.projectDir}/job-analytics-portal"
}
artifacts {
archives packageDist, packageDev
}
configurations {
cloudAutomationDep
jobPlannerDep
genericCatalogDep
notificationDep
cloudWatchDep
jobAnalyticsDep
}
dependencies {
cloudAutomationDep "org.ow2.proactive:cloud-automation:$version@zip"
jobPlannerDep "org.ow2.proactive:job-planner-portal:$version@zip"
genericCatalogDep "org.ow2.proactive:generic-catalog-portal:$version@zip"
notificationDep "org.ow2.proactive:notification-portal:$version@zip"
cloudWatchDep "org.ow2.proactive:cloud-watch-portal:$version@zip"
jobAnalyticsDep "org.ow2.proactive:job-analytics-portal:$version@zip"
compile configurations.cloudAutomationDep
compile configurations.jobPlannerDep
compile configurations.genericCatalogDep
compile configurations.notificationDep
compile configurations.cloudWatchDep
compile configurations.jobAnalyticsDep
}
task copyCloudAutomationDep(type: Copy) {
from zipTree(configurations.cloudAutomationDep.singleFile)
into "./cloud-automation/app"
}
task copyJobPlannerDep(type: Copy) {
from zipTree(configurations.jobPlannerDep.singleFile)
into "./job-planner-portal/app"
}
task copyGenericCatalogDep(type: Copy) {
from zipTree(configurations.genericCatalogDep.singleFile)
into "./generic-catalog-portal/app"
}
task copyNotificationDep(type: Copy) {
from zipTree(configurations.notificationDep.singleFile)
into "./notification-portal/app"
}
task copyCloudWatchDep(type: Copy) {
from zipTree(configurations.cloudWatchDep.singleFile)
into "./cloud-watch-portal/app"
}
task copyJobAnalyticsDep(type: Copy) {
from zipTree(configurations.jobAnalyticsDep.singleFile)
into "./job-analytics-portal/app"
}
copyCloudAutomationDep.dependsOn clean
copyJobPlannerDep.dependsOn copyCloudAutomationDep
copyGenericCatalogDep.dependsOn copyJobPlannerDep
copyNotificationDep.dependsOn copyGenericCatalogDep
copyCloudWatchDep.dependsOn copyNotificationDep
copyJobAnalyticsDep.dependsOn copyCloudWatchDep
grunt_build.dependsOn copyJobAnalyticsDep
// makes sure on each build that bower downloaded the dependencies
grunt_build.dependsOn 'bowerInstall'
// makes sure on each build that grunt is installed
grunt_build.dependsOn 'installGrunt'
// processes your package.json before running grunt build
grunt_build.dependsOn 'npmInstall'
// runs "grunt build" as part of your gradle build
build.dependsOn grunt_build
// force building the jar before the install task (needed for release project)
jar.mustRunAfter packageDist
install.dependsOn jar