1- buildscript {
2- dependencies {
3- classpath " com.diffplug.spotless:spotless-plugin-gradle:3.27.1"
4- }
5- }
6-
71plugins {
82 id ' java'
9- id ' maven'
103 id ' maven-publish'
11- id ' signing'
124 id ' jacoco'
5+ id ' com.diffplug.gradle.spotless' version ' 3.27.1'
136}
147
15- apply plugin :' java'
16- apply plugin :' maven'
17- apply plugin :' maven-publish'
18- apply plugin : com.diffplug.gradle.spotless.SpotlessPlugin
19-
208repositories {
219 jcenter()
2210 mavenCentral()
2311}
2412
25- task fatJar (type : Jar ) {
26- manifest. from jar. manifest
27- classifier = ' standalone'
28- from {
29- configurations. runtimeClasspath. collect { it. isDirectory() ? it : zipTree(it) }
30- } {
31- exclude " META-INF/*.SF"
32- exclude " META-INF/*.DSA"
33- exclude " META-INF/*.RSA"
34- }
35- with jar
36- }
37-
38- task javadocJar (type : Jar ) {
39- classifier = ' javadoc'
40- from javadoc
41- }
42-
43- task sourcesJar (type : Jar ) {
44- classifier = ' sources'
45- from sourceSets. main. allSource
46- }
47-
48- artifacts {
49- archives javadocJar, sourcesJar
50- }
51-
52- uploadArchives {
53- repositories {
54- mavenDeployer {
55- beforeDeployment { MavenDeployment deployment -> signing. signPom(deployment) }
56-
57- repository(url : " file://${ buildDir} /repo" ) {}
58-
59- // repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2") {
60- // authentication(userName: '', password: '')
61- // }
62-
63- // snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
64- // authentication(userName: ossrhUsername, password: ossrhPassword)
65- // }
66-
67- pom. project {
68- groupId = ' org.arkecosystem'
69- version = ' 1.0.0'
70- artifactId = ' client'
71-
72- name = ' java-client'
73- description = ' A simple Java API client for the ARK Blockchain.'
74- url = ' https://github.com/ArkEcosystem/java-client'
75- inceptionYear = ' 2018'
76-
77- licenses {
78- license {
79- name = ' MIT'
80- distribution = ' repo'
81- }
82- }
83-
84- developers {
85- developer {
86- name = ' Brian Faust'
87- email = ' brian@ark.io'
88- organization = ' Ark Ecosystem'
89- organizationUrl = ' https://ark.io'
90- }
91- developer {
92- name = ' Joshua Noack'
93- email = ' joshua@ark.io'
94- organization = ' Ark Ecosystem'
95- organizationUrl = ' https://ark.io'
96- }
97- developer {
98- name = ' Kristjan Kosic'
99- email = ' kristjan@ark.io'
100- organization = ' Ark Ecosystem'
101- organizationUrl = ' https://ark.io'
102- }
103- developer {
104- name = ' Zan Kovac'
105- email = ' zan@ark.io'
106- organization = ' Ark Ecosystem'
107- organizationUrl = ' https://ark.io'
108- }
109- }
110-
111- scm {
112- connection = ' scm:git:git://github.com/ArkEcosystem/java-client.git'
113- developerConnection = ' scm:git:ssh://github.com:ArkEcosystem/java-client.git'
114- url = ' https://github.com/ArkEcosystem/java-client/tree/1.0.0'
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" )
11525 }
11626 }
11727 }
28+ publications {
29+ gpr(MavenPublication ) {
30+ from(components. java)
31+ }
32+ }
11833 }
119- }
120-
121- if (project. hasProperty(" signing.keyId" )) {
122- apply plugin :' signing'
12334
124- signing {
125- sign configurations. archives
35+ javadoc {
36+ if (JavaVersion . current(). isJava9Compatible()) {
37+ options. addBooleanOption(' html5' , true )
38+ }
12639 }
12740}
12841
@@ -151,7 +64,7 @@ jacocoTestReport {
15164}
15265
15366wrapper {
154- gradleVersion = ' 5. 6.2'
67+ gradleVersion = ' 6.2.0 '
15568}
15669
15770spotless {
@@ -160,12 +73,35 @@ spotless {
16073 include ' src/main/**/*.java'
16174 exclude ' **/build/**'
16275 }
163- googleJavaFormat()
76+ googleJavaFormat(' 1.1 ' ) . aosp( )
16477 removeUnusedImports()
16578
16679 }
16780}
16881
16982task formatCode (dependsOn : [' spotlessApply' ])
17083
84+ task fatJar (type : Jar ) {
85+ manifest. from jar. manifest
86+ classifier = ' standalone'
87+ from {
88+ configurations. runtimeClasspath. collect { it. isDirectory() ? it : zipTree(it) }
89+ } {
90+ exclude " META-INF/*.SF"
91+ exclude " META-INF/*.DSA"
92+ exclude " META-INF/*.RSA"
93+ }
94+ with jar
95+ }
96+
97+ task javadocJar (type : Jar ) {
98+ classifier = ' javadoc'
99+ from javadoc
100+ }
101+
102+ task sourcesJar (type : Jar ) {
103+ classifier = ' sources'
104+ from sourceSets. main. allSource
105+ }
106+
171107build. dependsOn ' spotlessApply'
0 commit comments