11plugins {
22 id ' java'
3+ id ' maven'
34 id ' maven-publish'
5+ id ' signing'
46 id ' jacoco'
57 id ' com.diffplug.gradle.spotless' version ' 3.27.2'
68}
@@ -10,35 +12,6 @@ repositories {
1012 mavenCentral()
1113}
1214
13- group = ' org.arkecosystem'
14- version = ' 1.0.1'
15-
16- publishing {
17- publishing {
18- repositories {
19- maven {
20- name = " github"
21- url = uri(" https://maven.pkg.github.com/arkecosystem/java-client" )
22- credentials {
23- username = project. findProperty(" gpr.user" ) ?: System . getenv(" USERNAME" )
24- password = project. findProperty(" gpr.key" ) ?: System . getenv(" PASSWORD" )
25- }
26- }
27- }
28- publications {
29- gpr(MavenPublication ) {
30- from(components. java)
31- }
32- }
33- }
34-
35- javadoc {
36- if (JavaVersion . current(). isJava9Compatible()) {
37- options. addBooleanOption(' html5' , true )
38- }
39- }
40- }
41-
4215dependencies {
4316 compile group : ' com.squareup.okhttp3' , name : ' okhttp' , version : ' 4.4.1'
4417 compile group : ' com.squareup.okhttp3' , name : ' mockwebserver' , version : ' 4.4.1'
@@ -48,6 +21,96 @@ dependencies {
4821 testRuntimeOnly ' org.junit.jupiter:junit-jupiter-engine:5.6.0'
4922}
5023
24+ task javadocJar (type : Jar ) {
25+ classifier = ' javadoc'
26+ from javadoc
27+ }
28+
29+ task sourcesJar (type : Jar ) {
30+ classifier = ' sources'
31+ from sourceSets. main. allSource
32+ }
33+
34+ artifacts {
35+ archives javadocJar, sourcesJar
36+ }
37+
38+ uploadArchives {
39+ repositories {
40+ mavenDeployer {
41+ beforeDeployment { MavenDeployment deployment -> signing. signPom(deployment) }
42+
43+ repository(url : " file://${ buildDir} /repo" ) {}
44+
45+ // repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2") {
46+ // authentication(userName: '', password: '')
47+ // }
48+
49+ // snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
50+ // authentication(userName: ossrhUsername, password: ossrhPassword)
51+ // }
52+
53+ pom. project {
54+ groupId = ' org.arkecosystem'
55+ version = ' 1.2.8'
56+ artifactId = ' client'
57+
58+ name = ' java-client'
59+ description = ' A Simple REST API Client Implementation in Java for the ARK CORE Blockchain Framework.'
60+ url = ' https://sdk.ark.dev/java/client'
61+ inceptionYear = ' 2018'
62+
63+ licenses {
64+ license {
65+ name = ' MIT'
66+ distribution = ' repo'
67+ }
68+ }
69+
70+ developers {
71+ developer {
72+ name = ' Kovač Žan'
73+ email = ' zan@ark.io'
74+ organization = ' ARK Ecosystem'
75+ organizationUrl = ' https://ark.io'
76+ }
77+ developer {
78+ name = ' Kristjan Košič'
79+ email = ' kristjan@ark.io'
80+ organization = ' ARK Ecosystem'
81+ organizationUrl = ' https://ark.io'
82+ }
83+ developer {
84+ name = ' Brian Faust'
85+ email = ' brian@ark.io'
86+ organization = ' ARK Ecosystem'
87+ organizationUrl = ' https://ark.io'
88+ }
89+ developer {
90+ name = ' Joshua Noack'
91+ email = ' joshua@ark.io'
92+ organization = ' ARK Ecosystem'
93+ organizationUrl = ' https://ark.io'
94+ }
95+ }
96+
97+ scm {
98+ connection = ' scm:git:git://github.com/ArkEcosystem/java-client.git'
99+ developerConnection = ' scm:git:ssh://github.com:ArkEcosystem/java-client.git'
100+ url = ' https://github.com/ArkEcosystem/java-client/tree/1.2.8'
101+ }
102+ }
103+ }
104+ }
105+ }
106+
107+ if (project. hasProperty(" signing.keyId" )) {
108+ apply plugin : ' signing'
109+ signing {
110+ sign configurations. archives
111+ }
112+ }
113+
51114test {
52115 useJUnitPlatform()
53116 failFast = true
@@ -63,19 +126,15 @@ jacocoTestReport {
63126 }
64127}
65128
66- wrapper {
67- gradleVersion = ' 6.2.0'
68- }
69-
70129spotless {
71130 java {
72131 target fileTree(projectDir) {
73132 include ' src/main/**/*.java'
133+ include ' src/test/**/*.java'
74134 exclude ' **/build/**'
75135 }
76136 googleJavaFormat(' 1.1' ). aosp()
77137 removeUnusedImports()
78-
79138 }
80139}
81140
@@ -94,14 +153,8 @@ task fatJar(type: Jar) {
94153 with jar
95154}
96155
97- task javadocJar (type : Jar ) {
98- classifier = ' javadoc'
99- from javadoc
100- }
156+ build. dependsOn ' spotlessApply'
101157
102- task sourcesJar (type : Jar ) {
103- classifier = ' sources'
104- from sourceSets. main. allSource
158+ wrapper {
159+ gradleVersion = ' 6.2.0'
105160}
106-
107- build. dependsOn ' spotlessApply'
0 commit comments