forked from LinkedInAttic/scanns
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
124 lines (103 loc) · 3.33 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
/**
* Copyright 2018 LinkedIn Corporation. All rights reserved. Licensed under the BSD-2 Clause license.
* See LICENSE in the project root for license information.
*/
// TODO: codecoverage plugin
// TODO: checkstyle plugin
buildscript {
if (!project.hasProperty('overrideBuildEnvironment')) {
repositories {
jcenter()
maven {
// For avro compiler plugin gradle-avro-plugin
url 'https://plugins.gradle.org/m2/'
}
}
dependencies {
// license-gradle plugin: https://github.com/hierynomus/license-gradle-plugin
classpath 'nl.javadude.gradle.plugins:license-gradle-plugin:0.11.0'
}
}
}
// For LinkedIn internal builds, apply the LinkedIn-specific build file
if (project.hasProperty('overrideBuildEnvironment')) {
apply from: project.overrideBuildEnvironment
} else {
apply from: "defaultEnvironment.gradle"
}
allprojects {
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'license'
}
// The gradle variables defined here are visible in sub-projects
ext {
sparkVersion = '2.4.0'
}
subprojects {
// Put the build dir into the rootProject
buildDir = "../build/$name"
plugins.withType(JavaPlugin) {
tasks.withType(Test) {
useTestNG()
// Exclude tests (ex. gradle test -Pexclude=SomeTestClass)
def excludedTests = project.properties['exclude']
if (excludedTests) {
excludedTests.replaceAll('\\s', '').split('[,]').each {
exclude "**/${it}.class"
}
}
options {
parallel = 'methods'
threadCount = 4
listeners << 'com.linkedin.nn.test.FailOnSkipListener'
}
afterSuite { desc, result ->
if (!desc.parent) {
println ":${project.name} -- Executed ${result.testCount} tests: ${result.successfulTestCount} succeeded, ${result.failedTestCount} failed, ${result.skippedTestCount} skipped"
}
}
// Forward standard out from child JVMs to the console
testLogging {
showStackTraces = true
showStandardStreams = true
showExceptions = true
showCauses = true
displayGranularity = maxGranularity
exceptionFormat = 'full'
}
outputs.upToDateWhen { false }
systemProperty "log4j.configuration", "file:${project.rootDir}/log4j.properties"
minHeapSize = "2G"
maxHeapSize = "8G"
}
dependencies {
testCompile 'org.testng:testng:6.11'
}
sourceCompatibility = 1.8
}
tasks.withType(ScalaCompile) {
scalaCompileOptions.additionalParameters = ["-feature", "-deprecation", "-verbose", "-optimize", "-unchecked", "-Yinline-warnings", "-g:vars"]
configure(scalaCompileOptions.forkOptions) {
memoryMaximumSize = '1g'
}
configurations.zinc.transitive = true
}
idea {
module {
testSourceDirs += file('src/integTest/scala')
testSourceDirs += file('src/test/scala')
}
}
license {
header rootProject.file('buildSrc/src/main/resources/code-quality/license_header')
strictCheck = true
}
// This task allows to get the dependencies from all the sub-project from the main photon-ml directory
// (otherwise, you have to change to each sub-project directory to get its dependencies)
task allDeps(type: DependencyReportTask) {}
}
// Task to generate the Gradle wrapper scripts
task wrapper(type: Wrapper) {
gradleVersion = '4.0'
}