-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
96 lines (77 loc) · 2.5 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
def checkUserProperty(String propertyName) {
if (!project.hasProperty(propertyName)) {
throw new GradleException('Property "' + propertyName + '" not defined, this should be defined in your "<USER_HOME>/.gradle/gradle.properties" file or on the command line using the -P flag.')
}
}
ext.set('projectRoot', project.projectDir.toString())
buildscript {
ext {
scalaTestPlugin = '0.19'
spotless = "3.18.0"
}
repositories {
jcenter()
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath("gradle.plugin.com.github.maiflai:gradle-scalatest:$scalaTestPlugin")
classpath "com.diffplug.spotless:spotless-plugin-gradle:$spotless"
}
}
apply from: file("./gradle/dependency-versions-scala-" + "$scalaVersion" + ".gradle")
apply from: file("./gradle/dependency-versions.gradle")
subprojects {
apply plugin: 'scala'
apply plugin: 'com.github.maiflai.scalatest'
apply plugin: "com.diffplug.gradle.spotless"
spotless {
format 'misc', {
target '**/*.scala'
trimTrailingWhitespace()
endWithNewline()
targetExclude('**/Scratch*.scala')
}
scala {
//scalafmt()
// optional: you can specify a specific version or config file
scalafmt('1.5.1').configFile(projectRoot + '/.scalafmt.conf')
targetExclude('**/Scratch*.scala')
}
}
repositories {
mavenCentral()
jcenter()
}
dependencies {
testCompile("org.scalatest:scalatest_$scalaVersion:$scalatest")
// scalatest plugin needs this to work with scalatest
testRuntime("org.pegdown:pegdown:$pegdown")
}
tasks.withType(ScalaCompile) {
configure(scalaCompileOptions.forkOptions) {
jvmArgs = ['-Xss4m']
}
configure(scalaCompileOptions) {
additionalParameters = ['-target:jvm-1.8']
}
}
}
project("mytemplateproject") {
def projectName = "my-template-project"
jar {
baseName = "${projectName}_$scalaVersion"
version = "$version"
}
test {
maxParallelForks = 1
}
dependencies {
compile("org.scala-lang:scala-library:$scalaLibVersion")
compile("org.scala-lang:scala-compiler:$scalaLibVersion")
compile("org.apache.spark:spark-core_$scalaVersion:$spark")
compile("org.apache.spark:spark-sql_$scalaVersion:$spark")
compile("org.apache.spark:spark-yarn_$scalaVersion:$spark")
compile("org.apache.spark:spark-hive_$scalaVersion:$spark")
}
}