-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
218 lines (185 loc) · 6.35 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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
buildscript {
ext.kotlin_version = '1.4.32'
ext.dashj_version = '19.1-CJ-SNAPSHOT'
ext.dpp_version = '0.24-SNAPSHOT'
ext.dapi_client_version = '0.24-SNAPSHOT'
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.8"
classpath "org.jlleitschuh.gradle:ktlint-gradle:8.2.0"
}
}
plugins {
id 'maven-publish'
id 'maven'
id 'signing'
id 'java'
id('io.gitlab.arturbosch.detekt').version("1.1.1")
id 'jacoco'
}
apply plugin: 'kotlin'
apply plugin: 'com.google.protobuf'
apply plugin: 'idea'
group 'org.dashj.platform'
version dapi_client_version
sourceCompatibility = 1.8
repositories {
mavenLocal()
mavenCentral()
maven { url 'https://s01.oss.sonatype.org/content/repositories/snapshots/'}
}
protobuf {
protoc {
if (osdetector.os == "osx") {
artifact = 'com.google.protobuf:protoc:3.14.0:osx-x86_64'
} else {
artifact = 'com.google.protobuf:protoc:3.14.0'
}
}
plugins {
grpc {
if (osdetector.os == "osx") {
artifact = 'io.grpc:protoc-gen-grpc-java:1.28.0:osx-x86_64'
} else {
artifact = 'io.grpc:protoc-gen-grpc-java:1.28.0'
}
}
}
generateProtoTasks {
all().each { task ->
task.builtins {
java { option 'lite' }
}
task.plugins {
grpc { option 'lite' }
}
}
}
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation "org.dashj.platform:dpp:$dpp_version"
implementation "org.dashj:dashj-core:$dashj_version"
implementation "org.dashj:dashj-bls:1.0.0"
implementation "org.dashj:dashj-merk:0.22-SNAPSHOT"
implementation 'com.squareup.retrofit2:retrofit:2.6.4'
implementation 'com.squareup.retrofit2:converter-gson:2.6.4'
implementation 'com.squareup.okhttp3:logging-interceptor:3.8.0'
implementation 'com.squareup.moshi:moshi:1.11.0'
implementation 'com.squareup.moshi:moshi-kotlin:1.11.0'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.1.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.1.0'
testImplementation 'org.assertj:assertj-core:3.10.0'
testImplementation 'org.mockito:mockito-all:2.0.2-beta'
testImplementation 'com.squareup.retrofit2:retrofit-mock:2.4.0'
testImplementation 'com.squareup.okhttp3:mockwebserver:3.11.0'
testImplementation "com.nhaarman.mockitokotlin2:mockito-kotlin:2.0.0-RC1"
testImplementation 'org.slf4j:slf4j-jdk14:1.7.28'
implementation 'io.grpc:grpc-okhttp:1.54.0' // CURRENT_GRPC_VERSION
implementation('io.grpc:grpc-protobuf-lite:1.54.0') { // CURRENT_GRPC_VERSION
exclude module: "protobuf-lite"
}
implementation 'io.grpc:grpc-stub:1.54.0' // CURRENT_GRPC_VERSION
compileOnly 'javax.annotation:javax.annotation-api:1.3.2'
implementation 'org.slf4j:slf4j-api:1.7.30'
implementation 'org.json:json:20190722'
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
task sourcesJar(type: Jar) {
classifier 'sources'
from sourceSets.main.allSource
}
artifacts {
archives sourcesJar
}
tasks.withType(Test) {
systemProperty "java.library.path", "src/main/jniLibs"
}
publishing {
tasks.withType(Sign)*.enabled = false
publications {
maven(MavenPublication) {
artifact sourcesJar
from components.java
}
}
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
jvmTarget = "1.8"
}
}
assemble.dependsOn(publishToMavenLocal)
test {
useJUnitPlatform()
finalizedBy jacocoTestReport // report is always generated after tests run
}
jacocoTestReport {
dependsOn test // tests are required to run before generating the report
reports {
xml.enabled true
xml.destination file("${rootProject.projectDir}/build/reports/jacoco/jacoco.xml")
}
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives javadocJar
archives sourcesJar
}
signing {
required { gradle.taskGraph.hasTask("publish") }
sign configurations.archives
}
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: project.hasProperty('ossrhUsername')?project.findProperty('ossrhUsername'):'', password: project.hasProperty('ossrhPassword')?project.findProperty('ossrhPassword'):'')
}
snapshotRepository(url: "https://s01.oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: project.hasProperty('ossrhUsername')?project.findProperty('ossrhUsername'):'', password: project.hasProperty('ossrhPassword')?project.findProperty('ossrhPassword'):'')
}
pom.project {
name 'DashJ DAPI Client'
packaging 'jar'
groupId 'org.dashj.platform'
artifactId 'dapi-client'
version dapi_client_version
description 'Dash DAPI Client Library'
url 'https://github.com/dashevo/dapi-client-android'
scm {
connection 'scm:svn:https://github.com/dashevo/dapi-client-android'
developerConnection 'scm:svn:https://github.com/dashevo/dapi-client-android'
url 'https://github.com/dashevo/dapi-client-android'
}
licenses {
license {
name 'MIT'
url 'https://opensource.org/licenses/MIT'
}
}
developers {
developer {
id 'hashengineering'
name 'HashEngineering'
email '[email protected]'
}
}
}
}
}
}
apply from: 'ktlint.gradle'