-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.gradle
140 lines (115 loc) · 3.64 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
buildscript {
repositories {
mavenCentral()
}
}
allprojects {
apply plugin: 'java'
apply plugin: 'jacoco'
apply plugin: 'maven-publish'
apply plugin: 'signing'
sourceCompatibility = 1.8
targetCompatibility = 1.8
group 'at.stefangeyer.challonge'
version '2.2.0-SNAPSHOT'
repositories {
mavenCentral()
}
jacoco {
toolVersion = "0.8.2"
}
}
subprojects {
dependencies {
testCompile group: 'junit', name: 'junit', version: property('junit.version')
testCompile group: 'org.mockito', name: 'mockito-core', version: property('mockito.version')
}
javadoc {
if (JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}
task sourcesJar(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
task javadocJar(type: Jar) {
from javadoc
classifier = 'javadoc'
}
publishing {
repositories {
maven {
credentials {
if (project.hasProperty('ossrhUsername') && project.hasProperty('ossrhPassword')) {
username project.ossrhUsername
password project.ossrhPassword
}
}
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
}
}
publications {
mavenJava(MavenPublication) {
afterEvaluate {
artifactId = jar.baseName
}
artifact sourcesJar
artifact javadocJar
from components.java
pom {
url = 'https://github.com/stefangeyer/challonge-java'
licenses {
license {
name = 'The MIT License'
url = 'https://github.com/stefangeyer/challonge-java/blob/master/LICENSE.txt'
}
}
developers {
developer {
id = 'sgeyer'
name = 'Stefan Geyer'
email = 'stefangeyer@outlook.com'
}
}
scm {
connection = 'scm:git:git://github.com/stefangeyer/challonge-java.git'
developerConnection = 'scm:git:ssh://github.com/stefangeyer/challonge-java.git'
url = 'https://github.com/stefangeyer/challonge-java'
}
}
}
}
}
signing {
useGpgCmd()
sign publishing.publications.mavenJava
}
}
task localPublish {
dependsOn('core:localPublish')
dependsOn('serializers:localPublish')
dependsOn('rest:localPublish')
}
task remotePublish {
dependsOn('core:remotePublish')
dependsOn('serializers:remotePublish')
dependsOn('rest:remotePublish')
}
task codeCoverageReport(type: JacocoReport) {
executionData fileTree(project.rootDir.absolutePath).include("**/build/jacoco/*.exec")
subprojects.each {
sourceSets it.sourceSets.main
}
reports {
xml.enabled true
xml.destination file("$buildDir/reports/jacoco/report.xml")
html.enabled false
csv.enabled false
}
}
codeCoverageReport.dependsOn {
subprojects*.test
}