-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.gradle
More file actions
131 lines (113 loc) · 4.65 KB
/
Copy pathbuild.gradle
File metadata and controls
131 lines (113 loc) · 4.65 KB
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-library'
id 'com.vanniktech.maven.publish' version '0.36.0'
id 'org.openapi.generator' version '7.14.0'
}
repositories {
mavenCentral()
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
// Sources and Javadoc jars are added automatically by the
// com.vanniktech.maven.publish plugin; do not also call
// withSourcesJar()/withJavadocJar() here or artifacts get registered twice.
}
// Java 8 is kept as the compatibility baseline (broad consumer + Android support);
// silence javac's "source/target 8 is obsolete" notice on newer JDKs.
tasks.withType(JavaCompile).configureEach {
options.compilerArgs << '-Xlint:-options'
}
openApiGenerate {
generatorName = 'java'
library = 'okhttp-gson'
inputSpec = "$projectDir/appbrain-api-spec.json"
outputDir = layout.buildDirectory.dir('swagger').get().asFile.toString()
invokerPackage = 'com.appbrain.client'
apiPackage = 'com.appbrain.client.api'
modelPackage = 'com.appbrain.client.model'
configOptions = [
dateLibrary : 'java8',
hideGenerationTimestamp: 'true'
]
generateApiTests = false
generateModelTests = false
generateApiDocumentation = false
generateModelDocumentation = false
}
sourceSets {
main {
java {
srcDir 'src/main/java'
srcDir files(layout.buildDirectory.dir('swagger/src/main/java')).builtBy(tasks.openApiGenerate)
}
}
}
compileJava.dependsOn tasks.openApiGenerate
test {
useJUnitPlatform()
}
version = '1.2.1-SNAPSHOT'
// Publishing goes through the Sonatype Central Publisher Portal
// (central.sonatype.com). The legacy oss.sonatype.org OSSRH service was shut
// down on 2025-06-30. Credentials and the GPG signing key are read from
// Gradle properties / environment variables (see RELEASING.md), never committed.
mavenPublishing {
// Upload to Central Portal; `true` also triggers the release automatically
// once validation passes (drop the argument to release manually in the UI).
publishToMavenCentral(true)
// Signs releases with the configured GPG key; snapshots are left unsigned.
signAllPublications()
coordinates('com.appbrain', 'appbrain-api-client', version.toString())
pom {
name = 'AppBrain API Client'
description = 'The AppBrain API is a web service that allows automated interaction with AppBrain.'
url = 'https://www.appbrain.com/info/help/api/appbrain-api.html'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'appbrain'
name = 'AppBrain Team'
email = 'contact@appbrain.com'
organization = 'AppBrain'
organizationUrl = 'https://www.appbrain.com'
}
}
scm {
connection = 'scm:git:git://github.com/appbrain/appbrain-api-client-java.git'
developerConnection = 'scm:git:ssh://github.com:appbrain/appbrain-api-client-java.git'
url = 'https://github.com/appbrain/appbrain-api-client-java'
}
}
}
javadoc {
// The generated API classes use a custom @http.response.details tag and HTML
// tables; register the tag and relax doclint so javadoc does not fail on them.
options.tags = ['http.response.details:a:Response Details:']
options.addStringOption('Xdoclint:none', '-quiet')
if(JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}
// the recommended gradle plugin to publish artifacts is maven-publish
// however jitpack expects a task "install" which is provided by the older "maven" plugin
task install(dependsOn: 'publishToMavenLocal')
dependencies {
implementation 'com.squareup.okhttp3:okhttp:4.12.0'
implementation 'com.squareup.okhttp3:logging-interceptor:4.12.0'
implementation 'com.google.code.gson:gson:2.14.0'
implementation 'io.gsonfire:gson-fire:1.9.0'
// jsr305 supplies the @Nonnull/@Nullable used on generated fields (runtime
// retention). @javax.annotation.Generated comes from javax.annotation-api and
// is source-retention, so it is only needed at compile time.
implementation 'com.google.code.findbugs:jsr305:3.0.2'
compileOnly 'javax.annotation:javax.annotation-api:1.3.2'
testImplementation 'org.junit.jupiter:junit-jupiter:5.12.2'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.12.2'
}