-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
196 lines (141 loc) · 3.71 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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'net.sf.proguard:proguard-gradle:5.2.1'
classpath(group: 'org.jfrog.buildinfo', name: 'build-info-extractor-gradle', version: '3.1.1')
}
}
plugins {
id 'java'
id 'maven'
id 'com.github.johnrengelman.shadow' version '1.2.2'
id "com.jfrog.artifactory" version "3.1.0"
}
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.artifactory'
apply plugin: 'eclipse'
group = "com.jive.sip"
version = currentVersion
repositories {
mavenCentral()
maven {
url 'https://getjive.artifactoryonline.com/getjive/libs-snapshot-local'
credentials {
username = 'theo'
password = 'AP9vAJhmvqSytjG9DKe1omyR8Sj'
}
}
}
compileJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
sourceSets.all { set ->
def jarTask = task("${set.name}Jar", type: Jar) {
baseName = baseName + "-$set.name"
from set.output
}
artifacts {
archives jarTask
}
}
sourceSets {
api
impl
stack
}
configurations {
provided
}
eclipse {
classpath {
plusConfigurations += [ configurations.provided ]
}
}
sourceSets {
api {
compileClasspath += configurations.provided
}
impl {
compileClasspath += configurations.provided
}
stack {
compileClasspath += configurations.provided
}
}
dependencies {
provided 'org.projectlombok:lombok:1.16.6'
apiCompile 'com.google.guava:guava:18.0'
implCompile 'com.google.guava:guava:18.0'
// test dependencies
testCompile 'junit:junit:4.12'
testCompile 'com.google.guava:guava:18.0'
implCompile sourceSets.api.output
stackCompile 'com.google.guava:guava:18.0'
stackCompile 'io.netty:netty-all:4.1.0.Beta7'
provided 'org.slf4j:slf4j-api:1.7.12'
stackCompile sourceSets.api.output
stackCompile sourceSets.impl.output
stackCompile 'dnsjava:dnsjava:2.1.7'
testCompile sourceSets.api.output
testCompile sourceSets.impl.output
testCompile sourceSets.stack.output
runtime configurations.apiRuntime
runtime configurations.stackRuntime
runtime configurations.implRuntime
}
jar {
from sourceSets.api.output
from sourceSets.impl.output
from sourceSets.stack.output
}
shadowJar {
dependsOn apiClasses, stackClasses, implClasses
from sourceSets.stack.output
mergeServiceFiles()
relocate('com.google.common.net.HostAndPort', 'com.jive.sip.HostAndPort') {
}
relocate('com.google', 'com.jive.sip.shaded.google') {
}
relocate('io.netty', 'com.jive.sip.shaded.netty') {
}
relocate('org.xbill', 'com.jive.sip.shaded.xbill') {
}
}
task proguard(type: proguard.gradle.ProGuardTask) {
dependsOn shadowJar
configuration 'proguard.txt'
injars shadowJar.outputs
outjars 'build/libs/${archivesBaseName}.out.jar'
}
publishing {
publications {
mavenJar(MavenPublication) {
artifact proguard.outputs.files.singleFile
artifactId "sip"
}
}
}
artifactory {
contextUrl = 'https://getjive.artifactoryonline.com/getjive/'
def ENV = System.getenv()
publish {
repository {
repoKey = 'libs-snapshot-local'
username = ENV['ARTIFACTORY_USER']
password = ENV['ARTIFACTORY_API_KEY']
maven = true
}
defaults {
publications('mavenJar')
publishArtifacts = true
properties = ['dev.team': 'rtc' ]
publishPom = true
}
}
clientConfig.publisher.repoKey = 'libs-snapshot-local'
clientConfig.publisher.username = ENV['ARTIFACTORY_USER']
clientConfig.publisher.password = ENV['ARTIFACTORY_API_KEY']
}