-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
142 lines (120 loc) · 4.2 KB
/
build.gradle
File metadata and controls
142 lines (120 loc) · 4.2 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
135
136
137
138
139
140
141
142
////////////////////////////////////////////////////////////////////////////////////////////
// This file is generated by Speakeasy and any edits will be lost in generation updates.
//
// If you wish to customize this file then place those customizations in `build-extras.gradle` which
// is not touched by generation updates.
//
// Additions to the plugins block can be made by setting the `additionalPlugins` property (an array
// of string where each string value is an additional line in the block) in gen.yaml.
////////////////////////////////////////////////////////////////////////////////////////////
plugins {
// Apply the java-library plugin for API and implementation separation.
id 'java-library'
id 'maven-publish'
id 'signing'
// V2 publishing plugin (Sonatype Central Portal)
id 'cl.franciscosolis.sonatype-central-upload' version '1.0.3'
id "io.spring.dependency-management" version "1.1.6" apply false
}
compileJava.options.encoding = "UTF-8"
compileJava.options.compilerArgs += '-Xlint:unchecked'
compileTestJava.options.encoding = "UTF-8"
repositories {
// Use Maven Central for resolving dependencies.
mavenCentral()
}
java {
withSourcesJar()
withJavadocJar()
}
version = "${version}"
group = "${groupId}"
jar {
dependsOn 'generatePomFileForMavenPublication'
archiveBaseName = "${artifactId}"
into("META-INF/maven/com.glean.api-client/glean-api-client") {
from(layout.buildDirectory.file("pom.xml")) {
// Only include if it exists to avoid build ordering issues
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
}
}
javadoc {
options.encoding = "UTF-8"
if(JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
options.addStringOption('Xdoclint:none', '-quiet')
}
tasks.withType(Javadoc).configureEach {
failOnError = false
options.addStringOption('Xdoclint:none', '-quiet')
}
tasks.withType(JavaCompile).configureEach {
options.release = 11
}
sourcesJar {
archiveBaseName = "${artifactId}"
}
javadocJar {
archiveBaseName = "${artifactId}"
}
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'
implementation 'jakarta.annotation:jakarta.annotation-api:3.0.0'
api 'org.reactivestreams:reactive-streams:1.0.4'
}
ext {
springBootVersion = '2.7.18'
}
subprojects {
if (name in [
'glean-api-client-spring-boot-autoconfigure',
'glean-api-client-spring-boot-starter'
]) {
// Ensure subprojects use the same group and version as root project
group = rootProject.group
version = rootProject.version
apply {
plugin "java-library"
plugin "io.spring.dependency-management"
plugin "maven-publish"
plugin "signing"
plugin "cl.franciscosolis.sonatype-central-upload"
}
dependencyManagement {
imports {
mavenBom "org.springframework.boot:spring-boot-dependencies:${rootProject.springBootVersion}"
}
}
repositories {
mavenCentral()
}
java {
withSourcesJar()
withJavadocJar()
}
tasks.withType(JavaCompile).configureEach {
options.release = 11
}
// Apply publishing configuration to all subprojects - they'll check for publishingConfig internally
apply from: rootProject.file('publishing.gradle')
}
}
ext {
publishingConfig = [
groupId: group,
artifactId: artifactId,
version: version,
name: "Glean Java SDK",
description: "SDK enabling Java developers to easily integrate with the Glean API.",
publicationName: "maven"
]
}
apply from: 'publishing.gradle'
apply from: 'build-extras.gradle'