Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
= PolkaJ - Polkadot Java Client
:lib-version: 0.3.0
:lib-version-dev: 0.4.0-SNAPSHOT
:lib-version-dev: 0.5.0-SNAPSHOT

image:https://github.com/emeraldpay/polkaj/workflows/Tests/badge.svg["Unit Tests"]
image:https://codecov.io/gh/emeraldpay/polkaj/branch/master/graph/badge.svg["Coverage",link="https://codecov.io/gh/emeraldpay/polkaj"]
Expand Down Expand Up @@ -61,7 +61,9 @@ See link:docs/[Documentation] in `./docs` directory, and a demonstration in `./e
.Show current finalized block
[source,java]
----
PolkadotHttpApi client = PolkadotHttpApi.newBuilder().build();
PolkadotHttpApi client = PolkadotApi.newBuilder()
.rpcCallAdapter(JavaHttpAdapter.newBuilder().build())
.build();
Future<Hash256> hashFuture = client.execute(
PolkadotApi.commands().getFinalizedHead()
);
Expand Down
136 changes: 2 additions & 134 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
buildscript {
repositories {
maven { url "https://dl.bintray.com/nebula/gradle-plugins" }
}

dependencies {
classpath 'com.netflix.nebula:gradle-aggregate-javadocs-plugin:3.0.1'
Expand All @@ -18,7 +15,7 @@ apply plugin: 'jacoco'

allprojects {
group = 'io.emeraldpay.polkaj'
version = "0.4.0-SNAPSHOT"
version = "0.5.0-SNAPSHOT"

repositories {
mavenLocal()
Expand All @@ -28,148 +25,19 @@ allprojects {
//for java-multibase
maven { url 'https://jitpack.io' }
}
}

subprojects {
apply plugin: 'java'
apply plugin: 'java-library'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'groovy'
apply plugin: 'jacoco'
apply plugin: 'com.jfrog.bintray'

targetCompatibility = '11'
sourceCompatibility = '11'

[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'

compileJava.options.compilerArgs \
<< '-Xlint:unchecked' << '-Xlint:deprecation'

dependencies {
testImplementation 'org.objenesis:objenesis:3.1'
testImplementation ('org.spockframework:spock-core:2.0-M2-groovy-3.0') {
exclude group: 'org.codehaus.groovy'
}
testImplementation "nl.jqno.equalsverifier:equalsverifier:3.3"
testImplementation 'org.codehaus.groovy:groovy-all:3.0.3'
testImplementation 'commons-codec:commons-codec:1.14'
testImplementation 'cglib:cglib-nodep:3.3.0'
}

test {
jvmArgs '-ea'
systemProperty "java.library.path", file("${project.rootDir}/polkaj-schnorrkel/build/rust/release").absolutePath
useJUnitPlatform()
testLogging.showStandardStreams = true
testLogging.exceptionFormat = 'full'
}

jacocoTestReport {
reports {
xml.enabled true
}
}

test.finalizedBy jacocoTestReport

task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}

task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}

artifacts {
archives sourcesJar
archives javadocJar
}

jacoco {
toolVersion = "0.8.5"
}

publishing {
publications {
mavenJava(MavenPublication) {
groupId project.group
artifactId project.name
version project.version

from components.java
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
pom {
name = 'Polkadot Java Client'
description = 'Java client library to access Polkadot based networks'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
}
}
}
}

bintray {
user = System.getenv('BINTRAY_USER')
key = System.getenv('BINTRAY_API_KEY')

dryRun=false
publish=true
override=true

publications = ['mavenJava']

pkg {
userOrg = 'emerald'
repo = 'polkaj'
name = project.name
licenses = ['Apache-2.0']
vcsUrl = 'https://github.com/emeraldpay/polkaj.git'
labels = ['polkadot', 'blockchain']
publicDownloadNumbers = true

version {
name = project.version
description = 'PolkaJ ' + project.version
released = new Date()
vcsTag = project.version

gpg {
sign = true
}
}
}
}
}

jacoco {
toolVersion = "0.8.5"
}

task coverageReport(type: JacocoReport) {
dependsOn = subprojects.test
additionalSourceDirs.setFrom files(subprojects.sourceSets.main.allSource.srcDirs)
sourceDirectories.setFrom files(subprojects.sourceSets.main.allSource.srcDirs)
classDirectories.setFrom files(subprojects.sourceSets.main.output)
executionData.setFrom project.fileTree(dir: '.', include: '**/build/jacoco/test.exec')
reports {
html.enabled true
xml.enabled true
csv.enabled false
html.enabled true
}
}

Expand Down
145 changes: 145 additions & 0 deletions common_java_app.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
apply plugin: 'java'
apply plugin: 'java-library'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'groovy'
apply plugin: 'jacoco'
apply plugin: 'com.jfrog.bintray'

afterEvaluate {
rootProject.tasks.coverageReport.additionalSourceDirs.setFrom rootProject.tasks.coverageReport.additionalSourceDirs.files + files(it.sourceSets.main.allSource.srcDirs)
rootProject.tasks.coverageReport.sourceDirectories.setFrom rootProject.tasks.coverageReport.sourceDirectories.files + files(it.sourceSets.main.allSource.srcDirs)
rootProject.tasks.coverageReport.classDirectories.setFrom rootProject.tasks.coverageReport.classDirectories.files + files(it.sourceSets.main.output)
}


tasks.withType(JavaCompile) {
options.debug = true
}

compileJava {
targetCompatibility = '8'
sourceCompatibility = '8'
}


[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'

compileJava.options.compilerArgs \
<< '-Xlint:unchecked' << '-Xlint:deprecation'

dependencies {
testImplementation 'org.objenesis:objenesis:3.1'
testImplementation ('org.spockframework:spock-core:2.0-M2-groovy-3.0') {
exclude group: 'org.codehaus.groovy'
}
testImplementation "nl.jqno.equalsverifier:equalsverifier:3.3"
testImplementation 'org.codehaus.groovy:groovy-all:3.0.3'
testImplementation 'commons-codec:commons-codec:1.14'
testImplementation 'cglib:cglib-nodep:3.3.0'
}

test {
jvmArgs '-ea'
systemProperty "java.library.path", file("${project.rootDir}/polkaj-schnorrkel/build/rust/release").absolutePath
useJUnitPlatform()
testLogging.showStandardStreams = true
testLogging.exceptionFormat = 'full'
}

// Must be after sourceSets closure
jacocoTestReport {
dependsOn tasks.test

//noinspection GroovyAssignabilityCheck
sourceSets sourceSets.main
reports {
html.enabled = true
xml.enabled = true
csv.enabled = false
}
}
tasks.check.dependsOn tasks.jacocoTestReport
rootProject.tasks.coverageReport.dependsOn tasks.test
test.finalizedBy jacocoTestReport

task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}

task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}

artifacts {
archives sourcesJar
archives javadocJar
}

jacoco {
toolVersion = "0.8.5"
}

publishing {
publications {
mavenJava(MavenPublication) {
groupId project.group
artifactId project.name
version project.version

from components.java
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
pom {
name = 'Polkadot Java Client'
description = 'Java client library to access Polkadot based networks'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
}
}
}
}

bintray {
user = System.getenv('BINTRAY_USER')
key = System.getenv('BINTRAY_API_KEY')

dryRun=false
publish=true
override=true

publications = ['mavenJava']

pkg {
userOrg = 'emerald'
repo = 'polkaj'
name = project.name
licenses = ['Apache-2.0']
vcsUrl = 'https://github.com/emeraldpay/polkaj.git'
labels = ['polkadot', 'blockchain']
publicDownloadNumbers = true

version {
name = project.version
description = 'PolkaJ ' + project.version
released = new Date()
vcsTag = project.version

gpg {
sign = true
}
}
}
}
Loading