-
Notifications
You must be signed in to change notification settings - Fork 13
/
build.gradle
141 lines (118 loc) · 4.52 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
/*
* Copyright (c) 2017 Dell Inc., or its subsidiaries. All Rights Reserved.
*
* Licensed 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
*/
buildscript {
repositories {
jcenter()
}
dependencies {
classpath "com.github.jengelman.gradle.plugins:shadow:${shadowGradlePlugin}"
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:${bintrayPluginVersion}"
classpath "org.ajoberstar:gradle-git:${gradleGitPluginVersion}"
}
}
apply plugin: 'eclipse'
apply plugin: 'checkstyle'
apply from: 'gradle/java.gradle'
apply from: 'gradle/maven.gradle'
apply from: 'gradle/bintray.gradle'
apply plugin: 'org.ajoberstar.grgit'
group = "io.pravega"
version = getProjectVersion()
description = """Pravega Hadoop Connector(pravega-inputformat)"""
sourceCompatibility = 1.8
targetCompatibility = 1.8
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
checkstyle {
toolVersion = checkstyleToolVersion
configDir = new File(rootDir, "checkstyle")
configProperties = [importControlFile: "$rootDir/checkstyle/import-control.xml"]
}
repositories {
mavenLocal()
if (findProperty("repositoryUrl")) {
maven {
url findProperty("repositoryUrl")
}
}
else {
mavenCentral()
maven {
url "https://maven.pkg.github.com/pravega/pravega"
credentials {
username = "pravega-public"
password = "\u0067\u0068\u0070\u005F\u0048\u0034\u0046\u0079\u0047\u005A\u0031\u006B\u0056\u0030\u0051\u0070\u006B\u0079\u0058\u006D\u0035\u0063\u0034\u0055\u0033\u006E\u0032\u0065\u0078\u0039\u0032\u0046\u006E\u0071\u0033\u0053\u0046\u0076\u005A\u0049"
}
}
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
maven { url "https://repository.apache.org/snapshots" }
maven { url "https://oss.jfrog.org/jfrog-dependencies" }
}
}
configurations {
shadowOnly {
}
testCompile.extendsFrom(compileOnly)
testCompile.exclude group: 'com.sun.jersey'
}
dependencies {
compile(group: 'io.pravega', name: 'pravega-client', version: pravegaVersion) {
exclude group: 'org.slf4j', module: 'slf4j-api'
// lombok should be compileOnly
exclude group: 'org.projectlombok', module: 'lombok'
exclude group: 'log4j', module: 'log4j'
}
testCompile group: 'junit', name: 'junit', version: junitVersion
testCompile group: 'org.mockito', name: 'mockito-all', version: mockitoVersion
testCompile group: 'org.apache.hadoop', name: 'hadoop-common', version: hadoopVersion
testCompile group: 'io.pravega', name: 'pravega-standalone', version: pravegaVersion
testAnnotationProcessor group: 'org.projectlombok', name: 'lombok', version: lombokVersion
// Needed to stick to the version of Zookeeper used by Pravega.
testImplementation(group: 'org.apache.zookeeper', name: 'zookeeper') {
version {
strictly '3.5.9'
}
}
compileOnly group: 'org.apache.hadoop', name: 'hadoop-common', version: hadoopVersion
compileOnly group: 'org.apache.hadoop', name: 'hadoop-mapreduce-client-core', version: hadoopVersion
annotationProcessor group: 'org.projectlombok', name: 'lombok', version: lombokVersion
compileOnly group: 'org.projectlombok', name: 'lombok', version: lombokVersion // not needed at runtime
shadowOnly group: 'org.slf4j', name: 'slf4j-api', version: slf4jApiVersion
shadowOnly group: 'org.apache.hadoop', name: 'hadoop-common', version: hadoopVersion
shadowOnly group: 'org.apache.hadoop', name: 'hadoop-mapreduce-client-core', version: hadoopVersion
}
test {
systemProperties = System.properties
dependsOn 'cleanTest'
}
shadowJar {
classifier = null
version = version
zip64 = true
mergeServiceFiles()
relocate 'io.netty', 'io.pravega.shaded.io.netty'
relocate 'com.google', 'io.pravega.shaded.com.google'
}
javadoc {
title = "Pravega Hadoop Connector"
failOnError = false
exclude "**/impl/**";
}
def getProjectVersion() {
String ver = connectorVersion
if (ver.contains("-SNAPSHOT")) {
String versionLabel = ver.substring(0, ver.indexOf("-SNAPSHOT"))
def count = grgit.log(includes:['HEAD']).size()
def commitId = "${grgit.head().abbreviatedId}"
ver = versionLabel + "-" + count + "." + commitId + "-SNAPSHOT"
}
return ver
}