11plugins {
2- id ' jacoco'
3- id ' java-library'
4- id ' maven-publish'
2+ id " jacoco"
3+ id " java-library"
4+ id " maven-publish"
55
6- id ' org.sonarqube' version ' 3.1.1 '
7- id ' com.diffplug.spotless' version ' 5.11.0 '
6+ id " org.sonarqube" version " 3.3 "
7+ id " com.diffplug.spotless" version " 5.14.3 "
88}
99
1010repositories {
1111 mavenLocal()
1212 mavenCentral()
13- jcenter()
1413}
1514
1615group = groupId
1716version = artifactVersion
1817
19- sourceCompatibility = 1.8
20- targetCompatibility = 1.8
18+ sourceCompatibility = JavaVersion . VERSION_1_8
19+ targetCompatibility = JavaVersion . VERSION_1_8
2120
2221spotless {
2322 java {
24- encoding ' UTF-8'
23+ encoding " UTF-8"
2524 removeUnusedImports()
2625 eclipse(). configFile " ${ projectDir} /config/codestyle.xml"
2726 }
2827}
2928
3029sonarqube {
3130 properties {
32- property ' sonar.host.url' , ' https://sonarcloud.io'
33- property ' sonar.organization' , ' goodforgod'
34- property ' sonar.projectKey' , ' GoodforGod_java-etherscan-api'
31+ property " sonar.host.url" , " https://sonarcloud.io"
32+ property " sonar.organization" , " goodforgod"
33+ property " sonar.projectKey" , " GoodforGod_java-etherscan-api"
3534 }
3635}
3736
3837dependencies {
39- implementation ' org.jetbrains:annotations:20.1.0 '
40- implementation ' com.google.code.gson:gson:2.8.6 '
38+ implementation " org.jetbrains:annotations:22.0.0 "
39+ implementation " com.google.code.gson:gson:2.8.8 "
4140
42- testImplementation ' junit:junit:4.13.1'
41+ testImplementation " junit:junit:4.13.1"
4342}
4443
4544test {
46- failFast = true
47-
4845 useJUnit()
4946 testLogging {
50- events " passed" , " skipped" , " failed"
51- exceptionFormat " full"
47+ events( " passed" , " skipped" , " failed" )
48+ exceptionFormat( " full" )
5249 }
53- }
5450
55- tasks. withType(JavaCompile ) {
56- options. encoding = ' UTF-8'
57- options. incremental = true
58- options. fork = true
59- }
60-
61- tasks. withType(Test ) {
62- reports. html. enabled = false
63- reports. junitXml. enabled = false
64- }
65-
66- java {
67- withJavadocJar()
68- withSourcesJar()
51+ reports {
52+ html. enabled(false )
53+ junitXml. enabled(false )
54+ }
6955}
7056
7157publishing {
@@ -74,27 +60,27 @@ publishing {
7460 from components. java
7561
7662 pom {
77- name = ' Java Etherscan API'
78- url = ' https://github.com/GoodforGod/java-etherscan-api'
79- description = ' Library is a wrapper for EtherScan API.'
63+ name = " Java Etherscan API"
64+ url = " https://github.com/GoodforGod/java-etherscan-api"
65+ description = " Library is a wrapper for EtherScan API."
8066
8167 license {
82- name = ' MIT License'
83- url = ' https://github.com/GoodforGod/java-etherscan-api/blob/master/LICENSE'
84- distribution = ' repo'
68+ name = " MIT License"
69+ url = " https://github.com/GoodforGod/java-etherscan-api/blob/master/LICENSE"
70+ distribution = " repo"
8571 }
8672
8773 developer {
88- id = ' GoodforGod'
89- name = ' Anton Kurako'
90- email = ' goodforgod.dev@gmail.com'
91- url = ' https://github.com/GoodforGod'
74+ id = " GoodforGod"
75+ name = " Anton Kurako"
76+ email = " goodforgod.dev@gmail.com"
77+ url = " https://github.com/GoodforGod"
9278 }
9379
9480 scm {
95- connection = ' scm:git:git://github.com/GoodforGod/java-etherscan-api.git'
96- developerConnection = ' scm:git:ssh://GoodforGod/java-etherscan-api.git'
97- url = ' https://github.com/GoodforGod/java-etherscan-api/tree/master'
81+ connection = " scm:git:git://github.com/GoodforGod/java-etherscan-api.git"
82+ developerConnection = " scm:git:ssh://GoodforGod/java-etherscan-api.git"
83+ url = " https://github.com/GoodforGod/java-etherscan-api/tree/master"
9884 }
9985 }
10086 }
@@ -103,7 +89,7 @@ publishing {
10389 maven {
10490 def releasesRepoUrl = " https://oss.sonatype.org/service/local/staging/deploy/maven2"
10591 def snapshotsRepoUrl = " https://oss.sonatype.org/content/repositories/snapshots/"
106- url = version. endsWith(' SNAPSHOT' ) ? snapshotsRepoUrl : releasesRepoUrl
92+ url = version. endsWith(" SNAPSHOT" ) ? snapshotsRepoUrl : releasesRepoUrl
10793 credentials {
10894 username System . getenv(" OSS_USERNAME" )
10995 password System . getenv(" OSS_PASSWORD" )
@@ -112,6 +98,17 @@ publishing {
11298 }
11399}
114100
101+ java {
102+ withJavadocJar()
103+ withSourcesJar()
104+ }
105+
106+ tasks. withType(JavaCompile ) {
107+ options. encoding(" UTF-8" )
108+ options. incremental(true )
109+ options. fork = true
110+ }
111+
115112check. dependsOn jacocoTestReport
116113jacocoTestReport {
117114 reports {
@@ -120,16 +117,16 @@ jacocoTestReport {
120117 }
121118}
122119
120+ javadoc {
121+ options. encoding = " UTF-8"
122+ if (JavaVersion . current(). isJava9Compatible()) {
123+ options. addBooleanOption(" html5" , true )
124+ }
125+ }
126+
123127if (project. hasProperty(" signing.keyId" )) {
124- apply plugin : ' signing'
128+ apply plugin : " signing"
125129 signing {
126130 sign publishing. publications. mavenJava
127131 }
128132}
129-
130- javadoc {
131- options. encoding = " UTF-8"
132- if (JavaVersion . current(). isJava9Compatible()) {
133- options. addBooleanOption(' html5' , true )
134- }
135- }
0 commit comments