This repository has been archived by the owner on Jul 20, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathbuild.gradle
121 lines (107 loc) · 3.38 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
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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.
*/
buildscript {
repositories {
maven { url "https://plugins.gradle.org/m2/" }
maven { url "https://oss.sonatype.org/content/groups/public" }
jcenter()
mavenCentral()
}
dependencies {
classpath "org.github.ngbinh.scalastyle:gradle-scalastyle-plugin_2.11:0.9.0"
classpath 'net.researchgate:gradle-release:2.7.0'
classpath 'nl.javadude.gradle.plugins:license-gradle-plugin:0.11.0'
}
}
plugins {
id 'scala'
id 'scalaStyle' version "0.9.0"
id 'checkstyle'
id "org.nosphere.apache.rat" version "0.4.0"
id "com.github.hierynomus.license" version "0.15.0"
id 'maven-publish'
}
def sparkVersion = project.ext.get('spark.version')
repositories {
mavenLocal()
mavenCentral()
jcenter()
}
scalaStyle {
configLocation = "scalastyle_config.xml"
source = "src/main/scala"
}
checkstyle {
toolVersion "7.8.2"
configFile file("checkstyle.xml")
sourceSets = [project.sourceSets.main]
}
checkstyleMain {
source='src/main/java'
}
assemble {
dependsOn scalaStyle
dependsOn checkstyleMain
tasks.findByName('checkstyleMain').mustRunAfter 'scalaStyle'
}
dependencies {
compileOnly "org.apache.spark:spark-core_2.11:$sparkVersion"
compileOnly "org.apache.spark:spark-sql_2.11:$sparkVersion"
compile group: 'com.typesafe.scala-logging', name: 'scala-logging_2.11', version: '3.9.0'
compile files('libs/clust4j-1.2.4-SNAPSHOT.jar')
// test
testCompile "org.apache.spark:spark-sql_2.11:$sparkVersion"
testCompile 'junit:junit:4+'
testCompile 'org.scalatest:scalatest_2.11:3.0.4'
}
task fatJar(type: Jar) {
baseName = project.name + '-all'
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}
task scalaTest(dependsOn: ['testClasses'], type: JavaExec) {
main = 'org.scalatest.tools.Runner'
args = ['-R', 'build/classes/scala/test', '-o']
classpath = sourceSets.test.runtimeClasspath
}
test.dependsOn scalaTest
tasks.rat {
excludes.add("**/build/**")
excludes.add("**/.idea/**")
excludes.add("**/*.iml")
excludes.add("**/LICENSE.md")
excludes.add("**/CONTRIBUTING.md")
excludes.add("**/CODE_OF_CONDUCT.md")
excludes.add("**/gradle/**")
excludes.add("**/YuritaSampleApp/**")
}
license {
header rootProject.file('codequality/HEADER')
strictCheck true
// Variable substitution
ext.year = Calendar.getInstance().get(Calendar.YEAR)
ext.name = 'PayPal Inc'
}
publishing {
publications {
maven(MavenPublication) {
from components.java
}
}
}