-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbuild.gradle
110 lines (90 loc) · 3.22 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
/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Scala library project to get you started.
* For more details take a look at the Scala plugin chapter in the Gradle
* User Manual available at https://docs.gradle.org/5.3.1/userguide/scala_plugin.html
*/
plugins {
// Apply the scala plugin to add support for Scala
id 'scala'
}
repositories {
// Use jcenter for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
mavenLocal()
mavenCentral()
maven {
url "https://oss.sonatype.org/content/repositories/snapshots"
}
}
ext {
scalaVersion = "2.11"
sparkVersion = "2.4.0"
}
//dependencies {
// // Use Scala 2.12 in our library project
// implementation 'org.scala-lang:scala-library:2.12.8'
//
// // Use Scalatest for testing our library
// testImplementation 'junit:junit:4.12'
// testImplementation 'org.scalatest:scalatest_2.12:3.0.5'
//
// // Need scala-xml at test runtime
// testRuntimeOnly 'org.scala-lang.modules:scala-xml_2.12:1.1.1'
//}
task getHomeDir {
doLast {
println gradle.gradleHomeDir
}
}
configurations {
provided
compile.extendsFrom provided
}
sourceSets {
main.compileClasspath += configurations.provided
test.compileClasspath += configurations.provided
test.runtimeClasspath += configurations.provided
}
dependencies {
// Use Scala 2.12 in our library project
implementation "org.scala-lang:scala-library:2.11.11"
// Use Scalatest for testing our library
testImplementation "junit:junit:4.12"
testImplementation "org.scalatest:scalatest_$scalaVersion:3.0.5"
// https://mvnrepository.com/artifact/org.scalatest/scalatest
testCompile group: "org.scalatest", name: "scalatest_$scalaVersion", version: "3.2.0-SNAP10"
compile group: "org.scalatest", name: "scalatest_$scalaVersion", version: "3.2.0-SNAP10"
// Need scala-xml at test runtime
testRuntimeOnly "org.scala-lang.modules:scala-xml_$scalaVersion:1.1.1"
provided "org.apache.spark:spark-mllib_$scalaVersion:$sparkVersion"
provided "org.apache.spark:spark-sql_$scalaVersion:$sparkVersion"
provided "org.apache.spark:spark-graphx_$scalaVersion:$sparkVersion"
provided "org.apache.spark:spark-launcher_$scalaVersion:$sparkVersion"
provided "org.apache.spark:spark-catalyst_$scalaVersion:$sparkVersion"
provided "org.apache.spark:spark-core_$scalaVersion:$sparkVersion"
compile group: "commons-io", name: "commons-io", version: "2.5"
// https://mvnrepository.com/artifact/org.xerial.snappy/snappy-java
compile group: 'org.xerial.snappy', name: 'snappy-java', version: '1.1.7.3'
//Json
// https://mvnrepository.com/artifact/io.spray/spray-json
compile group: "io.spray", name: "spray-json_$scalaVersion", version: "1.3.5"
}
jar {
dependsOn configurations.runtime
from {
(configurations.runtime - configurations.provided).collect
{
it.isDirectory()? it : zipTree(it)
}
} {
exclude 'META-INF/*.RSA'
exclude 'META-INF/*.SF'
exclude 'META-INF/*.DSA'
}
manifest {
attributes 'Main-Class': 'com.test.Main'
}
}