-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
191 lines (156 loc) · 5.36 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
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.1'
}
}
plugins {
// Apply the java-library plugin to add support for Java Library
id 'java-library'
id 'maven-publish'
id "net.ltgt.apt" version "0.10"
}
ext {
rxJavaVer = ' 2.2.5'
retrofitVer = '2.5.0'
okHttpVer = '3.12.1'
gsonVer = '2.8.5'
}
dependencies {
// This dependency is exported to consumers, that is to say found on their compile classpath.
api 'org.apache.commons:commons-math3:3.6.1'
// This dependency is used internally, and not exposed to consumers on their own compile classpath.
implementation 'org.apache.commons:commons-lang3:3.8.1'
implementation 'com.google.guava:guava:27.0.1-jre'
implementation "io.reactivex.rxjava2:rxjava:${rxJavaVer}"
// retrofit
implementation "com.squareup.retrofit2:retrofit:${retrofitVer}"
implementation "com.squareup.retrofit2:adapter-rxjava2:${retrofitVer}"
implementation "com.squareup.retrofit2:converter-gson:${retrofitVer}"
implementation "com.google.code.gson:gson:${gsonVer}"
implementation "com.google.dagger:dagger:2.17"
annotationProcessor "com.google.dagger:dagger-compiler:2.17"
// okHttp
implementation "com.squareup.okhttp3:okhttp:${okHttpVer}"
implementation "com.squareup.okhttp3:logging-interceptor:${okHttpVer}"
implementation group: 'commons-collections', name: 'commons-collections', version: '3.2'
implementation group: 'org.slf4j', name: 'slf4j-api', version: '1.7.2'
implementation group: 'org.slf4j', name: 'slf4j-log4j12', version: '1.7.2'
// Use JUnit test framework
testImplementation 'junit:junit:4.12'
}
// In this section you declare where to find the dependencies of your project
repositories {
// Use jcenter for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
mavenLocal()
}
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'maven'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'maven'
apply plugin: 'signing'
group = 'io.yosemiteblockchain'
version = '0.9.3'
compileJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
// https://central.sonatype.org/pages/gradle.html
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives javadocJar, sourcesJar
}
signing {
sign configurations.archives
}
// https://central.sonatype.org/pages/ossrh-guide.html
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
pom.project {
name 'Java Library for Yosemite Public Blockchain'
packaging 'jar'
artifactId 'yosemitej'
description 'The project\'s goal is to provide convenient interfaces for the useful commands such as pushing action including some native actions of Yostemite Public Blockchain.'
url 'https://github.com/YosemiteLabs/yosemite-j'
scm {
connection 'scm:git:git://github.com/YosemiteLabs/yosemite-j.git'
developerConnection 'scm:git:ssh://github.com:YosemiteLabs/yosemite-j.git'
url 'https://github.com/YosemiteLabs/yosemite-j'
}
licenses {
license {
name 'BSD 4-Clause "Original" or "Old" License'
url 'https://directory.fsf.org/wiki/License:BSD-4-Clause'
}
}
developers {
developer {
id 'yxdeploy'
name 'Yosemite X Inc.'
email 'contact@yosemitex.com'
}
}
}
}
}
}
sourceSets {
sample {
java {
srcDir "src/sample/java"
}
compileClasspath += main.output
runtimeClasspath += main.output
}
}
configurations {
sampleCompile.extendsFrom testCompile
sampleRuntime.extendsFrom testRuntime
}
jar {
manifest {
attributes('Implementation-Title': project.name,
'Implementation-Version': project.version)
}
}
test {
testLogging {
showStandardStreams true
exceptionFormat 'full'
}
}
task buildSample(type: JavaCompile, dependsOn: build) {
source = fileTree(dir: 'src/sample', include: '**/*.java')
classpath = files("$buildDir/classes/java/main")
destinationDir = file("$buildDir/classes/java/main")
}
task runSample(type: JavaExec, dependsOn: buildSample) {
if (project.hasProperty('pargs')) {
args(pargs.split(','))
}
doFirst {
main = 'io.yosemite.sample.' + mainClass
classpath = sourceSets.main.runtimeClasspath
}
}
build.finalizedBy buildSample