forked from spark-jobserver/spark-jobserver
-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
161 lines (145 loc) · 6.92 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
/*
* Copyright (c) 2017-2022 TIBCO Software Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you
* may not use this file except in compliance with the License. You
* may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
* implied. See the License for the specific language governing
* permissions and limitations under the License. See accompanying
* LICENSE file.
*/
apply plugin: 'scala'
version = sparkJobServerVersion
ext {
nettyGroup = 'io.netty'
scalaMacros = 'org.scalamacros'
scalaTest = 'org.scalatest'
}
scalaStyle {
configLocation = "${projectDir}/scalastyle-config.xml"
inputEncoding = 'UTF-8'
outputEncoding = 'UTF-8'
outputFile = "${buildDir}/scalastyle-output.xml"
includeTestSourceDirectory = false
source = 'src/main/scala'
testSource = 'src/test/scala'
failOnViolation = true
failOnWarning = false
}
tasks.withType(ScalaCompile) {
scalaCompileOptions.deprecation = false
scalaCompileOptions.additionalParameters = [ '-feature', '-language:postfixOps', '-language:implicitConversions' ]
}
tasks.withType(ScalaDoc) {
scalaDocOptions.deprecation = false
scalaDocOptions.additionalParameters = [ '-feature', '-language:postfixOps', '-language:implicitConversions' ]
}
dependencies {
compile 'org.scala-lang:scala-library:' + scalaVersion
compile 'org.scala-lang:scala-reflect:' + scalaVersion
// always use stock spark so that snappy extensions don't get accidently
// included here in jobserver code.
if (System.properties.containsKey('ideaBuild') && new File(rootDir, 'spark/build.gradle').exists()) {
compile project(':snappy-spark:snappy-spark-core_' + scalaBinaryVersion)
compile project(':snappy-spark:snappy-spark-catalyst_' + scalaBinaryVersion)
compile project(':snappy-spark:snappy-spark-sql_' + scalaBinaryVersion)
compile project(':snappy-spark:snappy-spark-mllib_' + scalaBinaryVersion)
compile project(':snappy-spark:snappy-spark-streaming_' + scalaBinaryVersion)
compile project(':snappy-spark:snappy-spark-hive_' + scalaBinaryVersion)
compileOnly "org.eclipse.jetty:jetty-servlet:${jettyVersion}"
testCompile "org.eclipse.jetty:jetty-servlet:${jettyVersion}"
} else {
compileOnly("org.apache.spark:spark-core_${scalaBinaryVersion}:${sparkVersion}") {
exclude(group: nettyGroup)
exclude(group: scalaMacros)
}
compileOnly("org.apache.spark:spark-catalyst_${scalaBinaryVersion}:${sparkVersion}") {
exclude(group: nettyGroup)
exclude(group: scalaMacros)
}
compileOnly("org.apache.spark:spark-sql_${scalaBinaryVersion}:${sparkVersion}") {
exclude(group: nettyGroup)
exclude(group: scalaMacros)
}
compileOnly("org.apache.spark:spark-mllib_${scalaBinaryVersion}:${sparkVersion}") {
exclude(group: nettyGroup)
exclude(group: scalaMacros)
}
compileOnly("org.apache.spark:spark-streaming_${scalaBinaryVersion}:${sparkVersion}") {
exclude(group: nettyGroup)
exclude(group: scalaMacros)
}
compileOnly("org.apache.spark:spark-hive_${scalaBinaryVersion}:${sparkVersion}") {
exclude(group: nettyGroup)
exclude(group: scalaMacros)
exclude(group: scalaTest)
}
testCompile "org.apache.spark:spark-core_${scalaBinaryVersion}:${sparkVersion}"
testCompile "org.apache.spark:spark-catalyst_${scalaBinaryVersion}:${sparkVersion}"
testCompile "org.apache.spark:spark-sql_${scalaBinaryVersion}:${sparkVersion}"
testCompile "org.apache.spark:spark-mllib_${scalaBinaryVersion}:${sparkVersion}"
testCompile "org.apache.spark:spark-streaming_${scalaBinaryVersion}:${sparkVersion}"
testCompile "org.apache.spark:spark-hive_${scalaBinaryVersion}:${sparkVersion}"
}
compileOnly(group: 'io.dropwizard.metrics', name: 'metrics-core', version: metricsVersion) {
exclude(group: 'org.slf4j', module: 'slf4j-api')
exclude(group: 'org.slf4j', module: 'slf4j-log4j12')
}
// akka-appDeps
compile "io.netty:netty:${nettyAkkaVersion}"
compile("com.typesafe.akka:akka-slf4j_${scalaBinaryVersion}:${akkaVersion}") {
exclude(group: 'org.scala-lang', module: 'scala-library')
exclude(group: 'org.scala-lang', module: 'scala-reflect')
exclude(group: 'org.scala-lang', module: 'scala-compiler')
}
compile("com.typesafe.akka:akka-cluster_${scalaBinaryVersion}:${akkaVersion}") {
exclude(group: 'org.scala-lang', module: 'scala-library')
exclude(group: 'org.scala-lang', module: 'scala-reflect')
exclude(group: 'org.scala-lang', module: 'scala-compiler')
}
compile("io.spray:spray-json_${scalaBinaryVersion}:${sprayJsonVersion}") {
exclude(group: 'org.scala-lang', module: 'scala-library')
exclude(group: 'org.scala-lang', module: 'scala-reflect')
exclude(group: 'org.scala-lang', module: 'scala-compiler')
}
compile "io.spray:spray-can_${scalaBinaryVersion}:${sprayVersion}"
compile "io.spray:spray-caching_${scalaBinaryVersion}:${sprayVersion}"
compile("io.spray:spray-routing-shapeless2_${scalaBinaryVersion}:${sprayShapelessVersion}") {
exclude(group: 'org.scala-lang', module: 'scala-library')
}
compile "io.spray:spray-client_${scalaBinaryVersion}:${sprayVersion}"
compile "com.yammer.metrics:metrics-core:${metrics2Version}"
compile("org.joda:joda-convert:${jodaVersion}") {
exclude(group: 'com.google.guava', module: 'guava')
}
compile "joda-time:joda-time:${jodaTimeVersion}"
compile "com.typesafe.slick:slick_${scalaBinaryVersion}:${slickVersion}"
compile "com.h2database:h2:${h2Version}"
compile "commons-pool:commons-pool:${commonsPoolVersion}"
compile "commons-dbcp:commons-dbcp:${dbcpVersion}"
compile "org.flywaydb:flyway-core:${flywayVersion}"
compile "org.apache.shiro:shiro-core:${shiroVersion}"
compile "com.typesafe:config:${typesafeConfigVersion}"
testCompile "${scalaTest}:scalatest_${scalaBinaryVersion}:${scalatestVersion}"
testCompile("com.typesafe.akka:akka-testkit_${scalaBinaryVersion}:${akkaVersion}") {
exclude(group: 'org.scala-lang', module: 'scala-library')
exclude(group: 'org.scala-lang', module: 'scala-reflect')
exclude(group: 'org.scala-lang', module: 'scala-compiler')
}
testCompile "io.spray:spray-testkit_${scalaBinaryVersion}:${sprayTestkitVersion}"
testRuntime "org.pegdown:pegdown:${pegdownVersion}"
}
sourceSets.main.scala.srcDirs = ['akka-app/src', 'job-server-api/src', 'job-server/src',
'job-server-extras/src']
sourceSets.test.scala.srcDirs = ['akka-app/test', 'job-server/test',
'job-server-extras/test', 'job-server-tests/src' ]
sourceSets.main.java.srcDirs = []
sourceSets.test.java.srcDirs = []
sourceSets.main.resources.srcDirs = ['job-server/resources']
sourceSets.test.resources.srcDirs = ['job-server/test-resources']