-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
262 lines (213 loc) · 8.83 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
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmCompile
plugins {
id 'application'
id 'java'
id 'idea'
id 'jacoco'
id 'maven-publish'
id 'checkstyle'
id 'signing'
id 'org.jetbrains.kotlin.jvm' version '1.6.10'
id 'org.jetbrains.kotlin.plugin.spring' version '1.6.10'
id 'org.jetbrains.dokka' version '0.9.18'
id 'com.github.spotbugs' version '5.0.4'
}
description = "Launchpad"
group = "com.openlattice"
ext.projectName = "launchpad"
ext.scmUrl = 'scm:git:https://github.com/openlattice/launchpad.git'
ext.connectionUrl = 'scm:git:https://github.com/openlattice/launchpad.git'
ext.developerConnectionUrl = 'scm:git:https://github.com/openlattice/launchpad.git'
apply from: "../gradles/openlattice.gradle"
/**
* The reason we use source and target compatability instead of toolchain is that toolchain forces use of the --release
* flag. This flag prevents exports of some commonly used internal java apis in order to enforce compliance with public
* api surface of that particular release. The source and target compatibility settings without the --release flag
* instruct the compiler to generate compatible byte code with that version at the risk of allowing the use of
* potentially unsupported APIs on earlier versions. (i.e compiler 17, target/source 11, will create bytecode that
* references an 17 API that isn't available on jdk 11).
*/
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
jacoco {
toolVersion = "0.8.2"
}
checkstyle {
toolVersion = '7.4'
showViolations = false
config project.resources.text.fromUri(rootProject.file('gradles/checkstyle.xml').toURI())
}
tasks.withType(Checkstyle) {
reports {
xml.enabled = false
html.enabled = true
}
}
spotbugs {
reportLevel = 'high'
toolVersion = "${spotbugs_annotations_version}"
}
spotbugsMain {
reports {
xml.enabled = false
html.enabled = true
}
}
mainClassName = "com.openlattice.launchpad.Launchpad"
def LAUNCHPAD_XMS = "$System.env.LAUNCHPAD_XMS"
def LAUNCHPAD_XMX = "$System.env.LAUNCHAPD_XMX"
def LP_ARGS = "$System.env.LAUNCHPAD_ARGS"
def PARALLEL = "$System.env.PARALLELISM"
def GC = "$System.env.GC"
def INCLUDE_AUTHDLL = "-Djava.library.path=\"mssql-jdbc_auth-9.2.0.x64.dll\""
if (LAUNCHPAD_XMS == 'null' || LAUNCHPAD_XMS == null || LAUNCHPAD_XMS == "") {
LAUNCHPAD_XMS = '-Xms1g'
}
if (LAUNCHPAD_XMX == 'null' || LAUNCHPAD_XMX == null || LAUNCHPAD_XMX == "") {
LAUNCHPAD_XMX = '-Xmx4g'
}
if (LP_ARGS == 'null' || LP_ARGS == null || LP_ARGS == "") {
LP_ARGS = ''
}
if (PARALLEL == 'null' || PARALLEL == null || PARALLEL == "") {
PARALLEL = "-Djava.util.concurrent.ForkJoinPool.common.parallelism=" + Runtime.runtime.availableProcessors()
}
if (GC == 'null' || GC == null || GC == "") {
GC = "-XX:+UseG1GC"
}
println "Using java args for running ${projectName}: " + Arrays.toString(applicationDefaultJvmArgs)
applicationDefaultJvmArgs = [LAUNCHPAD_XMS, LAUNCHPAD_XMX, "-server", PARALLEL, GC, INCLUDE_AUTHDLL]
run {
if (LP_ARGS != null) {
args LP_ARGS.split()
} else if (System.getProperty("exec.args") != null) {
args System.getProperty("exec.args").split()
}
}
println "Enabled profiles: " + Arrays.toString(run.args)
configurations {
provided
}
// throws exception if an incorrect version of mssql-jdbc_auth dll exists in src/dist
for (configuration in configurations) {
configuration.getIncoming().afterResolve {
String dllNamePrefix = "mssql-jdbc_auth"
String dllVersionSuffix = "9.2.0.x64.dll"
def authDlls = getAuthDllFiles(dllNamePrefix)
for (authDll in authDlls) {
throwErrorOnIncorrectVersion(authDll, dllVersionSuffix)
}
}
}
FileCollection getAuthDllFiles(String dllNamePrefix) {
return fileTree("src/dist").filter {
it.isFile() && it.name.startsWith(dllNamePrefix)
}
}
void throwErrorOnIncorrectVersion(File authDll, String dllVersionSuffix) {
if (isIncorrectDllVersion(authDll, dllVersionSuffix)) {
String error_msg = "Unexpected mssql integrated security dll version (${authDll.getName()}). Expected version: ${dllVersionSuffix}" +
"\n Please remove unexpected DLL version from src/dist and add expected version if not already present."
throw new GradleException(error_msg)
}
}
boolean isIncorrectDllVersion(File authDll, String dllVersionSuffix) {
return (authDll != null && !authDll.name.endsWith(dllVersionSuffix))
}
configurations.all {
exclude module: 'slf4j-log4j12'
exclude group: 'asm', module: 'asm'
}
test {
useJUnit()
ignoreFailures = true
}
sourceSets {
main.compileClasspath += configurations.provided
test.compileClasspath += configurations.provided
test.runtimeClasspath += configurations.provided
}
jar {
doFirst {
manifest {
attributes (
"Class-Path": configurations.runtimeClasspath.files.collect { it.getName() }.join(" "),
"Main-Class": mainClassName
)
}
}
}
ext.aws_sdk_version='1.11.769'
dependencies {
spotbugsPlugins "com.h3xstream.findsecbugs:findsecbugs-plugin:${findsecbugs_version}"
compileOnly "net.jcip:jcip-annotations:${jcip_version}"
compileOnly "com.github.spotbugs:spotbugs-annotations:${spotbugs_annotations_version}"
testCompileOnly "net.jcip:jcip-annotations:${jcip_version}"
testCompileOnly "com.github.spotbugs:spotbugs-annotations:${spotbugs_annotations_version}"
/*
* SL4J + LOG4J2
*/
implementation group: "org.slf4j", name: "slf4j-api", version: "${slf4j_version}"
implementation group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: "${log4j_version}"
implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: "${log4j_version}"
implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: "${log4j_version}"
implementation group: 'org.apache.logging.log4j', name: 'log4j-web', version: "${log4j_version}"
implementation "commons-cli:commons-cli:$commons_cli_version"
implementation "com.google.guava:guava:${guava_version}"
/*
* SQL
*/
implementation "com.zaxxer:HikariCP:${hikariCP_version}"
implementation "com.microsoft.sqlserver:mssql-jdbc:9.2.0.jre8"
implementation "org.postgresql:postgresql:${postgresql_version}"
implementation fileTree(dir: 'lib/', include: '*.jar')
/*
* SPARK
*/
api "org.apache.spark:spark-core_2.11:${spark_version}"
api "org.apache.spark:spark-sql_2.11:${spark_version}"
implementation "org.apache.hadoop:hadoop-aws:${hadoop_version}"
implementation "org.apache.hadoop:hadoop-hdfs:${hadoop_version}"
implementation "org.apache.hadoop:hadoop-common:${hadoop_version}"
/*
* AWS
*/
implementation "com.amazonaws:aws-java-sdk-s3:${aws_sdk_version}"
/*
* Jackson
*/
implementation "com.fasterxml.jackson.core:jackson-core:${jackson_version}"
implementation "com.fasterxml.jackson.core:jackson-databind:${jackson_version}"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-guava:${jackson_version}"
implementation "com.fasterxml.jackson.module:jackson-module-jaxb-annotations:${jackson_version}"
implementation "com.fasterxml.jackson.module:jackson-module-afterburner:${jackson_version}"
implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-smile:${jackson_version}"
implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:${jackson_version}"
implementation "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:${jackson_version}"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:${jackson_version}"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:${jackson_version}"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jdk8:${jackson_version}"
implementation "com.fasterxml.jackson.module:jackson-module-kotlin:${jackson_version}"
implementation "com.fasterxml.jackson.module:jackson-module-scala_2.11:${jackson_version}"
implementation "org.ow2.asm:asm:${asm_version}"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
/*
* TESTING
*/
testImplementation "junit:junit:${junit_version}"
testImplementation "org.mockito:mockito-all:${mockito_version}"
}
startScripts {
classpath = files(jar.archivePath)
}
compileKotlin {
kotlinOptions {
jvmTarget = "11"
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "11"
}
}