Skip to content

Commit 3405883

Browse files
committed
[2.1.0-SNAPSHOT]
build.gradle updated for new CI CONTRIBUTING.md added README.md updated
1 parent 3a87ca8 commit 3405883

8 files changed

+92
-23
lines changed

CONTRIBUTING.md

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Contributing Code or Documentation Guide
2+
3+
## Running Tests
4+
5+
The new code should contain tests that check new behavior.
6+
7+
Run tests `./gradlew test` to check that code works as behavior.
8+
9+
## Code Style
10+
11+
The code base should remain clean, following industry best practices for organization, javadoc and style, as much as possible.
12+
13+
To run the Code Style check use `./gradlew spotlessCheck`.
14+
15+
If check found any errors, you can apply Code Style by running `./gradlew spotlessApply`
16+
17+
## Creating a pull request
18+
19+
Once you are satisfied with your changes:
20+
21+
- Commit changes to the local branch you created.
22+
- Push that branch with changes to the corresponding remote branch on GitHub
23+
- Submit a [pull request](https://help.github.com/articles/creating-a-pull-request) to `dev` branch.

README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Java EtherScan API
22

33
[![Minimum required Java version](https://img.shields.io/badge/Java-1.8%2B-blue?logo=openjdk)](https://openjdk.org/projects/jdk8/)
4-
[![GitHub Action](https://github.com/goodforgod/java-etherscan-api/workflows/Java%20CI/badge.svg)](https://github.com/GoodforGod/java-etherscan-api/actions?query=workflow%3A%22Java+CI%22)
4+
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.goodforgod/java-etherscan-api/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.goodforgod/java-etherscan-api)
5+
[![Java CI](https://github.com/GoodforGod/java-etherscan-api/workflows/CI%20Master/badge.svg)](https://github.com/GoodforGod/java-etherscan-api/actions?query=workflow%3ACI+Master)
56
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=GoodforGod_java-etherscan-api&metric=coverage)](https://sonarcloud.io/dashboard?id=GoodforGod_java-etherscan-api)
67
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=GoodforGod_java-etherscan-api&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=GoodforGod_java-etherscan-api)
78
[![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=GoodforGod_java-etherscan-api&metric=ncloc)](https://sonarcloud.io/dashboard?id=GoodforGod_java-etherscan-api)
@@ -14,15 +15,15 @@ Library supports EtherScan *API* for all available *Ethereum Networks* for *ethe
1415

1516
**Gradle**
1617
```groovy
17-
implementation "com.github.goodforgod:java-etherscan-api:2.0.0"
18+
implementation "com.github.goodforgod:java-etherscan-api:2.1.0"
1819
```
1920

2021
**Maven**
2122
```xml
2223
<dependency>
2324
<groupId>com.github.goodforgod</groupId>
2425
<artifactId>java-etherscan-api</artifactId>
25-
<version>2.0.0</version>
26+
<version>2.1.0</version>
2627
</dependency>
2728
```
2829

_config.yml

-1
This file was deleted.

build.gradle

+40-8
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ plugins {
33
id "java-library"
44
id "maven-publish"
55

6-
id "org.sonarqube" version "3.3"
7-
id "com.diffplug.spotless" version "6.12.0"
6+
id "org.sonarqube" version "4.3.0.3225"
7+
id "com.diffplug.spotless" version "6.19.0"
8+
id "io.github.gradle-nexus.publish-plugin" version "1.3.0"
89
}
910

1011
repositories {
@@ -13,7 +14,8 @@ repositories {
1314
}
1415

1516
group = groupId
16-
version = artifactVersion
17+
var ver = System.getenv().getOrDefault("RELEASE_VERSION", artifactVersion)
18+
version = ver.startsWith("v") ? ver.substring(1) : ver
1719

1820
sourceCompatibility = JavaVersion.VERSION_1_8
1921
targetCompatibility = JavaVersion.VERSION_1_8
@@ -28,6 +30,7 @@ dependencies {
2830
}
2931

3032
test {
33+
failFast(false)
3134
useJUnitPlatform()
3235
testLogging {
3336
events("passed", "skipped", "failed")
@@ -36,17 +39,21 @@ test {
3639
}
3740

3841
reports {
39-
html.enabled(false)
40-
junitXml.enabled(false)
42+
html.required = false
43+
junitXml.required = false
4144
}
45+
46+
environment([
47+
"": "",
48+
])
4249
}
4350

4451
spotless {
4552
java {
4653
encoding("UTF-8")
4754
importOrder()
4855
removeUnusedImports()
49-
eclipse("4.21.0").configFile("${rootDir}/config/codestyle.xml")
56+
eclipse("4.21").configFile("${rootDir}/config/codestyle.xml")
5057
}
5158
}
5259

@@ -58,6 +65,18 @@ sonarqube {
5865
}
5966
}
6067

68+
nexusPublishing {
69+
packageGroup = groupId
70+
repositories {
71+
sonatype {
72+
username = System.getenv("OSS_USERNAME")
73+
password = System.getenv("OSS_PASSWORD")
74+
nexusUrl.set(uri("https://oss.sonatype.org/service/local/"))
75+
snapshotRepositoryUrl.set(uri("https://oss.sonatype.org/content/repositories/snapshots/"))
76+
}
77+
}
78+
}
79+
6180
publishing {
6281
publications {
6382
mavenJava(MavenPublication) {
@@ -99,6 +118,16 @@ publishing {
99118
password System.getenv("OSS_PASSWORD")
100119
}
101120
}
121+
if (!version.endsWith("SNAPSHOT")) {
122+
maven {
123+
name = "GitHubPackages"
124+
url = "https://maven.pkg.github.com/GoodforGod/$artifactId"
125+
credentials {
126+
username = System.getenv("GITHUB_ACTOR")
127+
password = System.getenv("GITHUB_TOKEN")
128+
}
129+
}
130+
}
102131
}
103132
}
104133

@@ -116,7 +145,7 @@ tasks.withType(JavaCompile) {
116145
check.dependsOn jacocoTestReport
117146
jacocoTestReport {
118147
reports {
119-
xml.enabled true
148+
xml.required = true
120149
html.destination file("${buildDir}/jacocoHtml")
121150
}
122151
}
@@ -128,9 +157,12 @@ javadoc {
128157
}
129158
}
130159

131-
if (project.hasProperty("signing.keyId")) {
160+
if (project.hasProperty("signingKey")) {
132161
apply plugin: "signing"
133162
signing {
163+
def signingKey = findProperty("signingKey")
164+
def signingPassword = findProperty("signingPassword")
165+
useInMemoryPgpKeys(signingKey, signingPassword)
134166
sign publishing.publications.mavenJava
135167
}
136168
}

gradle/wrapper/gradle-wrapper.jar

1.99 KB
Binary file not shown.
+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
4+
networkTimeout=10000
45
zipStoreBase=GRADLE_USER_HOME
56
zipStorePath=wrapper/dists

gradlew

+14-4
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
# Darwin, MinGW, and NonStop.
5656
#
5757
# (3) This script is generated from the Groovy template
58-
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
58+
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
5959
# within the Gradle project.
6060
#
6161
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -80,10 +80,10 @@ do
8080
esac
8181
done
8282

83-
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
84-
85-
APP_NAME="Gradle"
83+
# This is normally unused
84+
# shellcheck disable=SC2034
8685
APP_BASE_NAME=${0##*/}
86+
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
8787

8888
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
8989
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
@@ -143,12 +143,16 @@ fi
143143
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
144144
case $MAX_FD in #(
145145
max*)
146+
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
147+
# shellcheck disable=SC3045
146148
MAX_FD=$( ulimit -H -n ) ||
147149
warn "Could not query maximum file descriptor limit"
148150
esac
149151
case $MAX_FD in #(
150152
'' | soft) :;; #(
151153
*)
154+
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
155+
# shellcheck disable=SC3045
152156
ulimit -n "$MAX_FD" ||
153157
warn "Could not set maximum file descriptor limit to $MAX_FD"
154158
esac
@@ -205,6 +209,12 @@ set -- \
205209
org.gradle.wrapper.GradleWrapperMain \
206210
"$@"
207211

212+
# Stop when "xargs" is not available.
213+
if ! command -v xargs >/dev/null 2>&1
214+
then
215+
die "xargs is not available"
216+
fi
217+
208218
# Use "xargs" to parse quoted args.
209219
#
210220
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.

gradlew.bat

+9-6
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
@rem limitations under the License.
1515
@rem
1616

17-
@if "%DEBUG%" == "" @echo off
17+
@if "%DEBUG%"=="" @echo off
1818
@rem ##########################################################################
1919
@rem
2020
@rem Gradle startup script for Windows
@@ -25,7 +25,8 @@
2525
if "%OS%"=="Windows_NT" setlocal
2626

2727
set DIRNAME=%~dp0
28-
if "%DIRNAME%" == "" set DIRNAME=.
28+
if "%DIRNAME%"=="" set DIRNAME=.
29+
@rem This is normally unused
2930
set APP_BASE_NAME=%~n0
3031
set APP_HOME=%DIRNAME%
3132

@@ -40,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
4041

4142
set JAVA_EXE=java.exe
4243
%JAVA_EXE% -version >NUL 2>&1
43-
if "%ERRORLEVEL%" == "0" goto execute
44+
if %ERRORLEVEL% equ 0 goto execute
4445

4546
echo.
4647
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
7576

7677
:end
7778
@rem End local scope for the variables with windows NT shell
78-
if "%ERRORLEVEL%"=="0" goto mainEnd
79+
if %ERRORLEVEL% equ 0 goto mainEnd
7980

8081
:fail
8182
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
8283
rem the _cmd.exe /c_ return code!
83-
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
84-
exit /b 1
84+
set EXIT_CODE=%ERRORLEVEL%
85+
if %EXIT_CODE% equ 0 set EXIT_CODE=1
86+
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
87+
exit /b %EXIT_CODE%
8588

8689
:mainEnd
8790
if "%OS%"=="Windows_NT" endlocal

0 commit comments

Comments
 (0)