-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
157 lines (137 loc) · 4.16 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
import java.time.LocalDateTime
import java.time.format.DateTimeFormatter
plugins {
id 'java-library'
id 'checkstyle'
id 'org.sonarqube' version '3.1.1'
id 'jacoco'
id 'maven-publish'
id 'signing'
}
group 'io.github.pepperkit'
version '1.0.0'
sonarqube {
properties {
property "sonar.projectKey", "aukhatov_retry"
property "sonar.organization", "aukhatov"
property "sonar.host.url", "https://sonarcloud.io"
property "sonar.coverage.jacoco.xmlReportPaths", "${buildDir}/reports/jacoco.xml"
}
}
jacoco {
toolVersion = "0.8.6"
}
jacocoTestReport {
dependsOn test
reports {
xml.enabled true
csv.enabled false
html.enabled false
xml.destination file("${buildDir}/reports/jacoco.xml")
}
}
repositories {
mavenCentral()
}
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
}
test {
useJUnitPlatform()
finalizedBy jacocoTestReport
}
checkstyle {
toolVersion '8.42'
config project.resources.text
.fromUri(new URI("https://raw.githubusercontent.com/pepperkit/checkstyle/v1.0.0-8.45/checkstyle.xml"))
}
tasks.withType(Javadoc) {
options.encoding = 'UTF-8'
}
jar {
manifest {
def buildDate = LocalDateTime.now().format(DateTimeFormatter.ISO_DATE_TIME)
attributes(
'Project': project.name,
'Version': "${archiveVersion.get()}",
'Build-Time': buildDate,
'Implementation-Build': 'git rev-parse HEAD'.execute().text.trim(),
'Created-By': 'Pepper Kit https://pepperkit.github.io/'
)
}
}
task sourceJar(type: Jar) {
classifier "sources"
from sourceSets.main.allJava
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier "javadoc"
from javadoc.destinationDir
}
artifacts {
archives jar
archives sourceJar
archives javadocJar
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
publishing {
repositories {
maven {
def releasesRepoUrl = "https://s01.oss.sonatype.org/content/repositories/releases/"
def snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username "$System.env.USERNAME"
password "$System.env.PASSWORD"
}
}
}
publications {
mavenJava(MavenPublication) {
artifactId project.name
groupId group
version version
artifact "${buildDir}/libs/${project.name}-${version}.jar"
artifact(sourceJar) {
classifier = 'sources'
}
artifact(javadocJar) {
classifier = 'javadoc'
}
pom {
name = project.name
description = 'This is a simple and lightweight retry library for Java. It helps you transparently retry failed operations.'
url = 'https://pepperkit.github.io/'
packaging 'jar'
licenses {
license {
name = 'MIT License'
url = 'https://github.com/pepperkit/retry/blob/master/LICENSE'
}
}
developers {
developer {
id = 'aaukhatov'
name = 'Artur Aukhatov'
email = 'aaukhatov@gmail.com'
}
}
scm {
connection = 'scm:git:git://github.com:pepperkit/retry.git'
developerConnection = 'scm:git:ssh://github.com:pepperkit/retry.git'
url = 'https://github.com/pepperkit/retry'
}
}
}
}
}
signing {
sign publishing.publications.mavenJava
def signingKey = "$System.env.GPG_KEY"
def signingPassword = "$System.env.GPG_PASSWORD"
useInMemoryPgpKeys(signingKey, signingPassword)
}