-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
112 lines (101 loc) · 3.32 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
import java.nio.charset.StandardCharsets
import java.util.stream.Collectors
plugins {
id 'java-library'
id 'io.freefair.lombok' version '6.6.1'
id 'maven-publish'
id 'signing'
}
group 'io.github.ya-b'
version '0.1.3'
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
repositories {
mavenCentral()
}
dependencies {
implementation 'net.jodah:expiringmap:0.5.10'
implementation 'com.google.code.gson:gson:2.10'
implementation 'com.squareup.okhttp3:okhttp:4.10.0'
implementation 'org.apache.commons:commons-compress:1.22'
implementation 'org.slf4j:slf4j-api:2.0.6'
testImplementation 'ch.qos.logback:logback-classic:1.3.0'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
}
test {
useJUnitPlatform()
}
java {
withJavadocJar()
withSourcesJar()
}
javadoc {
if(JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
options.encoding = "UTF-8"
failOnError = false
}
publishing {
publications {
mavenJava(MavenPublication) {
artifactId project.name
from components.java
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
pom {
name = 'registry-client'
description = 'A java client for docker registry api v2'
url = 'https://github.com/ya-b/registry-client.git'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http:https://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'ya-b'
name = 'yangbo'
email = '[email protected]'
}
}
scm {
url = 'https://github.com/ya-b/registry-client.git'
connection = 'scm:git:https://github.com/ya-b/registry-client.git'
developerConnection = 'scm:git:https://github.com/ya-b/registry-client.git'
}
}
}
}
repositories {
maven {
def releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username System.getenv("SONATYPE_USERNAME")
password System.getenv("SONATYPE_PASSWORD")
}
}
}
signing {
sign publishing.publications.mavenJava
}
}
static def updateReadMeVersion(String ver) {
var file = new File("README.md")
var content = new String(file.readBytes())
var newContent = content.replaceAll("<version>\\d+\\.\\d+\\.\\d+</version>", "<version>$ver</version>")
if (newContent != content) {
file.write(newContent)
}
}
updateReadMeVersion(version)