forked from linkedin/dynamometer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
117 lines (105 loc) · 2.98 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
/**
* 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 {
mavenCentral()
jcenter()
}
dependencies {
// license-gradle plugin: https://github.com/hierynomus/license-gradle-plugin
classpath 'nl.javadude.gradle.plugins:license-gradle-plugin:0.11.0'
}
}
def hadoopVersion = '2.7.4'
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}",
]
]
allprojects {
project.version= '0.1.0-SNAPSHOT'
group = 'com.linkedin.dynamometer'
}
subprojects {
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'license'
sourceCompatibility = 1.7
repositories {
mavenCentral()
mavenLocal()
}
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)