Skip to content

Commit

Permalink
release: 1.2.8 (#98)
Browse files Browse the repository at this point in the history
* 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
Show file tree
Hide file tree
Showing 17 changed files with 162 additions and 149 deletions.
27 changes: 0 additions & 27 deletions .github/workflows/publish-release.yml

This file was deleted.

139 changes: 96 additions & 43 deletions build.gradle
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'
}
Expand All @@ -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'
Expand All @@ -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
Expand All @@ -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()

}
}

Expand All @@ -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'
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
rootProject.name = 'java-client'
rootProject.name = 'client'

Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package org.arkecosystem.client;

import org.arkecosystem.client.api.Api;
import org.junit.jupiter.api.Test;

import java.util.HashMap;

import static junit.framework.TestCase.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertEquals;

import java.util.HashMap;
import org.arkecosystem.client.api.Api;
import org.junit.jupiter.api.Test;

public class ConnectionManagerTest {
@Test
public void connect() {
Expand Down
3 changes: 1 addition & 2 deletions src/test/java/org/arkecosystem/client/MockHelper.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package org.arkecosystem.client;

import java.util.HashMap;
import okhttp3.mockwebserver.MockResponse;
import okhttp3.mockwebserver.MockWebServer;

import java.util.HashMap;

public class MockHelper {
public static Connection connection() {
MockWebServer mockServer = new MockWebServer();
Expand Down
7 changes: 3 additions & 4 deletions src/test/java/org/arkecosystem/client/api/BlockchainTest.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package org.arkecosystem.client.api;

import static org.junit.jupiter.api.Assertions.assertTrue;

import com.google.gson.internal.LinkedTreeMap;
import java.io.IOException;
import org.arkecosystem.client.Connection;
import org.arkecosystem.client.MockHelper;
import org.junit.jupiter.api.Test;

import java.io.IOException;

import static org.junit.jupiter.api.Assertions.assertTrue;

public class BlockchainTest {

@Test
Expand Down
10 changes: 4 additions & 6 deletions src/test/java/org/arkecosystem/client/api/BlocksTest.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
package org.arkecosystem.client.api;

import static org.junit.jupiter.api.Assertions.assertTrue;

import com.google.gson.internal.LinkedTreeMap;
import java.io.IOException;
import java.util.HashMap;
import org.arkecosystem.client.Connection;
import org.arkecosystem.client.MockHelper;
import org.junit.jupiter.api.Test;

import java.io.IOException;
import java.util.HashMap;

import static org.junit.jupiter.api.Assertions.assertTrue;

public class BlocksTest {

@Test
Expand Down Expand Up @@ -53,5 +52,4 @@ void search() throws IOException {
LinkedTreeMap<String, Object> actual = connection.api().blocks.search(new HashMap<>());
assertTrue((boolean) actual.get("success"));
}

}
12 changes: 6 additions & 6 deletions src/test/java/org/arkecosystem/client/api/BridgechainsTest.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
package org.arkecosystem.client.api;

import static org.junit.jupiter.api.Assertions.assertTrue;

import com.google.gson.internal.LinkedTreeMap;
import java.io.IOException;
import java.util.HashMap;
import org.arkecosystem.client.Connection;
import org.arkecosystem.client.MockHelper;
import org.junit.jupiter.api.Test;

import java.io.IOException;
import java.util.HashMap;

import static org.junit.jupiter.api.Assertions.assertTrue;

public class BridgechainsTest {

@Test
Expand All @@ -22,7 +21,8 @@ void all() throws IOException {
@Test
void search() throws IOException {
Connection connection = MockHelper.connection();
LinkedTreeMap<String, Object> actual = connection.api().bridgechains.search(new HashMap<>());
LinkedTreeMap<String, Object> actual =
connection.api().bridgechains.search(new HashMap<>());
assertTrue((boolean) actual.get("success"));
}
}
16 changes: 8 additions & 8 deletions src/test/java/org/arkecosystem/client/api/BusinessesTest.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
package org.arkecosystem.client.api;

import static org.junit.jupiter.api.Assertions.assertTrue;

import com.google.gson.internal.LinkedTreeMap;
import java.io.IOException;
import java.util.HashMap;
import org.arkecosystem.client.Connection;
import org.arkecosystem.client.MockHelper;
import org.junit.jupiter.api.Test;

import java.io.IOException;
import java.util.HashMap;

import static org.junit.jupiter.api.Assertions.assertTrue;

public class BusinessesTest {

@Test
Expand All @@ -29,14 +28,16 @@ void show() throws IOException {
@Test
void showBridgechains() throws IOException {
Connection connection = MockHelper.connection();
LinkedTreeMap<String, Object> actual = connection.api().businesses.showBridgechains("dummy");
LinkedTreeMap<String, Object> actual =
connection.api().businesses.showBridgechains("dummy");
assertTrue((boolean) actual.get("success"));
}

@Test
void showBridgechain() throws IOException {
Connection connection = MockHelper.connection();
LinkedTreeMap<String, Object> actual = connection.api().businesses.showBridgechain("dummy", "dummy");
LinkedTreeMap<String, Object> actual =
connection.api().businesses.showBridgechain("dummy", "dummy");
assertTrue((boolean) actual.get("success"));
}

Expand All @@ -46,5 +47,4 @@ void search() throws IOException {
LinkedTreeMap<String, Object> actual = connection.api().businesses.search(new HashMap<>());
assertTrue((boolean) actual.get("success"));
}

}
10 changes: 4 additions & 6 deletions src/test/java/org/arkecosystem/client/api/DelegatesTest.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
package org.arkecosystem.client.api;

import static org.junit.jupiter.api.Assertions.assertTrue;

import com.google.gson.internal.LinkedTreeMap;
import java.io.IOException;
import java.util.HashMap;
import org.arkecosystem.client.Connection;
import org.arkecosystem.client.MockHelper;
import org.junit.jupiter.api.Test;

import java.io.IOException;
import java.util.HashMap;

import static org.junit.jupiter.api.Assertions.assertTrue;

public class DelegatesTest {

@Test
Expand Down Expand Up @@ -46,5 +45,4 @@ void search() throws IOException {
LinkedTreeMap<String, Object> actual = connection.api().delegates.search(new HashMap<>());
assertTrue((boolean) actual.get("success"));
}

}
Loading

0 comments on commit 2259c69

Please sign in to comment.