forked from linkedin/transport
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
101 lines (86 loc) · 3.03 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
// Copyright 2019 LinkedIn Corporation. All rights reserved.
// Licensed under the BSD-2 Clause license.
// See LICENSE in the project root for license information.
buildscript {
repositories {
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.4'
classpath 'org.github.ngbinh.scalastyle:gradle-scalastyle-plugin_2.11:1.0.1'
classpath 'gradle.plugin.nl.javadude.gradle.plugins:license-gradle-plugin:0.14.0'
classpath "io.github.gradle-nexus:publish-plugin:1.0.0"
classpath "org.shipkit:shipkit-auto-version:1.1.1"
classpath "org.shipkit:shipkit-changelog:1.1.10"
}
}
plugins {
id "checkstyle"
}
apply from: "gradle/shipkit.gradle"
allprojects {
group = 'com.linkedin.transport'
apply plugin: 'idea'
}
if (project.hasProperty('overrideBuildEnvironment')) {
//The property is automatically passed to the Gradle build when the project is built at LinkedIn
//The property contains the file path to a script plugin that 'adapts' this OS project to LinkedIn
//In order to adapt the project, we need to apply this script plugin:
apply from: project.overrideBuildEnvironment
} else {
//If the property is not set the project is built outside of LinkedIn
//Applying default build logic for an OS build:
apply from: "defaultEnvironment.gradle"
}
subprojects {
apply plugin: "com.github.hierynomus.license"
license {
header = file("${rootDir}/gradle/license/LICENSE_HEADER")
ext.year = Calendar.getInstance().get(Calendar.YEAR)
skipExistingHeaders true
ignoreFailures false
strictCheck true
}
configurations {
all {
// Transport as a library should only expose slf4j-api to its consumers and should not keep any SLF4J bindings
// in its dependency graph
// Quote from http://www.slf4j.org/faq.html#maven2
// "Thus, as far as your users are concerned you are exporting slf4j-api as a transitive dependency of your
// library, but not any SLF4J-binding or any underlying logging system."
// Our dependencies (e.g. hadoop-common) do bring in slf4j-log4j12 in their dependency graph so we exclude them
exclude group: 'org.slf4j', module: 'slf4j-log4j12'
}
}
plugins.withType(JavaPlugin) {
project.apply(plugin: 'checkstyle')
dependencies {
testCompile 'org.testng:testng:6.11'
testCompile 'org.slf4j:slf4j-simple:1.7.25'
}
test {
useTestNG()
}
checkstyle {
configFile = rootProject.file('gradle/checkstyle/checkstyle.xml')
configProperties = [
'configDir': rootProject.file('gradle/checkstyle'),
'baseDir': rootDir
]
toolVersion '8.23'
}
}
plugins.withType(ScalaPlugin) {
project.apply(plugin: 'scalaStyle')
scalaStyle {
configLocation = "${rootDir}/gradle/scalastyle/scalastyle-config.xml"
source = sourceSets.main.allScala
testSource = sourceSets.test.allScala
includeTestSourceDirectory = true
}
check.dependsOn scalaStyle
}
}