This repository has been archived by the owner on Dec 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
232 lines (199 loc) · 7.21 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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
/* SPDX-License-Identifier: Apache-2.0 */
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.30.0"
}
}
plugins {
id 'java-library'
id "jvm-test-suite"
id "maven-publish"
id "signing"
id "io.freefair.lombok" version "6.3.0"
id "com.diffplug.spotless" version "6.4.0"
id "net.ltgt.errorprone" version "2.0.2"
id "org.ajoberstar.git-publish" version "3.0.1"
id "com.github.johnrengelman.shadow" version "7.1.2"
}
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
group GROUP
version VERSION_NAME
tasks.withType(JavaCompile) {
options.release = project.targetCompatibility.majorVersion as Integer
options.compilerArgs << "-Xlint:all" << "-Xlint:-options" << "-Xlint:-processing"
options.encoding = "UTF-8"
options.errorprone {
// Yes, it does behave in strange ways, but nonetheless is still useful...
disable("StringSplitter")
// Some methods in autogen'd files (defined via overrides) lack a summary. Should be trivial
// to fix by adding the missing summaries.
disable("MissingSummary")
// This check is disabled because of how we have object-based inheritance setup, and the
// inability of Lombok to generate Overrides on its generated builder-related methods.
disable("MissingOverride")
// This check is disabled because of how Lombok works with SuperBuilder and the
// AtlanObject base class not actually containing any members, yet Lombok requiring
// the annotation here for all inherited classes to work.
disable("UnusedVariable")
// Disable checks in generated code since Lombok does some things that error-prone
// may not like (and may even cause error-prone itself to fail out with exceptions
// during its analysis process). For example, combining @SuperBuilder and @Singular
// annotations...
disableWarningsInGeneratedCode = true
}
}
compileJava {
options.compilerArgs << "-Werror"
}
repositories {
mavenCentral()
}
dependencies {
errorprone group: "com.google.errorprone", name: "error_prone_core", version: "2.20.0"
errorproneJavac group: "com.google.errorprone", name: "javac", version:"9+181-r4173-1"
implementation group: "com.atlan", name: "atlan-java", "version": "1.4.0"
implementation "io.numaproj.numaflow:numaflow-java:0.4.8"
api group: "org.slf4j", name: "slf4j-api", version: "2.0.7"
implementation 'org.apache.poi:poi:5.2.3'
implementation 'org.apache.poi:poi-ooxml:5.2.3'
implementation group: "de.siegmar", name: "fastcsv", version: "2.2.2"
implementation platform('software.amazon.awssdk:bom:2.20.96')
implementation 'software.amazon.awssdk:s3:2.20.96'
implementation 'com.amazonaws:aws-lambda-java-core:1.2.2'
implementation 'io.swagger.parser.v3:swagger-parser:2.1.16'
runtimeOnly group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.20.0'
runtimeOnly group: 'org.apache.logging.log4j', name: 'log4j-slf4j2-impl', version: '2.20.0'
testImplementation group: 'org.testng', name: 'testng', version: '7.8.0'
testImplementation group: 'com.github.tomakehurst', name: 'wiremock', version: '2.27.2'
}
jar {
manifest {
attributes("Implementation-Title": POM_NAME,
"Implementation-Version": VERSION_NAME,
"Implementation-Vendor": VENDOR_NAME,
"Bundle-SymbolicName": POM_ARTIFACT_ID,
"Export-Package": "com.atlan.*",
"Multi-Release": "true")
archiveVersion = VERSION_NAME
}
}
lombok {
version = "1.18.24"
}
delombok {
// empty format option, otherwise the default is to use pretty formatting which overrides
// options Lombok config options and does not add generated annotations.
format = [:]
}
apply from: "deploy.gradle"
testing {
suites {
test {
useTestNG()
dependencies {
implementation project
implementation group: 'org.testng', name: 'testng', version: '7.8.0'
implementation group: 'com.github.tomakehurst', name: 'wiremock', version: '2.27.2'
}
sources {
java {
srcDirs = ["src/test/java"]
}
}
}
}
}
tasks.named('check') {
dependsOn(testing.suites.test)
}
spotless {
java {
palantirJavaFormat("2.9.0")
removeUnusedImports()
licenseHeaderFile('LICENSE_HEADER')
}
}
shadowJar {
archiveClassifier = 'jar-with-dependencies'
configurations = [project.configurations.runtimeClasspath]
dependencies {
exclude(dependency('com.atlan:atlan-java:.*'))
exclude(dependency('io.numaproj.numaflow:numaflow-java:.*'))
}
mergeServiceFiles()
}
gitPublish {
repoUri = 'https://github.com/atlanhq/atlan-java-samples.git'
branch = 'gh-pages'
sign = false // disable commit signing
contents {
from(javadoc) {
into '.'
}
}
}
task buildZip(type: Zip) {
from compileJava
from processResources
into('lib') {
from shadowJar
}
}
task DocumentationTemplateLoader(type: JavaExec) {
group = "Execution"
description = "Run the DocumentationTemplateLoader"
classpath = sourceSets.main.runtimeClasspath
mainClass = "com.atlan.samples.loaders.DocumentationTemplateLoader"
}
task EnrichmentLoader(type: JavaExec) {
group = "Execution"
description = "Run the EnrichmentLoader"
classpath = sourceSets.main.runtimeClasspath
mainClass = "com.atlan.samples.loaders.EnrichmentLoader"
}
task AssetLoader(type: JavaExec) {
group = "Execution"
description = "Run the AssetLoader"
classpath = sourceSets.main.runtimeClasspath
mainClass = "com.atlan.samples.loaders.AssetLoader"
}
task ImportAllDataAssets(type: JavaExec) {
group = "Execution"
description = "Run ImportAllDataAssets"
classpath = sourceSets.main.runtimeClasspath
mainClass = "com.atlan.samples.loaders.ImportAllDataAssets"
}
task OpenAPISpecLoader(type: JavaExec) {
group = "Execution"
description = "Run the OpenAPISpecLoader"
classpath = sourceSets.main.runtimeClasspath
mainClass = "com.atlan.samples.loaders.OpenAPISpecLoader"
}
task EnrichmentReporter(type: JavaExec) {
group = "Execution"
description = "Run the EnrichmentReporter"
classpath = sourceSets.main.runtimeClasspath
mainClass = "com.atlan.samples.reporters.EnrichmentReporter"
}
task ExportAllDataAssets(type: JavaExec) {
group = "Execution"
description = "Run ExportAllDataAssets"
classpath = sourceSets.main.runtimeClasspath
mainClass = "com.atlan.samples.reporters.ExportAllDataAssets"
}
task SlackDiscussionReporter(type: JavaExec) {
group = "Execution"
description = "Run the SlackDiscussionReporter"
classpath = sourceSets.main.runtimeClasspath
mainClass = "com.atlan.samples.reporters.SlackDiscussionReporter"
}
task UserReporter(type: JavaExec) {
group = "Execution"
description = "Run the UserReporter"
classpath = sourceSets.main.runtimeClasspath
mainClass = "com.atlan.samples.reporters.UserReporter"
}