forked from Netflix/iep-shadow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
executable file
·143 lines (122 loc) · 4.14 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
142
143
plugins {
id 'java'
id 'com.github.johnrengelman.shadow' version '1.2.0'
}
allprojects {
repositories {
mavenLocal()
mavenCentral()
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
jcenter()
}
}
status = (project.hasProperty('preferredStatus')) ? project.preferredStatus : 'snapshot'
ext {
versionDot = ".10"
versionSuffix = (rootProject.status == 'snapshot') ? "${versionDot}-SNAPSHOT" : versionDot
versionGuice = '4.0'
versionRxJava = '1.0.14'
versionRxNetty = '0.4.13'
versionIoNetty = '4.1.0.Beta7'
versionSlf4j = '1.7.12'
versionServo = '0.11.5'
versionSpectator = '0.30.0'
versionEureka = '1.3.1'
versionArchaius = '0.7.1'
versionJcraft = '1.1.3'
versionIep = '0.1.49'
githubProjectName = 'iep-shadow'
sonatypeUsername = rootProject.hasProperty('sonatypeUsername')?rootProject.sonatypeUsername:''
sonatypePassword = rootProject.hasProperty('sonatypePassword')?rootProject.sonatypePassword:''
}
task wrapper(type: Wrapper) {
gradleVersion = '2.2.1'
}
subprojects {
apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'maven'
apply plugin: 'signing'
group = "com.netflix.${rootProject.githubProjectName}"
sourceCompatibility = 1.7
targetCompatibility = 1.7
status = rootProject.status
task sourcesJar(type: Jar, dependsOn:classes) {
from sourceSets.main.allSource
classifier 'sources'
extension 'jar'
}
task javadocJar(type: Jar, dependsOn:javadoc) {
from javadoc.destinationDir
classifier 'javadoc'
extension 'jar'
}
artifacts {
archives sourcesJar
archives javadocJar
archives shadowJar
}
configurations.archives.artifacts.removeAll { it.archiveTask.is war }
signing {
required { gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}
if (System.getProperty("java.version").startsWith("1.8.")) {
tasks.withType(Javadoc) {
// http://blog.joda.org/2014/02/turning-off-doclint-in-jdk-8-javadoc.html
options.addStringOption('Xdoclint:none', '-quiet')
}
}
javadoc {
options {
links = ['http://docs.oracle.com/javase/7/docs/api/']
}
}
uploadArchives {
configuration = configurations.archives
onlyIf { ['release', 'snapshot'].contains(project.status) }
repositories.mavenDeployer {
beforeDeployment { signing.signPom(it) }
// To test deployment locally, use the following instead of oss.sonatype.org
//repository(url: "file://localhost/${rootProject.rootDir}/repo")
repository(url: 'https://oss.sonatype.org/service/local/staging/deploy/maven2') {
authentication(userName: rootProject.sonatypeUsername, password: rootProject.sonatypePassword)
}
snapshotRepository(url: 'https://oss.sonatype.org/content/repositories/snapshots/') {
authentication(userName: rootProject.sonatypeUsername, password: rootProject.sonatypePassword)
}
// Prevent datastamp from being appending to artifacts during deployment
uniqueVersion = false
// Closure to configure all the POM with extra info, common to all projects
pom.project {
name "${project.name}"
description "${project.name} developed by Netflix"
developers {
developer {
id 'netflixgithub'
name 'Netflix Open Source Development'
email 'talent@netflix.com'
}
}
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
url "https://github.com/Netflix/${rootProject.githubProjectName}"
scm {
connection "scm:git:git@github.com:Netflix/${rootProject.githubProjectName}.git"
url "scm:git:git@github.com:Netflix/${rootProject.githubProjectName}.git"
developerConnection "scm:git:git@github.com:Netflix/${rootProject.githubProjectName}.git"
}
issueManagement {
system 'github'
url "https://github.com/Netflix/${rootProject.githubProjectName}/issues"
}
}
}
}
}