-
Notifications
You must be signed in to change notification settings - Fork 34
/
build.gradle
129 lines (116 loc) · 3.64 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
/**
* Copyright 2017 LinkedIn Corporation. All rights reserved. Licensed under the BSD-2 Clause license.
* See LICENSE in the project root for license information.
*/
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
// license-gradle plugin: https://github.com/hierynomus/license-gradle-plugin
classpath "gradle.plugin.nl.javadude.gradle.plugins:license-gradle-plugin:0.14.0"
}
}
plugins {
id "org.shipkit.java" version "2.1.3"
}
def hadoopVersion = '2.7.7'
ext.deps = [
hadoop: [
hdfs: "org.apache.hadoop:hadoop-hdfs:${hadoopVersion}",
common: "org.apache.hadoop:hadoop-common:${hadoopVersion}",
'yarn-api': "org.apache.hadoop:hadoop-yarn-api:${hadoopVersion}",
'yarn-client': "org.apache.hadoop:hadoop-yarn-client:${hadoopVersion}",
'yarn-common': "org.apache.hadoop:hadoop-yarn-common:${hadoopVersion}",
'mapreduce-client-core': "org.apache.hadoop:hadoop-mapreduce-client-core:${hadoopVersion}",
minicluster: "org.apache.hadoop:hadoop-minicluster:${hadoopVersion}",
'hdfs-test': "org.apache.hadoop:hadoop-hdfs:${hadoopVersion}:tests",
'common-test': "org.apache.hadoop:hadoop-common:${hadoopVersion}:tests",
'yarn-server-test': "org.apache.hadoop:hadoop-yarn-server-tests:${hadoopVersion}:tests",
]
]
allprojects {
group = 'com.linkedin.dynamometer'
}
if (project.hasProperty('overrideBuildEnvironment')) {
// Allow for override of the environment via a property flag
apply from: project.overrideBuildEnvironment
final File overrideFile = rootProject.file(project.overrideBuildEnvironment)
assert overrideFile.isFile() : "The environment script ($overrideFile) does not exist or is not a file"
apply from: overrideFile
} else {
apply from: 'defaultEnvironment.gradle'
}
subprojects {
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'license'
sourceCompatibility = 1.8
license {
header rootProject.file('license_header')
// Set the year in the license
ext.year = Calendar.getInstance().get(Calendar.YEAR)
skipExistingHeaders = true
strictCheck = true
}
configurations {
hadoopRuntime.extendsFrom(runtime)
hadoopRuntime {
exclude group: 'org.apache.hadoop'
}
}
}
apply plugin: 'distribution'
// Generates a closure which is used to set up the contents
// for a distribution; parametrized by the name of the
// configuration to include in the lib directory.
def generateDistContents(configurationName) {
return {
into('.') {
from rootProject.fileTree('.') {
include 'README.md'
include 'LICENSE'
include 'NOTICE'
include 'CONTRIBUTING.md'
}
}
into('bin') {
def bashFiles = []
rootProject.subprojects.each {
bashFiles << it.fileTree("src/main/bash") {
include "*.sh"
}
}
from bashFiles
}
into('lib') {
def dependencies = files()
def jars = []
rootProject.subprojects.each {
// Use subtraction to eliminate duplicates
dependencies = dependencies + (it.configurations[configurationName] - dependencies)
jars << it.jar
}
from dependencies
from jars
}
}
}
distributions {
// main distribution does not include Hadoop JARs; this is the one
// typically expected to be used on a system properly set up with
// an existing Hadoop installation.
main {
baseName = rootProject.name
contents generateDistContents('hadoopRuntime')
}
// fat distribution includes all dependencies.
fat {
baseName = rootProject.name + '-fat'
contents generateDistContents('runtime')
}
}
build.dependsOn(distZip)