-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle
183 lines (161 loc) · 6.5 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
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
plugins {
id 'java-library'
id 'io.freefair.lombok' version "${lombokPluginVersion}"
id 'jacoco'
id 'signing'
id 'maven-publish'
}
group = 'com.syntifi.casper'
version = '0.2.1'
sourceCompatibility = '8'
repositories {
mavenCentral()
maven { url 'https://s01.oss.sonatype.org/content/repositories/snapshots' }
}
dependencies {
implementation "com.github.briandilley.jsonrpc4j:jsonrpc4j:${jsonrpc4jVersion}"
implementation "com.syntifi.crypto:crypto-key-common:${cryptokeyVersion}"
implementation "com.syntifi.crypto:crypto-key-ed25519:${cryptokeyVersion}"
implementation "com.syntifi.crypto:crypto-key-secp256k1:${cryptokeyVersion}"
implementation "com.fasterxml.jackson.core:jackson-core:${jacksonVersion}"
implementation "com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}"
implementation "com.fasterxml.jackson.core:jackson-annotations:${jacksonVersion}"
implementation "org.javatuples:javatuples:${javaTuplesVersion}"
implementation "joda-time:joda-time:${jodaTimeVersion}"
// log4j and slf4j
compileOnly "org.slf4j:slf4j-api:${slf4jApiVersion}"
testImplementation "org.apache.logging.log4j:log4j-api:${log4jVersion}"
testImplementation "org.apache.logging.log4j:log4j-core:${log4jVersion}"
testImplementation "org.apache.logging.log4j:log4j-slf4j-impl:${log4jVersion}"
// Use JUnit Jupiter for testing.
testImplementation "org.junit.jupiter:junit-jupiter:${jupiterVersion}"
// Used to compare json strings while testing
testImplementation "org.skyscreamer:jsonassert:${jsonassertVersion}"
}
java {
withJavadocJar()
withSourcesJar()
}
javadoc {
if (JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}
test {
finalizedBy jacocoTestReport
useJUnitPlatform()
testLogging {
//showStandardStreams true
// set options for log level LIFECYCLE
events TestLogEvent.FAILED,
TestLogEvent.PASSED,
TestLogEvent.SKIPPED
//TestLogEvent.STANDARD_OUT
exceptionFormat TestExceptionFormat.FULL
showExceptions true
showCauses true
//showStackTraces true
// set options for log level DEBUG and INFO
debug {
events TestLogEvent.STARTED,
TestLogEvent.FAILED,
TestLogEvent.PASSED,
TestLogEvent.SKIPPED,
TestLogEvent.STANDARD_ERROR
TestLogEvent.STANDARD_OUT
exceptionFormat TestExceptionFormat.FULL
}
//info.events = debug.events
//info.exceptionFormat = debug.exceptionFormat
afterSuite { desc, result ->
if (!desc.parent) { // will match the outermost suite
def output = "Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} passed, ${result.failedTestCount} failed, ${result.skippedTestCount} skipped)"
def startItem = '| ', endItem = ' |'
def repeatLength = startItem.length() + output.length() + endItem.length()
println('\n' + ('-' * repeatLength) + '\n' + startItem + output + endItem + '\n' + ('-' * repeatLength))
}
}
}
}
jacocoTestReport {
dependsOn test
afterEvaluate {
getClassDirectories().setFrom(classDirectories.files.collect {
fileTree(dir: it, exclude: '**/exception/**')
})
}
}
publishing {
repositories {
maven {
name = 'OSSRH'
def releasesRepoUrl = 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/'
def snapshotsRepoUrl = 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username = System.getenv('MAVEN_USERNAME')
password = System.getenv('MAVEN_PASSWORD')
}
}
maven {
name = "GitHubPackages"
url = "https://maven.pkg.github.com/syntifi/casper-sdk"
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
publications {
mavenJava(MavenPublication) {
artifactId = 'casper-sdk'
from components.java
pom {
name = 'Java 8+ Casper RPC Client SDK'
packaging = 'jar'
description = 'This project implements the SDK to interact with a Casper Node. It wraps the Json-RPC requests and maps the results to Java objects.'
url = 'https://github.com/syntifi/casper-sdk'
scm {
connection = 'scm:git:https://github.com/syntifi/casper-sdk.git'
developerConnection = 'git@github.com:syntifi/casper-sdk.git'
url = 'https://github.com/syntifi/casper-sdk'
}
issueManagement {
system = 'GitHub'
url = 'https://github.com/syntifi/casper-sdk/issues'
}
ciManagement {
system = 'Github Actions'
url = 'https://github.com/syntifi/casper-sdk/actions'
}
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'syntifi'
name = 'Alexandre Carvalho'
email = 'adcarvalho@gmail.com'
}
developer {
id = 'ab3rtz'
name = 'Andre Bertolace'
email = 'andre@syntifi.com'
}
}
}
}
}
}
// Reference at https://docs.gradle.org/current/userguide/signing_plugin.html#sec:in-memory-keys
signing {
def signingKey = System.getenv('GPG_SIGNING_KEY') ?: findProperty('GPG_SIGNING_KEY')
def signingKeyPassword = System.getenv('GPG_SIGNING_KEY_PASSWORD') ?: findProperty('GPG_SIGNING_KEY_PASSWORD')
useInMemoryPgpKeys(signingKey, signingKeyPassword)
sign publishing.publications.mavenJava
}