-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathbuild.gradle
164 lines (144 loc) · 4.69 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
158
159
160
161
162
163
164
plugins {
id 'java'
id 'signing'
id 'maven-publish'
id 'com.diffplug.spotless' version '6.13.0'
id 'com.github.hierynomus.license' version '0.16.1'
}
version = '2.3.0'
sourceCompatibility = 1.8
targetCompatibility = 1.8
group = 'com.kintone'
archivesBaseName = 'kintone-java-client'
description = 'API client library for Kintone REST APIs on Java.'
repositories {
mavenCentral()
}
artifacts {
archives jar
}
dependencies {
implementation 'org.apache.httpcomponents.client5:httpclient5:5.3.1'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.17.1'
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.1'
implementation 'org.slf4j:slf4j-api:1.7.36'
compileOnly 'org.projectlombok:lombok:1.18.34'
annotationProcessor 'org.projectlombok:lombok:1.18.34'
testImplementation 'com.google.guava:guava:33.2.1-jre'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3'
testImplementation 'org.assertj:assertj-core:3.26.0'
testImplementation 'org.mock-server:mockserver-netty:5.15.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.3'
}
downloadLicenses {
dependencyConfiguration = "testRuntimeClasspath"
}
processResources {
filesMatching('config.properties') {
expand version: project.version
}
}
spotless {
java {
googleJavaFormat()
indentWithTabs(2)
indentWithSpaces(4)
removeUnusedImports()
trimTrailingWhitespace()
endWithNewline()
}
}
tasks.withType(JavaCompile) {
options.compilerArgs << '-Xlint'
}
test {
useJUnitPlatform()
}
task delombok {
description 'Delomboks the source code'
doFirst {
ant.taskdef(classname: 'lombok.delombok.ant.Tasks$Delombok', classpath: configurations.compileClasspath.asPath, name: 'delombok')
ant.mkdir(dir: 'build/src-delomboked')
ant.delombok(verbose: 'true', encoding: 'UTF-8', to: 'build/src-delomboked', classpath: configurations.compileClasspath.asPath) {
ant.fileset(dir: 'src/main/java') {
include(name: '**/*.java')
}
}
}
}
javadoc {
dependsOn delombok
source = files('build/src-delomboked')
options.overview("src/javadoc/overview.html")
options.locale("en_US") // generates javadoc in English
options.noQualifiers("all") // omits all package qualifiers
options.noTimestamp(true) // don't write timestamps in generated pages
options.encoding('UTF-8')
options.docEncoding('UTF-8')
options.charSet('UTF-8')
}
task javadocUpdate(type: Copy) {
description 'Builds javadoc and copies to docs/javadoc'
dependsOn javadoc
from "${buildDir}/docs/javadoc"
into "${projectDir}/docs/javadoc"
include '**/*.html'
include '**/*.js'
include '**/*.css'
}
task sourceJar(type: Jar) {
dependsOn delombok
classifier 'sources'
from 'build/src-delomboked'
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = 'kintone-java-client'
from components.java
artifact sourceJar
artifact javadocJar
pom {
name = 'kintone-java-client'
description = 'API client library for Kintone REST APIs on Java.'
url = 'https://github.com/kintone/kintone-java-client'
licenses {
license {
name = 'The MIT License'
url = 'https://opensource.org/licenses/MIT'
}
}
developers {
developer {
name = 'cybozu'
email = '[email protected]'
}
}
scm {
connection = 'https://github.com/kintone/kintone-java-client.git'
url = 'https://github.com/kintone/kintone-java-client'
}
}
}
}
repositories {
maven {
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2"
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
if (project.hasProperty('sonatypeUsername') && project.hasProperty('sonatypePassword')) {
credentials {
username = "${sonatypeUsername}"
password = "${sonatypePassword}"
}
}
}
}
}
signing {
sign publishing.publications.mavenJava
}