-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* style: spotless * chore: moving back to maven packages, adjusting automation * chore: additional rules in build.gradle
- Loading branch information
Kristjan Kosic
authored
Mar 20, 2020
1 parent
446cd5e
commit 2259c69
Showing
17 changed files
with
162 additions
and
149 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
plugins { | ||
id 'java' | ||
id 'maven' | ||
id 'maven-publish' | ||
id 'signing' | ||
id 'jacoco' | ||
id 'com.diffplug.gradle.spotless' version '3.27.2' | ||
} | ||
|
@@ -10,35 +12,6 @@ repositories { | |
mavenCentral() | ||
} | ||
|
||
group = 'org.arkecosystem' | ||
version = '1.0.1' | ||
|
||
publishing { | ||
publishing { | ||
repositories { | ||
maven { | ||
name = "github" | ||
url = uri("https://maven.pkg.github.com/arkecosystem/java-client") | ||
credentials { | ||
username = project.findProperty("gpr.user") ?: System.getenv("USERNAME") | ||
password = project.findProperty("gpr.key") ?: System.getenv("PASSWORD") | ||
} | ||
} | ||
} | ||
publications { | ||
gpr(MavenPublication) { | ||
from(components.java) | ||
} | ||
} | ||
} | ||
|
||
javadoc { | ||
if (JavaVersion.current().isJava9Compatible()) { | ||
options.addBooleanOption('html5', true) | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
compile group: 'com.squareup.okhttp3', name: 'okhttp', version: '4.4.1' | ||
compile group: 'com.squareup.okhttp3', name: 'mockwebserver', version: '4.4.1' | ||
|
@@ -48,6 +21,96 @@ dependencies { | |
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' | ||
} | ||
|
||
task javadocJar(type: Jar) { | ||
classifier = 'javadoc' | ||
from javadoc | ||
} | ||
|
||
task sourcesJar(type: Jar) { | ||
classifier = 'sources' | ||
from sourceSets.main.allSource | ||
} | ||
|
||
artifacts { | ||
archives javadocJar, sourcesJar | ||
} | ||
|
||
uploadArchives { | ||
repositories { | ||
mavenDeployer { | ||
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } | ||
|
||
repository(url: "file://${buildDir}/repo") {} | ||
|
||
// repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2") { | ||
// authentication(userName: '', password: '') | ||
//} | ||
|
||
// snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { | ||
// authentication(userName: ossrhUsername, password: ossrhPassword) | ||
// } | ||
|
||
pom.project { | ||
groupId = 'org.arkecosystem' | ||
version = '1.2.8' | ||
artifactId = 'client' | ||
|
||
name = 'java-client' | ||
description = 'A Simple REST API Client Implementation in Java for the ARK CORE Blockchain Framework.' | ||
url = 'https://sdk.ark.dev/java/client' | ||
inceptionYear = '2018' | ||
|
||
licenses { | ||
license { | ||
name = 'MIT' | ||
distribution = 'repo' | ||
} | ||
} | ||
|
||
developers { | ||
developer { | ||
name = 'Kovač Žan' | ||
email = '[email protected]' | ||
organization = 'ARK Ecosystem' | ||
organizationUrl = 'https://ark.io' | ||
} | ||
developer { | ||
name = 'Kristjan Košič' | ||
email = '[email protected]' | ||
organization = 'ARK Ecosystem' | ||
organizationUrl = 'https://ark.io' | ||
} | ||
developer { | ||
name = 'Brian Faust' | ||
email = '[email protected]' | ||
organization = 'ARK Ecosystem' | ||
organizationUrl = 'https://ark.io' | ||
} | ||
developer { | ||
name = 'Joshua Noack' | ||
email = '[email protected]' | ||
organization = 'ARK Ecosystem' | ||
organizationUrl = 'https://ark.io' | ||
} | ||
} | ||
|
||
scm { | ||
connection = 'scm:git:git://github.com/ArkEcosystem/java-client.git' | ||
developerConnection = 'scm:git:ssh://github.com:ArkEcosystem/java-client.git' | ||
url = 'https://github.com/ArkEcosystem/java-client/tree/1.2.8' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
if (project.hasProperty("signing.keyId")) { | ||
apply plugin: 'signing' | ||
signing { | ||
sign configurations.archives | ||
} | ||
} | ||
|
||
test { | ||
useJUnitPlatform() | ||
failFast = true | ||
|
@@ -63,19 +126,15 @@ jacocoTestReport { | |
} | ||
} | ||
|
||
wrapper { | ||
gradleVersion = '6.2.0' | ||
} | ||
|
||
spotless { | ||
java { | ||
target fileTree(projectDir) { | ||
include 'src/main/**/*.java' | ||
include 'src/test/**/*.java' | ||
exclude '**/build/**' | ||
} | ||
googleJavaFormat('1.1').aosp() | ||
removeUnusedImports() | ||
|
||
} | ||
} | ||
|
||
|
@@ -94,14 +153,8 @@ task fatJar(type: Jar) { | |
with jar | ||
} | ||
|
||
task javadocJar(type: Jar) { | ||
classifier = 'javadoc' | ||
from javadoc | ||
} | ||
build.dependsOn 'spotlessApply' | ||
|
||
task sourcesJar(type: Jar) { | ||
classifier = 'sources' | ||
from sourceSets.main.allSource | ||
wrapper { | ||
gradleVersion = '6.2.0' | ||
} | ||
|
||
build.dependsOn 'spotlessApply' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
rootProject.name = 'java-client' | ||
rootProject.name = 'client' | ||
|
9 changes: 4 additions & 5 deletions
9
src/test/java/org/arkecosystem/client/ConnectionManagerTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 3 additions & 4 deletions
7
src/test/java/org/arkecosystem/client/api/BlockchainTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.