forked from lightsail-network/java-stellar-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
90 lines (78 loc) · 2.74 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
buildscript {
ext.okhttpclientVersion="3.11.0"
repositories {
jcenter()
}
dependencies {
classpath 'com.github.ben-manes:gradle-versions-plugin:0.20.0'
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.4'
}
}
apply plugin: "com.github.johnrengelman.shadow" // provides shading
apply plugin: 'java'
apply plugin: 'maven' // needed to add the install task for jitpack.io
apply plugin: 'com.github.ben-manes.versions' // gradle dependencyUpdates -Drevision=release
apply plugin: 'project-report' // gradle htmlDependencyReport
sourceCompatibility = 1.6
version = '0.24.0'
group = 'stellar'
jar {
manifest {
attributes 'Implementation-Title': 'stellar-sdk',
'Implementation-Version': version
}
archiveName 'stellar-sdk.jar'
duplicatesStrategy DuplicatesStrategy.EXCLUDE
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
}
artifacts {
// make sure the non shaded jar is not
archives shadowJar
}
repositories {
mavenCentral()
}
dependencies {
compile "com.squareup.okhttp3:okhttp:${okhttpclientVersion}"
compile "com.squareup.okhttp3:okhttp-sse:${okhttpclientVersion}"
compile 'com.moandjiezana.toml:toml4j:0.7.2'
// use the android version because we don't want java 8 stuff
compile 'com.google.guava:guava:26.0-android'
compile 'com.google.code.gson:gson:2.8.5'
compile 'commons-io:commons-io:2.6'
compile 'net.i2p.crypto:eddsa:0.3.0'
compile 'org.threeten:threetenbp:1.4.4'
testCompile 'org.mockito:mockito-core:2.21.0'
testCompile "com.squareup.okhttp3:mockwebserver:${okhttpclientVersion}"
testCompile 'junit:junit:4.12'
testCompile 'javax.xml.bind:jaxb-api:2.3.0'
}
project.configurations.compile
jar.enabled = false
// make sure the install task creates the shadowjar; this is called by jitpack.ios
install.dependsOn(shadowJar);
// we need this so we can get to the installer and deployer below so we can remove the dependencies
uploadArchives {
repositories {
mavenDeployer {
}
}
}
def installer = install.repositories.mavenInstaller
def deployer = uploadArchives.repositories.mavenDeployer
[installer, deployer]*.pom*.whenConfigured {pom ->
// force pom dependencies to be empty because we are shading everything
pom.dependencies = []
}
shadowJar {
archiveName 'stellar-sdk.jar'
relocate 'com.','shadow.com.'
relocate 'net.','shadow.net.'
relocate 'javax.annotation', 'shadow.javax.annotation'
relocate 'org.apache','shadow.org.apache'
relocate 'org.jvnet','shadow.org.jvnet'
relocate 'org.codehaus','shadow.org.codehaus'
relocate 'org.checkerframework','shadow.org.checkerframework'
relocate 'okhttp3','shadow.okhttp3'
relocate 'okio','shadow.okio'
}