Skip to content

Commit

Permalink
Merge pull request #763 from web3j/release/4.0
Browse files Browse the repository at this point in the history
Merge release/4.0 to master
  • Loading branch information
snazha-blkio committed Oct 30, 2018
2 parents f8b044a + cf66e64 commit 6160282
Show file tree
Hide file tree
Showing 86 changed files with 2,354 additions and 1,115 deletions.
34 changes: 29 additions & 5 deletions .gitlab-ci.yml
@@ -1,6 +1,13 @@
image: gradle:alpine

variables:
MAVEN_CLI_OPTS: "-s .m2/settings.xml --batch-mode"
MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository"
GRADLE_OPTS: "-Dorg.gradle.daemon=false"


before_script:
- export GRADLE_USER_HOME=`pwd`/.gradle

cache:
paths:
Expand All @@ -10,19 +17,36 @@ cache:
stages:
- build
- test
- deploy

build:
stage: build
script:
- gradle clean build
- gradle clean build -x test

unit tests:
stage: test
script:
- gradle test

# integration tests:
publish_snapshot:
stage: deploy
script:
- gradle uploadArchives

environment:
name: publish_snapshot
when: manual
only:
- /release/.*$/

publish_release:
stage: deploy
script:
- gradle uploadArchives

# stage: test
# script:
# - $ ./gradlew -Pintegration-tests=true :integration-tests:test
environment:
name: publish_release
when: manual
only:
- master
24 changes: 12 additions & 12 deletions README.rst
Expand Up @@ -124,7 +124,7 @@ Java 8:
<dependency>
<groupId>org.web3j</groupId>
<artifactId>core</artifactId>
<version>3.5.0</version>
<version>4.0.0</version>
</dependency>
Android:
Expand All @@ -145,7 +145,7 @@ Java 8:

.. code-block:: groovy
compile ('org.web3j:core:3.5.0')
compile ('org.web3j:core:4.0.0')
Android:

Expand Down Expand Up @@ -203,12 +203,12 @@ To send asynchronous requests using a CompletableFuture (Future on Android):
Web3ClientVersion web3ClientVersion = web3.web3ClientVersion().sendAsync().get();
String clientVersion = web3ClientVersion.getWeb3ClientVersion();
To use an RxJava Observable:
To use an RxJava Flowable:

.. code-block:: java
Web3j web3 = Web3j.build(new HttpService()); // defaults to http://localhost:8545/
web3.web3ClientVersion().observable().subscribe(x -> {
web3.web3ClientVersion().flowable().subscribe(x -> {
String clientVersion = x.getWeb3ClientVersion();
...
});
Expand Down Expand Up @@ -257,7 +257,7 @@ Then generate the wrapper code using web3j's `Command line tools`_:

.. code-block:: bash
web3j solidity generate /path/to/<smart-contract>.bin /path/to/<smart-contract>.abi -o /path/to/src/main/java -p com.your.organisation.name
web3j solidity generate -b /path/to/<smart-contract>.bin -a /path/to/<smart-contract>.abi -o /path/to/src/main/java -p com.your.organisation.name
Now you can create and deploy your smart contract:

Expand Down Expand Up @@ -330,15 +330,15 @@ To receive all new blocks as they are added to the blockchain:

.. code-block:: java
Subscription subscription = web3j.blockObservable(false).subscribe(block -> {
Subscription subscription = web3j.blockFlowable(false).subscribe(block -> {
...
});
To receive all new transactions as they are added to the blockchain:

.. code-block:: java
Subscription subscription = web3j.transactionObservable().subscribe(tx -> {
Subscription subscription = web3j.transactionFlowable().subscribe(tx -> {
...
});
Expand All @@ -347,21 +347,21 @@ been grouped into a block together):

.. code-block:: java
Subscription subscription = web3j.pendingTransactionObservable().subscribe(tx -> {
Subscription subscription = web3j.pendingTransactionFlowable().subscribe(tx -> {
...
});
Or, if you'd rather replay all blocks to the most current, and be notified of new subsequent
blocks being created:

.. code-block:: java
Subscription subscription = catchUpToLatestAndSubscribeToNewBlocksObservable(
Subscription subscription = replayPastAndFutureBlocksFlowable(
<startBlockNumber>, <fullTxObjects>)
.subscribe(block -> {
...
});
There are a number of other transaction and block replay Observables described in the
There are a number of other transaction and block replay Flowables described in the
`docs <http://docs.web3j.io/filters.html>`_.

Topic filters are also supported:
Expand All @@ -371,7 +371,7 @@ Topic filters are also supported:
EthFilter filter = new EthFilter(DefaultBlockParameterName.EARLIEST,
DefaultBlockParameterName.LATEST, <contract-address>)
.addSingleTopic(...)|.addOptionalTopics(..., ...)|...;
web3j.ethLogObservable(filter).subscribe(log -> {
web3j.ethLogFlowable(filter).subscribe(log -> {
...
});
Expand Down Expand Up @@ -576,7 +576,7 @@ To run the integration tests:
Snapshot Dependencies
---------------------

Snapshot versions of web3j follow the ``<major>.<minor>.<build>-SNAPSHOT`` convention, for example: 3.6.0-SNAPSHOT.
Snapshot versions of web3j follow the ``<major>.<minor>.<build>-SNAPSHOT`` convention, for example: 4.0.0-SNAPSHOT.

| If you would like to use snapshots instead please add a new maven repository pointing to:
Expand Down
26 changes: 14 additions & 12 deletions build.gradle
Expand Up @@ -4,9 +4,10 @@ buildscript {
ext.javapoetVersion = '1.7.0'
ext.jnr_unixsocketVersion = '0.15'
ext.okhttpVersion = '3.8.1'
ext.rxjavaVersion = '1.2.4'
ext.rxjavaVersion = '2.2.2'
ext.slf4jVersion = '1.7.25'
ext.javaWebSocketVersion = '1.3.8'
ext.picocliVersion = '3.0.0'

// test dependencies
ext.equalsverifierVersion = '2.1.7'
Expand All @@ -27,7 +28,9 @@ buildscript {

plugins {
id "com.jfrog.bintray" version "1.7.3"
id "net.researchgate.release" version "2.7.0"
id "org.ajoberstar.grgit" version "3.0.0-rc.2"
// TODO: sort out the tagging
// id "net.researchgate.release" version "2.7.0"
}

apply plugin: 'java'
Expand Down Expand Up @@ -122,8 +125,9 @@ configure(subprojects.findAll { it.name != 'integration-tests' }) {
}

ext {
ossrhUsername = project.hasProperty('ossrhUsername') ? project.property('ossrhUsername') : ''
ossrhPassword = project.hasProperty('ossrhPassword') ? project.property('ossrhPassword') : ''
ossrhUsername = project.hasProperty('ossrhUsername') ? project.property('ossrhUsername') : System.getenv('OSSRH_USERNAME')
ossrhPassword = project.hasProperty('ossrhPassword') ? project.property('ossrhPassword') : System.getenv('OSSRH_PASSWORD')
ossrhRepoUrl = project.hasProperty('ossrhRepoUrl') ? project.property('ossrhRepoUrl') : System.getenv('OSSRH_REPO_URL')
bintrayUser = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
bintrayKey = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY')
isSnapshotVersion = project.version.endsWith("-SNAPSHOT")
Expand Down Expand Up @@ -151,11 +155,10 @@ configure(subprojects.findAll { it.name != 'integration-tests' }) {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }

onlyIf {
ossrhUsername != '' && ossrhPassword != ''
ossrhUsername != '' && ossrhPassword != '' && ossrhRepoUrl != ''
}

String repoUrl = isSnapshotVersion ? "http://oss.sonatype.org/content/repositories/snapshots/" : "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
repository(url: repoUrl) {
repository(url: ossrhRepoUrl) {
authentication(
userName: ossrhUsername,
password: ossrhPassword
Expand Down Expand Up @@ -228,11 +231,10 @@ configure(subprojects.findAll { it.name != 'integration-tests' }) {
}
}

release {
tagTemplate = 'v${version}'
failOnCommitNeeded = true
}

//release {
// tagTemplate = 'v${version}'
// failOnCommitNeeded = true
//}

task jacocoRootTestReport(type: org.gradle.testing.jacoco.tasks.JacocoReport) {
dependsOn = subprojects.test
Expand Down
3 changes: 2 additions & 1 deletion codegen/build.gradle
Expand Up @@ -3,6 +3,7 @@ description 'web3j project code generators'

dependencies {
compile project(':core'),
"com.squareup:javapoet:$javapoetVersion"
"com.squareup:javapoet:$javapoetVersion",
"info.picocli:picocli:$picocliVersion"
testCompile project(path: ':core', configuration: 'testArtifacts')
}
Expand Up @@ -17,11 +17,11 @@ abstract class FunctionWrapperGenerator {
final boolean useJavaNativeTypes;

FunctionWrapperGenerator(
String destinationDirLocation,
File destinationDirLocation,
String basePackageName,
boolean useJavaNativeTypes) {

this.destinationDirLocation = new File(destinationDirLocation);
this.destinationDirLocation = destinationDirLocation;
this.basePackageName = basePackageName;
this.useJavaNativeTypes = useJavaNativeTypes;
}
Expand Down

0 comments on commit 6160282

Please sign in to comment.