-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
159 lines (138 loc) · 4.06 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
/**
* 构建的配置
*/
buildscript {
apply plugin: 'groovy'
ext {
springBootVersion = '1.5.3.RELEASE'
}
repositories {
mavenLocal()
jcenter()
maven { url "https://repo.spring.io/snapshot" }
maven { url "https://repo.spring.io/milestone" }
}
dependencies {
classpath "io.spring.gradle:dependency-management-plugin:0.6.0.RELEASE"
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
// coverage
classpath "org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.6.3"
classpath "net.saliman:gradle-cobertura-plugin:2.3.2"
}
}
/**
* All projects configuration
*/
configure(allprojects) { project ->
group = "org.asion"
version = qualifyVersionIfNecessary(version)
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'idea'
apply plugin: 'net.saliman.cobertura'
apply plugin: 'com.github.kt3k.coveralls'
apply plugin: 'jacoco'
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
ext {
springBootVersion = '1.5.3.RELEASE'
springVersion = '4.3.8.RELEASE'
springCloudVersion = 'Dalston.RELEASE'
springBootAdminVersion = '1.5.0'
platformBomVersion = 'Brussels-SR2'
unitilsBom = '3.4.2'
thymeleafVersion = '3.0.6.RELEASE'
thymeleafLayoutDialectVersion = '2.0.1'
thymeleafJava8timeVersion = '3.0.0.RELEASE'
}
repositories {
mavenLocal()
jcenter()
maven { url "https://repo.spring.io/snapshot" }
maven { url "https://repo.spring.io/milestone" }
}
// noinspection GroovyAssignabilityCheck
jar {
manifest {
attributes 'Created-By': "${System.getProperty("java.version")} (${System.getProperty("java.specification.vendor")})",
'Implementation-Title': project.name,
'Implementation-Version': project.version
}
from("${rootProject.projectDir}/src/dist") {
include "license.txt"
include "notice.txt"
into "META-INF"
expand(copyright: new Date().format("yyyy"), version: project.version)
}
}
idea {
module {
//if you hate browsing Javadoc
downloadJavadoc = false
//and love reading sources :)
downloadSources = true
}
}
}
/**
* spring-boot-base-to-advanced-projects's sub projects configuration
*/
subprojects {
apply plugin: "io.spring.dependency-management"
dependencyManagement {
imports {
mavenBom "org.springframework:spring-framework-bom:${springVersion}"
mavenBom "org.springframework.boot:spring-boot-dependencies:${springBootVersion}"
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
mavenBom "io.spring.platform:platform-bom:${platformBomVersion}"
}
}
// cobertura {
// coverageIgnoreTrivial = true
// }
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
// don't include or exclude anything explicitly by default. See SPR-12085.
}
task javadocJar(type: Jar) {
classifier = "javadoc"
from javadoc
}
artifacts {
archives sourcesJar
archives javadocJar
}
}
/**
* rootProject configuration
*/
configure(rootProject) {
description = "Spring Boot Base to Advanced"
}
def subCoberturaFiles = subprojects.collect { new File(it.projectDir, "/build/cobertura/cobertura.ser") }
cobertura {
coverageFormats = ['html', 'xml'] // coveralls plugin depends on xml format report
coverageSourceDirs = subprojects.sourceSets.main.allSource.srcDirs.flatten()
coverageMergeDatafiles = subCoberturaFiles
}
test.dependsOn(subprojects.test)
task wrapper(type: Wrapper) {
gradleVersion = '3.1'
}
/*
* Support publication of artifacts versioned by topic branch.
* CI builds supply `-P BRANCH_NAME=<TOPIC>` to gradle at build time.
* If <TOPIC> starts with 'SPR-', change version
* from BUILD-SNAPSHOT => <TOPIC>-SNAPSHOT
* e.g. 3.2.1.BUILD-SNAPSHOT => 3.2.1.SPR-1234-SNAPSHOT
*/
def qualifyVersionIfNecessary(version) {
if (rootProject.hasProperty("BRANCH_NAME")) {
def qualifier = rootProject.getProperty("BRANCH_NAME")
if (qualifier.startsWith("SPR-")) {
return version.replace('BUILD', qualifier)
}
}
return version
}