-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle
120 lines (100 loc) · 3.97 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
/*
Copyright 2010-2017 BusinessCode GmbH, Germany
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.
*/
//--------------------------
// Main BCD-UI build script, responsible for global project settings and providing main bcduiAll entry task
// To keep the BCD-UI subprojects in Eclipse's view together, we preprend 'BCD-UI--' here to each subproject
apply plugin: 'eclipse'
subprojects {
apply plugin: 'eclipse'
eclipse {
project.name = rootProject.name + '--' + project.name
}
}
// We cannot use plugins{}as it doesn't support importing via 'apply from:' (gradle 7)
buildscript {
repositories {
gradlePluginPortal()
}
dependencies {
classpath "com.github.node-gradle:gradle-node-plugin:7.0.2"
}
}
apply plugin: 'com.github.node-gradle.node'
// Project wide settings
logging.captureStandardOutput LogLevel.INFO
// We may be imported elsewhere, these values may be overwritten for that purpose
ext.artifactsBaseName = hasProperty('artifactsBaseName') ? getProperty('artifactsBaseName') : 'bcd-ui'
ext.sharedBuildFilesRoot = hasProperty('sharedBuildFilesRoot') ? getProperty('sharedBuildFilesRoot') : rootProject.rootDir.path
ext.jsBcduiLoader = hasProperty('jsBcduiLoader') ? getProperty('jsBcduiLoader') : 'bcduiLoader.js'
ext.bcduiVersion = getProperty('bcdui.version')
// Derived
ext.jsBcduiLoaderPath = "$rootProject.rootDir/Client/src/js/$jsBcduiLoader"
//------------------------------------------
// Two more specific gradle files help us
allprojects {
apply from: "$sharedBuildFilesRoot/gradle/script/common.gradle"
}
apply from: "$sharedBuildFilesRoot/gradle/script/installTools.gradle"
//--------------------------
// Collects 3 binaries: bcd-ui-core with client + server
task bcduiBuildCore( type: Jar ) {
dependsOn ':Server:jar', ':Client:bcduiDist'
dependsOn bcduiMetaInf
destinationDirectory = file("$buildDir/libs")
includeEmptyDirs = false
archiveBaseName = "$artifactsBaseName-core"
archiveVersion = bcduiVersion
// Just merge the content of the individual projects Server, Client, Theme, JspTaglib
[':Server:jar', ':Client:bcduiDist'].each { subJar ->
def task = tasks.findByPath(subJar)
if (task == null)
return
from zipTree(task.archiveFile.get())
exclude 'META-INF//MANIFEST.MF'
exclude 'META-INF/gitInformation/**'
}
manifest {
attributes( bcduiManifestAttributes() )
}
metaInf {
from bcduiMetaInf
}
}
//************************************
// Clean artifacts
task bcduiClean( type: Delete ) {
group "bcd-ui"
description "Clean binary and docu generated artifacts, leaves 3rdParty tools"
delete buildDir
}
//************************************
// Do a full build and collect jars in build/jar
// Docu's output is found in Docu/build
task bcduiBuildBin {
group "bcd-ui"
description "Build all binary artifacts: Core (Server+Client), Theme and JspTaglib"
// Triggers ApisGenerator, Client and Server an puts core.jar to build/libs
// Triggers JspTaglib, Theme
dependsOn allprojects.collect { subproject ->
subproject.tasks.matching {
it.name != "bcduiBuildBin" && // Skip us (would be circular)
subproject.name != "Docu" && // Skip Docu, gets an extra build task for performance reasons
it.name.startsWith( 'bcduiBuild' ) }
}
// Put jsp.jar, theme.jat next to core.jar into build/libs
doLast {
[':JspTaglib:jar', ':Theme:bcduiThemeDist'].each { subJar ->
copy { from tasks.findByPath(subJar) into "$buildDir/libs" }
}
}
}