-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathbuild.gradle
121 lines (102 loc) · 3.47 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
plugins {
id 'nu.studer.credentials' version '3.0'
id 'java-library'
id 'io.github.gradle-nexus.publish-plugin' version '2.0.0'
id 'maven-publish'
id 'signing'
}
String signingPassword = credentials.forKey('ossSigningPassword') ?: ''
String nexusPassword = credentials.forKey('nexusPassword') ?: ''
String nexusUser = credentials.forKey('nexusUsername') ?: ''
project.ext['signing.password'] = signingPassword
project.ext.nexusPassword = nexusPassword
group = "io.github.rburgst"
archivesBaseName = 'okhttp-digest'
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
repositories {
mavenLocal()
mavenCentral()
}
ext {
mockitoVersion = "5.14.2"
okhttpVersion = "4.12.0"
}
compileJava.options.encoding = 'UTF-8'
compileTestJava.options.encoding = "UTF-8"
dependencies {
implementation "com.squareup.okhttp3:okhttp:${okhttpVersion}"
testImplementation "com.squareup.okhttp3:logging-interceptor:${okhttpVersion}"
testImplementation "com.squareup.okhttp3:mockwebserver:${okhttpVersion}"
testImplementation "org.junit.jupiter:junit-jupiter-api:5.11.2"
testImplementation "org.junit.jupiter:junit-jupiter:5.11.2"
testImplementation "org.assertj:assertj-core:3.26.3"
testImplementation "org.mockito:mockito-core:${mockitoVersion}"
testImplementation "org.mockito:mockito-junit-jupiter:${mockitoVersion}"
testImplementation 'com.github.tomakehurst:wiremock-jre8:2.35.2'
}
java {
withJavadocJar()
withSourcesJar()
}
publishing {
publications {
maven(MavenPublication) {
from components.java
pom {
name = 'okhttp-digest'
description = 'A digest authenticator for okhttp.'
url = 'https://github.com/rburgst/okhttp-digest'
inceptionYear = '2015'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'rburgst'
name = 'Rainer Burgstaller'
email = '[email protected]'
}
}
scm {
connection = 'scm:git:[email protected]:rburgst/okhttp-digest.git'
developerConnection = 'scm:git:[email protected]:rburgst/okhttp-digest.git'
url = 'https://github.com/rburgst/okhttp-digest'
}
}
}
}
if (project.hasProperty('repositoryUrl')) {
repositories {
maven {
name = "localRepo"
url = uri(project.repositoryUrl)
}
}
}
}
nexusPublishing {
repositories {
sonatype {
username = nexusUser
password = nexusPassword
}
}
}
signing {
required { !project.version.endsWith("-SNAPSHOT") && !project.hasProperty("skipSigning") }
if (project.findProperty("signingKey")) {
useInMemoryPgpKeys(findProperty("signingKey"), signingPassword)
}
sign publishing.publications.maven
}
//do not generate extra load on Nexus with new staging repository if signing fails
tasks.withType(io.github.gradlenexus.publishplugin.InitializeNexusStagingRepository).configureEach {
shouldRunAfter(tasks.withType(Sign))
}
test {
useJUnitPlatform()
}