-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
185 lines (152 loc) · 5.72 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
plugins {
id "application"
id "java"
id "eclipse"
id "idea"
id 'checkstyle'
id "jacoco"
id "maven-publish"
id "signing"
id 'com.github.spotbugs' version '5.0.4'
id 'org.jetbrains.kotlin.jvm' version '1.6.10'
id 'org.jetbrains.kotlin.plugin.spring' version '1.6.10'
}
description = "Socrates Server"
group = "com.openlattice"
distTar {
archiveName "socrates.tgz"
}
ext.projectName = "socrates"
ext.scmUrl = 'scm:git:https://github.com/openlattice/socrates.git'
ext.connectionUrl = 'scm:git:https://github.com/openlattice/socrates.git'
ext.developerConnectionUrl = 'scm:git:https://github.com/openlattice/socrates.git'
apply from: "../gradles/openlattice.gradle"
def SOCRATES_XMS = "$System.env.SOCRATES_XMS"
def SOCRATES_XMX = "$System.env.SOCRATES_XMX"
def S_ARGS = "$System.env.SOCRATES_ARGS"
def PARALLEL = "$System.env.PARALLELISM"
def GC = "$System.env.GC"
if (SOCRATES_XMS == 'null' || SOCRATES_XMS == null || SOCRATES_XMS == "") {
SOCRATES_XMS = '-Xms1g'
}
if (SOCRATES_XMX == 'null' || SOCRATES_XMX == null || SOCRATES_XMX == "") {
SOCRATES_XMX = '-Xms4g'
}
if (S_ARGS == 'null' || S_ARGS == null || S_ARGS == "") {
S_ARGS = 'spark local'
}
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"
}
mainClassName = "com.openlattice.socrates.Socrates"
applicationDefaultJvmArgs = [SOCRATES_XMS, SOCRATES_XMX, "-server", PARALLEL, GC]
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
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
}
}
spotbugsTest {
reports {
xml.enabled = false
html.enabled = true
}
}
println "Using java args for running ${projectName}: " + Arrays.toString( applicationDefaultJvmArgs )
run {
if (S_ARGS != null) {
args S_ARGS.split()
} else if (System.getProperty("exec.args") != null) {
args System.getProperty("exec.args").split()
}
}
println "Enabled profiles: " + Arrays.toString(run.args)
configurations {
provided
}
configurations.all {
exclude module: 'slf4j-log4j12'
exclude group: 'asm', module: 'asm'
}
sourceSets {
main.compileClasspath += configurations.provided
test.compileClasspath += configurations.provided
test.runtimeClasspath += configurations.provided
}
test {
ignoreFailures = true
}
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}"
implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-csv:${jackson_version}"
implementation "commons-cli:commons-cli:$commons_cli_version"
implementation "org.deeplearning4j:deeplearning4j-core:${deeplearning4j}"
implementation "org.nd4j:nd4j-cuda-9.2-platform:${deeplearning4j}"
implementation "org.nd4j:nd4j-native-platform:${deeplearning4j}"
implementation "org.datavec:datavec-api:${deeplearning4j}"
implementation "org.deeplearning4j:deeplearning4j-parallel-wrapper:${deeplearning4j}"
implementation "org.deeplearning4j:dl4j-spark_2.11:${deeplearning4j}_spark_2"
implementation "org.deeplearning4j:deeplearning4j-ui_2.11:${deeplearning4j}"
implementation("org.apache.hadoop:hadoop-mapreduce-client-core:$hadoop_version") {force = true}
implementation("org.apache.hadoop:hadoop-common:$hadoop_version") {force = true}
implementation("org.apache.hadoop:hadoop-client:$hadoop_version") {force = true}
implementation "org.ow2.asm:asm:$asm_version"
if( project.hasProperty('developmentMode') && project.developmentMode ) {
implementation(project(path: ":rhizome"))
implementation(project(path: ":rhizome", configuration:"tests"))
implementation(project(path: ":rhizome-client"))
implementation(project(path: ":conductor-client"))
} else {
implementation "com.openlattice:rhizome:${rhizome_version}"
implementation "com.openlattice:conductor-client:${conductor_client_version}"
}
/*
* TESTING
*/
testImplementation "junit:junit:${junit_version}"
testImplementation "org.mockito:mockito-all:${mockito_version}"
}
eclipse {
ext.downloadSources = true
ext.downloadJavadoc = true
ext.sourceCompatibility = JavaVersion.VERSION_1_8
ext.targetCompatibility = JavaVersion.VERSION_1_8
}
eclipse.classpath.plusConfigurations += [configurations.provided]
jar {
doFirst {
manifest {
attributes (
"Class-Path": configurations.runtimeClasspath.files.collect { it.getName() }.join(" "),
"Main-Class": mainClassName
)
}
}
}
startScripts {
classpath = files(jar.archiveFile.get().asFile) + classpath.filter { it.getName().startsWith("rhizome") && !it.getName().contains("client") }
}