-
Notifications
You must be signed in to change notification settings - Fork 39
/
build.gradle
154 lines (127 loc) · 3.97 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
/*
* This is a simple build file for building Sparkling Water applications.
*
* For more details please follow README.md.
*/
// Apply the java plugin to add support for Java
apply plugin: 'scala'
apply plugin: 'java-library'
// Support local launch of application
apply plugin: 'application'
mainClassName = 'water.droplets.SparklingWaterDroplet'
//
// The build script settings to fetch plugins and put them on
// classpath
buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:6.0.0'
classpath 'org.github.ngbinh.scalastyle:gradle-scalastyle-plugin_2.11:1.0.1'
}
}
//
// Configure project properties
//
ext {
// Spark version
sparkVersion = "3.0.0"
// Latest stable version for the specified version of Spark
spWaterVersion = "3.30.0.7-1-3.0"
// Scala binary version
scalaBaseVersion = '2.12'
scalaVersion = '2.12.10'
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
// In this section you declare where to find the dependencies of your project
repositories {
// Use 'maven central' for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
mavenCentral()
// Cloudera dependencies
maven {
url "https://repository.cloudera.com/artifactory/cloudera-repos/"
}
// Hortonworks dependencies
maven {
url "https://repo.hortonworks.com/content/repositories/releases/"
}
// Public sonatype repository
maven {
url "https://oss.sonatype.org/content/repositories/releases/"
}
// Enable 'maven local' for resolving your locally cached dependencies
// Useful for cross development for example with h2o-dev
if (spWaterVersion.endsWith("SNAPSHOT")) mavenLocal()
}
// This section declares the dependencies for your production and test code
dependencies {
// Spark Core
api("org.apache.spark:spark-core_${scalaBaseVersion}:${sparkVersion}")
// Spark Core
api("org.apache.spark:spark-repl_${scalaBaseVersion}:${sparkVersion}")
// Spark SQL
api("org.apache.spark:spark-sql_${scalaBaseVersion}:${sparkVersion}")
// Spark MLLib
api("org.apache.spark:spark-mllib_${scalaBaseVersion}:${sparkVersion}")
// Spark Streaming
api("org.apache.spark:spark-streaming_${scalaBaseVersion}:${sparkVersion}")
// Sparkling Water
api("ai.h2o:sparkling-water-package_${scalaBaseVersion}:${spWaterVersion}")
// Scala project needs dependency on Scala library
api("org.scala-lang:scala-library:$scalaVersion")
// And use scalatest for Scala testing
testImplementation("org.scalatest:scalatest_${scalaBaseVersion}:3.2.0")
}
//
// Project specific settings
//
// Setup group ID for this project
group = "ai.h2o"
//
// Setup Scala plugin
//
// Activate Zinc compiler and configure scalac
tasks.withType(ScalaCompile) {
scalaCompileOptions.additionalParameters = [
"-target:jvm-1.8",
"-feature",
// enable several optional scala features so Scala knows we use them on purpose
"-language:reflectiveCalls",
"-language:postfixOps",
"-language:existentials",
"-language:implicitConversions",
]
}
// In resulting jar include Scala binary version
jar {
archivesBaseName = "${project.name}_${scalaBaseVersion}"
}
// Check Scala coding conventions
apply from: 'gradle/scalastyle.gradle'
//
// Configure assembly to create Spark application
//
// Support for application assembly
apply plugin: 'com.github.johnrengelman.shadow'
configurations {
shadowApi {
extendsFrom api
}
}
shadowJar {
// Configure name of output jar as sparkling-water-droplet-app.jar
archiveAppendix = 'app'
configurations = [project.configurations.shadowApi]
mergeServiceFiles()
archiveBaseName = "${archiveBaseName}_${scalaBaseVersion}"
zip64 = true
}
artifacts {
api shadowJar
}