-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
129 lines (110 loc) · 3.7 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
plugins {
id 'java'
id 'jacoco'
id 'org.jetbrains.kotlin.jvm' version '2.0.0'
id 'maven-publish'
id 'signing'
}
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
group 'io.github.nathancheshire'
version '2.0.5'
def ossrhUsername = project.findProperty("ossrhUsername") ?: System.getenv("OSSRH_USERNAME")
def ossrhToken = project.findProperty("ossrhToken") ?: System.getenv("OSSRH_TOKEN")
def signingKey = project.findProperty("signing.key") ?: System.getenv("SIGNING_KEY")
def signingPassword = project.findProperty("signing.password") ?: System.getenv("SIGNING_PASSWORD")
repositories {
mavenCentral()
}
ext {
junitVersion = '5.7.0'
mockitoVersion = '3.9.0'
guavaVersion = '32.1.3-jre'
gsonVersion = '2.8.8'
powerMockVersion = '2.0.9'
}
dependencies {
testImplementation "org.junit.jupiter:junit-jupiter-api:${junitVersion}"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junitVersion}"
testImplementation "org.mockito:mockito-core:${mockitoVersion}"
testImplementation "org.mockito:mockito-junit-jupiter:${mockitoVersion}"
testImplementation "org.powermock:powermock-module-junit4:${powerMockVersion}"
testImplementation "org.powermock:powermock-api-mockito2:${powerMockVersion}"
implementation "com.google.guava:guava:${guavaVersion}"
implementation "com.google.code.gson:gson:${gsonVersion}"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
}
test {
useJUnitPlatform()
}
jacocoTestReport {
reports {
xml.enabled true
xml.outputLocation.set(file("$buildDir/reports/jacoco/test/xml/index.xml"))
html.enabled false
}
}
compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
groupId = 'io.github.nathancheshire'
artifactId = 'gravatar-java-client'
version = '2.0.5'
pom {
name = 'Gravatar Java Client'
description = 'A Java client library for Gravatar integration.'
url = 'https://github.com/nathancheshire/gravatar-java-client'
licenses {
license {
name = 'The MIT License'
url = 'https://opensource.org/licenses/MIT'
distribution = 'repo'
}
}
developers {
developer {
id = 'nathancheshire'
name = 'Nathan Cheshire'
email = 'nate@nathancheshire.com'
}
}
scm {
connection = 'scm:git:git://github.com/nathancheshire/gravatar-java-client.git'
developerConnection = 'scm:git:ssh://github.com/nathancheshire/gravatar-java-client.git'
url = 'https://github.com/nathancheshire/gravatar-java-client'
}
}
}
}
repositories {
maven {
name = "OSSRH"
url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials {
username = ossrhUsername
password = ossrhToken // Using token as password equivalent
}
}
}
}
signing {
if (signingKey && signingPassword) {
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications.mavenJava
} else {
println 'Signing is disabled because GPG key or password is not provided.'
}
}