-
Notifications
You must be signed in to change notification settings - Fork 102
/
Copy pathbuild.gradle
234 lines (197 loc) · 9.8 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
231
232
233
234
/*
* Copyright 2014-2019 Riccardo Massera (TheCoder4.Eu)
*
* This file is part of BootsFaces.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
ext.extractedResources=project(':gradleResources:Bootstrap').buildDir.toString()+'/extracted'
ext.BootstrapFolder = extractedResources+'/bootstrap-'+BootstrapVersion
ext.BootswatchFolder = extractedResources+'/bootswatch-'+BootswatchFullVersion.replace('+','-')
ext.PatternFlyFolder = extractedResources+'/patternfly-'+PatternFlyVersion
ext.staticResourcesDir = "${projectDir}/staticResources"
ext.assetResources=project(':gradleResources:compileLess').projectDir.toString()+'/build/assets'
/*
* Tasks to Copy STATIC files to resources
*/
task copyCssResources(type: Copy) {
from 'staticResources/css/ext/bootstrap-datetimepicker.min.css'
from 'staticResources/css/ext/dataTables.checkboxes.css'
from "staticResources/css/ext/bootstrap-multiselect.css"
from 'staticResources/css/ext/bootstrap-switch.css'
from 'staticResources/css/ext/bootstrap-tagsinput.css'
from 'staticResources/css/ext/bootstrap-tagsinput-typeahead.css'
from 'staticResources/css/ext/input-tags.css'
from 'staticResources/css/ext/bootstrap-slider.min.css'
from 'staticResources/css/ext/bootstrap-touchspin.min.css'
from 'staticResources/css/ext/bootstrap-tree.css'
from 'staticResources/css/ext/bootstrap-treeview.min.css'
from 'staticResources/css/ext/animate.css'
from 'staticResources/css/ext/dropdown-submenu.css'
from 'staticResources/css/ext/sticky-footer-navbar.css'
from 'staticResources/css/ext/fullcalendar.min.css'
from 'staticResources/css/ext/jssocials.css'
from 'staticResources/css/ext/scrollup.css'
from 'staticResources/css/ext/select2.min.css'
from 'staticResources/css/ext/typeahead.css'
from 'staticResources/css/ext/datatables.min.css'
from 'staticResources/css/ext/datatables.mark.min.css'
from 'staticResources/css/ext/jq.ui.core.css'
from 'staticResources/css/ext/jq.ui.datepicker.css'
from 'staticResources/css/ext/jq.ui.slider.css'
from 'staticResources/css/ext/jq.ui.theme.css'
from 'staticResources/css/ext/jquery.minicolors.css'
into "${buildDir}/resources/META-INF/resources/bsf/css"
}
task copyJsResources(type: Copy) {
description 'BootsFaces task: copies additional JS files to the target folder (i.e. files that are not part of Bootstrap).'
from 'staticResources/js/bootstrap-multiselect-collapsible-groups.js'
from 'staticResources/js/bootstrap-multiselect.js'
from 'staticResources/js/bootstrap-switch.js'
from 'staticResources/js/bootstrap-slider.min.js'
from 'staticResources/js/bootstrap-touchspin.min.js'
from 'staticResources/js/bootstrap-tagsinput.min.js'
from 'staticResources/js/bootstrap-tree.js'
from 'staticResources/js/bootstrap-treeview.min.js'
from 'staticResources/js/bootstrap-notify.min.js'
from 'staticResources/js/bootstrap-datetimepicker.min.js'
from 'staticResources/js/dataTables.checkboxes.min.js'
from 'staticResources/js/moment-with-locales.min.js'
from 'staticResources/js/fullcalendar.min.js'
from 'staticResources/js/fullcalendar-lang-all.js'
from 'staticResources/js/image-loader.js'
from 'staticResources/js/jquery.blockUI.js'
from 'staticResources/js/jquery.inputmask.bundle.min.js'
from 'staticResources/js/jquery.scrollUp.min.js'
from 'staticResources/js/jquery.minicolors.min.js'
from 'staticResources/js/select2.min.js'
from 'staticResources/js/typeahead.js'
from 'staticResources/js/datatables.min.js'
from 'staticResources/js/pdfmake.min.js'
from 'staticResources/js/vfs_fonts.js'
from 'staticResources/js/datatables.mark.min.js'
from 'staticResources/js/mark.js-jquery.mark.min.js'
from 'staticResources/ie8support/respond.js'
from 'staticResources/ie8support/html5shiv.js'
from 'staticResources/js/jssocials.min.js'
into "${buildDir}/resources/META-INF/resources/bsf/js"
}
task copyImageResources(type: Copy) {
description 'BootsFaces task: copies additional image files to the target folder (i.e. files that are not part of Bootstrap).'
from 'staticResources/images/waitcursor.gif'
from 'staticResources/images/jquery.minicolors.png'
into "${buildDir}/resources/META-INF/resources/bsf/images"
}
task copyJqResources(type: Copy) {
description 'BootsFaces task: copies the jQuery JS files to the target folder.'
from 'staticResources/jq/'+jqversion
from 'staticResources/jq/assets'
into "${buildDir}/resources/META-INF/resources/bsf/jq"
}
task copyBootsFacesResources(dependsOn: [':gradleResources:Bootstrap:downloadResources','copyCssResources', 'copyJsResources', 'copyImageResources', 'copyJqResources']) {
}
/* END Tasks to Copy STATIC files to resources */
/*
* Tasks to Copy ASSET files to resources
*/
allThemes.each {
//create a dynamic task for each theme (in the config phase)
def themeName ->
tasks.create(name: "copyAssetCssTheme2$themeName", type: Copy) {
println "Configure Task copyAssetCssTheme2$themeName from ${assetResources}/"+themeName
from "${assetResources}/"+themeName
into "${buildDir}/resources/META-INF/resources/bsf/css/"+themeName
exclude 'bs-icons*'
// Use a closure to map the file name
rename { String fileName ->
fileName.replace('bs-', '')
}
}
}
task copyAssetCss2Resources(dependsOn: [tasks.matching { Task task -> task.name.startsWith("copyAssetCssTheme2")}]) {
}
task copyIconsCss2Resources(type: Copy) {
description 'BootsFaces task: copies the Icons CSS to the final folder.'
from "${assetResources}/default"
into "${buildDir}/resources/META-INF/resources/bsf/css"
include 'bs-icons.css'
// Use a closure to map the file name
rename { String fileName ->
fileName.replace('bs-', '')
}
}
task copyAssetJs2Resources(type: Copy) {
description 'BootsFaces task: copies the Bootstrap JS file to the target folder.'
from "${assetResources}/js"
into "${buildDir}/resources/META-INF/resources/bsf/js"
exclude "*-*.js*"
exclude "*.gz"
}
task copyBsfCss(type: Copy) {
description 'BootsFaces task: copies the bsf.css file. bsf.css contains the common non-compiled CSS rules of BootsFaces.'
from "${assetResources}/bsf.css"
into "${buildDir}/resources/META-INF/resources/bsf/css"
}
task copyBsfJs(type: Copy) {
description 'BootsFaces task: copies the bsf.js file. bsf.js contains the AJAX JS engine of BootsFaces.'
from "${assetResources}/bsf.js"
into "${buildDir}/resources/META-INF/resources/bsf/js"
}
task copyBootstrapFonts(type: Copy) {
description 'BootsFaces task: copies the Bootstrap fonts to the resources folder.'
from BootstrapFolder+'/fonts'
into "${buildDir}/resources/META-INF/resources/fonts"
}
task copyAssetResources(dependsOn: ['copyAssetCss2Resources','copyIconsCss2Resources', 'copyAssetJs2Resources', 'copyBsfCss', 'copyBsfJs', 'copyBootstrapFonts']) {
description 'BootsFaces task: copies Asset resources to the resources folder.'
}
copyAssetResources.mustRunAfter copyBootsFacesResources
copyAssetResources.mustRunAfter ':gradleResources:compileLess:compileAndMinify'
/* END Tasks to Copy ASSET files to resources */
task copyLicensesToMetaInf(type: Copy) {
from project(':').projectDir.toString()+'/licenses'
into "${buildDir}/resources/META-INF/licenses"
}
copyLicensesToMetaInf.mustRunAfter copyAssetResources
task updateGradleResources(type: Copy) {
description 'BootsFaces task: completes the files generated by the Gradle build by the files cached in the Maven build directory.'
from "${projectDir}/../mavenResources/META-INF/resources/bsf/css/other"
into "${buildDir}/resources/META-INF/resources/bsf/css/other"
}
updateGradleResources.mustRunAfter copyAssetResources
/*
* Tasks for Maven
*/
task cleanMavenResources(type: Delete) {
description 'BootsFaces task: deletes every file in the mavenResource folder.'
delete fileTree(dir: "${projectDir}/../mavenResources/META-INF/resources/fonts")
delete fileTree(dir: "${projectDir}/../mavenResources/META-INF/resources/bsf/css")
delete fileTree(dir: "${projectDir}/../mavenResources/META-INF/resources/bsf/jq")
delete fileTree(dir: "${projectDir}/../mavenResources/META-INF/resources/bsf/js")
}
cleanMavenResources.mustRunAfter updateGradleResources
task updateMavenResources(type: Copy) {
description 'BootsFaces task: replaces every file in the mavenResource folder by the file generated by the Gradle build.'
from "${buildDir}/resources/"
into "${projectDir}/../mavenResources"
}
updateMavenResources.mustRunAfter cleanMavenResources
/* END Tasks for Maven */
/* MAIN Task */
task buildResources(dependsOn: [':gradleResources:Bootstrap:downloadResources', 'copyBootsFacesResources',
':gradleResources:compileLess:compileAndMinify', 'copyAssetResources',
'updateGradleResources', //updateGradleResources just copies "other" Theme
'cleanMavenResources', 'updateMavenResources','copyLicensesToMetaInf']) {
description 'BootsFaces task: downloads Bootstrap from the internet and generates both the mavenResource folder and the Gradle resource folder from scratch.'
}
//defaultTasks 'buildResources'