-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
134 lines (113 loc) · 4.09 KB
/
Copy pathbuild.gradle
File metadata and controls
134 lines (113 loc) · 4.09 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
130
131
132
133
134
////////////////////////////////////////////////////////////////////////////////////////////
// FastPix Java SDK build configuration.
//
// Project-specific customizations live in `build-extras.gradle`.
////////////////////////////////////////////////////////////////////////////////////////////
plugins {
id "java-library"
id "com.vanniktech.maven.publish" version "0.34.0"
}
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
withSourcesJar()
withJavadocJar()
}
repositories {
mavenCentral()
}
compileJava.options.encoding = "UTF-8"
compileJava.options.compilerArgs += "-Xlint:unchecked"
compileTestJava.options.encoding = "UTF-8"
javadoc {
options.encoding = "UTF-8"
if (JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption("html5", true)
}
options.addStringOption("Xdoclint:none", "-quiet")
}
tasks.withType(Javadoc) {
failOnError false
options.addStringOption('Xdoclint:none', '-quiet')
}
mavenPublishing {
coordinates(
project.findProperty("groupId") as String,
project.findProperty("artifactId") as String,
project.findProperty("version") as String
)
pom {
name.set("FastPix Java SDK")
description.set("SDK enabling Java developers to easily integrate with the FastPix API.")
url.set("https://github.com/FastPix/fastpix-java")
licenses {
license {
name.set("MIT License")
url.set("https://mit-license.org/")
}
}
developers {
developer {
id.set("fastpix")
name.set("FastPix")
email.set("devs@fastpix.com")
}
}
scm {
url.set("https://github.com/FastPix/fastpix-java")
connection.set("scm:git:https://github.com/FastPix/fastpix-java.git")
}
}
}
javadocJar {
archiveBaseName = "${artifactId}"
}
// Fix duplicate javadoc jar issue and task dependency
afterEvaluate {
// Use javadocJar for the dependency instead of plainJavadocJar
def javadocJarTask = tasks.findByName("javadocJar")
def generateMetadataTask = tasks.findByName("generateMetadataFileForMavenPublication")
if (javadocJarTask && generateMetadataTask) {
generateMetadataTask.dependsOn(javadocJarTask)
}
// Remove plainJavadocJar artifact from maven publication to avoid duplicates
// Keep only javadocJar, remove plainJavadocJar if both exist
publishing.publications.named("maven").configure { publication ->
def javadocArtifacts = publication.artifacts.findAll { it.classifier == "javadoc" }
if (javadocArtifacts.size() > 1) {
// Remove artifacts that come from plainJavadocJar task
def plainJavadocJarTask = tasks.findByName("plainJavadocJar")
if (plainJavadocJarTask) {
publication.artifacts.removeAll { artifact ->
artifact.classifier == "javadoc" &&
artifact.file == plainJavadocJarTask.archiveFile.get().asFile
}
}
}
}
}
dependencies {
api "com.fasterxml.jackson.core:jackson-annotations:2.18.2"
implementation "com.fasterxml.jackson.core:jackson-databind:2.18.2"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.18.2"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.18.2"
api("org.openapitools:jackson-databind-nullable:0.2.6") {
exclude group: "com.fasterxml.jackson.core", module: "jackson-databind"
}
implementation "commons-io:commons-io:2.18.0"
api "org.slf4j:slf4j-api:2.0.13"
api "jakarta.annotation:jakarta.annotation-api:2.1.1"
api "org.reactivestreams:reactive-streams:1.0.4"
testImplementation platform("org.junit:junit-bom:5.10.2")
testImplementation "org.junit.jupiter:junit-jupiter"
testRuntimeOnly "org.junit.platform:junit-platform-launcher"
}
test {
useJUnitPlatform()
}
apply from: "build-extras.gradle"
subprojects {
repositories {
mavenCentral()
}
}