1
1
plugins {
2
- id ' jacoco'
3
- id ' java-library'
4
- id ' maven-publish'
2
+ id " jacoco"
3
+ id " java-library"
4
+ id " maven-publish"
5
5
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 "
8
8
}
9
9
10
10
repositories {
11
11
mavenLocal()
12
12
mavenCentral()
13
- jcenter()
14
13
}
15
14
16
15
group = groupId
17
16
version = artifactVersion
18
17
19
- sourceCompatibility = 1.8
20
- targetCompatibility = 1.8
18
+ sourceCompatibility = JavaVersion . VERSION_1_8
19
+ targetCompatibility = JavaVersion . VERSION_1_8
21
20
22
21
spotless {
23
22
java {
24
- encoding ' UTF-8'
23
+ encoding " UTF-8"
25
24
removeUnusedImports()
26
25
eclipse(). configFile " ${ projectDir} /config/codestyle.xml"
27
26
}
28
27
}
29
28
30
29
sonarqube {
31
30
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"
35
34
}
36
35
}
37
36
38
37
dependencies {
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 "
41
40
42
- testImplementation ' junit:junit:4.13.1'
41
+ testImplementation " junit:junit:4.13.1"
43
42
}
44
43
45
44
test {
46
- failFast = true
47
-
48
45
useJUnit()
49
46
testLogging {
50
- events " passed" , " skipped" , " failed"
51
- exceptionFormat " full"
47
+ events( " passed" , " skipped" , " failed" )
48
+ exceptionFormat( " full" )
52
49
}
53
- }
54
50
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
+ }
69
55
}
70
56
71
57
publishing {
@@ -74,27 +60,27 @@ publishing {
74
60
from components. java
75
61
76
62
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."
80
66
81
67
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"
85
71
}
86
72
87
73
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"
92
78
}
93
79
94
80
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"
98
84
}
99
85
}
100
86
}
@@ -103,7 +89,7 @@ publishing {
103
89
maven {
104
90
def releasesRepoUrl = " https://oss.sonatype.org/service/local/staging/deploy/maven2"
105
91
def snapshotsRepoUrl = " https://oss.sonatype.org/content/repositories/snapshots/"
106
- url = version. endsWith(' SNAPSHOT' ) ? snapshotsRepoUrl : releasesRepoUrl
92
+ url = version. endsWith(" SNAPSHOT" ) ? snapshotsRepoUrl : releasesRepoUrl
107
93
credentials {
108
94
username System . getenv(" OSS_USERNAME" )
109
95
password System . getenv(" OSS_PASSWORD" )
@@ -112,6 +98,17 @@ publishing {
112
98
}
113
99
}
114
100
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
+
115
112
check. dependsOn jacocoTestReport
116
113
jacocoTestReport {
117
114
reports {
@@ -120,16 +117,16 @@ jacocoTestReport {
120
117
}
121
118
}
122
119
120
+ javadoc {
121
+ options. encoding = " UTF-8"
122
+ if (JavaVersion . current(). isJava9Compatible()) {
123
+ options. addBooleanOption(" html5" , true )
124
+ }
125
+ }
126
+
123
127
if (project. hasProperty(" signing.keyId" )) {
124
- apply plugin : ' signing'
128
+ apply plugin : " signing"
125
129
signing {
126
130
sign publishing. publications. mavenJava
127
131
}
128
132
}
129
-
130
- javadoc {
131
- options. encoding = " UTF-8"
132
- if (JavaVersion . current(). isJava9Compatible()) {
133
- options. addBooleanOption(' html5' , true )
134
- }
135
- }
0 commit comments