-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.gradle
119 lines (108 loc) · 3.23 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
plugins {
id 'java-library'
id 'io.freefair.lombok' version '8.10'
id 'maven-publish'
id 'signing'
id 'org.jreleaser' version '1.14.0'
}
group 'io.github.ya-b'
version '0.1.4'
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
repositories {
mavenCentral()
}
dependencies {
implementation 'net.jodah:expiringmap:0.5.11'
implementation 'com.google.code.gson:gson:2.10'
implementation 'com.squareup.okhttp3:okhttp:4.12.0'
implementation 'org.apache.commons:commons-compress:1.26.1'
implementation 'org.slf4j:slf4j-api:2.0.12'
testImplementation 'ch.qos.logback:logback-classic:1.3.0'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.3'
}
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://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 {
url = layout.buildDirectory.dir('staging-deploy')
}
}
}
jreleaser {
signing {
active = 'ALWAYS'
armored = true
}
deploy {
maven {
mavenCentral {
sonatype {
active = 'ALWAYS'
url = 'https://central.sonatype.com/api/v1/publisher'
stagingRepository('build/staging-deploy')
}
}
}
}
}
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)