-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
170 lines (142 loc) · 4.67 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
buildscript {
ext.kotlin_version = '1.4.32'
ext.dashj_version = '19.1-CJ-SNAPSHOT'
ext.dpp_version = '0.24-SNAPSHOT'
repositories {
mavenCentral()
mavenLocal()
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.4'
classpath "org.jlleitschuh.gradle:ktlint-gradle:8.2.0"
}
}
plugins {
id 'maven-publish'
id 'maven'
id 'signing'
id('io.gitlab.arturbosch.detekt').version("1.19.0")
id 'jacoco'
}
apply plugin: 'kotlin'
allprojects {
repositories {
mavenLocal()
mavenCentral()
maven { url 'https://s01.oss.sonatype.org/content/repositories/snapshots/'}
}
}
group 'org.dashj.platform'
version ext.dpp_version
repositories {
mavenCentral()
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
implementation 'co.nstant.in:cbor:0.8'
implementation "org.dashj:dashj-core:$dashj_version"
implementation 'com.google.guava:guava:29.0-android'
implementation 'org.json:json:20190722'
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.easymock:easymock:4.3'
}
sourceCompatibility = 1.8
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
test {
finalizedBy jacocoTestReport // report is always generated after tests run
}
tasks.withType(Test) {
systemProperty "java.library.path", "src/main/jniLibs"
}
jacoco {
toolVersion = "0.8.7" // supports kotlin 1.15
}
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 sourcesJar(type: Jar) {
classifier 'sources'
from sourceSets.main.allSource
}
publishing {
tasks.withType(Sign)*.enabled = false
publications {
maven(MavenPublication) {
from components.java
artifact sourcesJar
}
}
}
assemble.dependsOn(publishToMavenLocal)
assemble.dependsOn(sourcesJar)
test {
useJUnitPlatform()
}
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 X11'
packaging 'jar'
groupId 'org.dashj.platform'
artifactId 'dpp'
version project.findProperty('dpp_version')
description 'Dash Platform Protocol Library'
url 'https://github.com/dashevo/android-dpp'
scm {
connection 'scm:svn:https://github.com/dashevo/android-dpp'
developerConnection 'scm:svn:https://github.com/dashevo/android-dpp'
url 'https://github.com/dashevo/android-dpp'
}
licenses {
license {
name 'MIT'
url 'https://opensource.org/licenses/MIT'
}
}
developers {
developer {
id 'hashengineering'
name 'HashEngineering'
email '[email protected]'
}
}
}
}
}
}
apply from: 'ktlint.gradle'