-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
169 lines (146 loc) · 4.55 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
buildscript {
repositories {
mavenCentral()
jcenter()
maven { url 'https://plugins.gradle.org/m2/' }
}
dependencies {
classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:4.4.0'
classpath 'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:1.2'
}
}
apply plugin: 'groovy'
apply plugin: 'maven'
apply plugin: 'com.jfrog.artifactory'
apply plugin: 'checkstyle'
apply plugin: 'jacoco'
apply from: 'publish-maven.gradle'
apply plugin: 'org.sonarqube'
sonarqube {
properties {
property 'sonar.jacoco.reportPath', "${buildDir}/jacoco/test.exec"
property 'sonar.java.coveragePlugin', 'jacoco'
property 'sonar.links.homepage', 'https://github.com/spring-gradle-plugins/dependency-management-plugin'
property 'sonar.links.issue', 'https://github.com/spring-gradle-plugins/dependency-management-plugin/issues'
property 'sonar.links.scm', 'https://github.com/spring-gradle-plugins/dependency-management-plugin'
}
}
checkstyle {
configFile = rootProject.file('config/checkstyle/checkstyle.xml')
configProperties = [ 'checkstyle.config.dir' : rootProject.file('config/checkstyle') ]
toolVersion = '7.3'
}
repositories {
mavenCentral()
maven { url 'https://repo.gradle.org/gradle/libs-releases' }
}
group = 'io.spring.gradle'
description = 'Dependency Management Plugin'
ext {
cglibVersion = '3.1'
jarjarVersion = '1.2.1'
mavenVersion = '3.0.4'
spockVersion = GroovySystem.version.startsWith('1.') ? '0.7-groovy-1.8' : '0.7-groovy-2.0'
}
sourceCompatibility = 1.6
targetCompatibility = 1.6
configurations {
jarjar
maven
}
task mavenRepackJar(type: Jar) { repackJar ->
repackJar.baseName = "maven-repack"
repackJar.version = mavenVersion
doLast() {
project.ant {
taskdef name: "jarjar", classname: "com.tonicsystems.jarjar.JarJarTask", classpath: configurations.jarjar.asPath
jarjar(destfile: repackJar.archivePath) {
configurations.maven.each { originalJar ->
zipfileset(src: originalJar)
}
rule(pattern: 'org.**', result: 'io.spring.gradle.dependencymanagement.org.@1')
}
}
}
}
dependencies {
compile gradleApi()
compile localGroovy()
compile(files(mavenRepackJar))
jarjar "org.gradle.jarjar:jarjar:$jarjarVersion"
maven "org.apache.maven:maven-model-builder:$mavenVersion"
testCompile("org.spockframework:spock-core:$spockVersion") {
exclude group: 'org.codehaus.groovy'
}
testCompile "cglib:cglib-nodep:$cglibVersion"
testCompile gradleTestKit()
}
jar {
dependsOn mavenRepackJar
from(zipTree(mavenRepackJar.archivePath)) {
include 'io/spring/gradle/**'
include 'META-INF/plexus/**'
}
manifest {
attributes(
'Created-By': "${System.properties['java.version']} (${System.properties['java.vendor']} ${System.properties['java.vm.version']})".toString(),
'Implementation-Title': project.description,
'Implementation-Version': project.version,
'Implementation-Vendor': 'Pivotal Software, Inc.'
)
}
}
javadoc {
title = "$project.description $project.version API"
exclude 'io/spring/gradle/dependencymanagement/internal/**'
options {
links "https://docs.gradle.org/${GradleVersion.current().version}/javadoc/",
'https://docs.oracle.com/javase/6/docs/api/',
"http://docs.groovy-lang.org/${GroovySystem.version}/html/gapi/"
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar) {
classifier = "javadoc"
from javadoc
}
artifacts {
archives sourcesJar
archives javadocJar
}
jacoco {
toolVersion = '0.7.8'
}
test {
testLogging {
quiet {
events 'failed'
exceptionFormat 'full'
}
exceptionFormat 'full'
}
}
artifactory {
contextUrl = 'https://repo.spring.io'
publish {
repository {
repoKey = artifactoryRepository
if (project.hasProperty('artifactoryUsername')
&& project.hasProperty('artifactoryPassword')) {
username = artifactoryUsername
password = artifactoryPassword
}
}
}
}
artifactoryPublish {
publishConfigs 'archives'
publishIvy false
properties = [
'bintray.package': "${project.group}:dependency-management",
'bintray.version': "${project.version}"
]
}