Skip to content

Commit

Permalink
Merge pull request #730 from web3j/release/3.6
Browse files Browse the repository at this point in the history
Merge release/3.6 onto master ahead of the release build
  • Loading branch information
snazha-blkio authored Oct 6, 2018
2 parents 2a259ec + 69349ad commit 13bdc71
Show file tree
Hide file tree
Showing 42 changed files with 648 additions and 168 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ hs_err_pid*
*/build/
*/out/

gradle.properties

# Ignore Gradle GUI config
gradle-app.setting

Expand All @@ -35,6 +33,9 @@ gradle-app.setting

.idea
*.iml
*.ipr
*.iws

geth.sh

# Sphinx generated docs
Expand Down
27 changes: 27 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
variables:
MAVEN_CLI_OPTS: "-s .m2/settings.xml --batch-mode"
MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository"

cache:
paths:
- .m2/repository/
- target/

stages:
- build
- test

build:
stage: build
script:
- gradle clean build

unit tests:
stage: test
script:
- gradle test

# integration tests:
# stage: test
# script:
# - $ ./gradlew -Pintegration-tests=true :integration-tests:test
42 changes: 41 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,10 @@ demonstrates a number of core features of Ethereum with web3j, including:
Getting started
---------------

Add the relevant dependency to your project:
Typically your application should depend on release versions of web3j, but you may also use snapshot dependencies
for early access to features and fixes, refer to the `Snapshot Dependencies`_ section.

| Add the relevant dependency to your project:
Maven
-----
Expand All @@ -134,6 +137,7 @@ Android:
<version>3.3.1-android</version>
</dependency>
Gradle
------

Expand Down Expand Up @@ -568,6 +572,42 @@ To run the integration tests:
$ ./gradlew -Pintegration-tests=true :integration-tests:test
Snapshot Dependencies
---------------------

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

| If you would like to use snapshots instead please add a new maven repository pointing to:
::

https://oss.sonatype.org/content/repositories/snapshots

Please refer to the `maven <https://maven.apache.org/guides/mini/guide-multiple-repositories.html>`_ or `gradle <https://maven.apache.org/guides/mini/guide-multiple-repositories.html>`_ documentation for further detail.

Sample gradle configuration:

.. code-block:: groovy
repositories {
maven {
url "https://oss.sonatype.org/content/repositories/snapshots"
}
}
Sample maven configuration:

.. code-block:: xml
<repositories>
<repository>
<id>sonatype-snasphots</id>
<name>Sonatype snapshots repo</name>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</repository>
</repositories>
Thanks and credits
------------------

Expand Down
36 changes: 24 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

buildscript {
ext.bouncycastleVersion = '1.54'
ext.jacksonVersion = '2.8.5'
Expand Down Expand Up @@ -28,6 +27,7 @@ buildscript {

plugins {
id "com.jfrog.bintray" version "1.7.3"
id "net.researchgate.release" version "2.7.0"
}

apply plugin: 'java'
Expand All @@ -44,9 +44,6 @@ allprojects {
sourceCompatibility = 1.8
targetCompatibility = 1.8

group 'org.web3j'
version '3.5.0'

apply plugin: 'java'
apply plugin: 'jacoco'
apply plugin: 'checkstyle'
Expand Down Expand Up @@ -92,11 +89,11 @@ subprojects {

dependencies {
testCompile "junit:junit:$junitVersion",
"org.mockito:mockito-core:$mockitoVersion"
"org.mockito:mockito-core:$mockitoVersion"
}
}

configure(subprojects.findAll {it.name != 'integration-tests'}) {
configure(subprojects.findAll { it.name != 'integration-tests' }) {
// Required for Maven Nexus repository
apply plugin: 'maven'
apply plugin: 'signing'
Expand Down Expand Up @@ -127,6 +124,9 @@ configure(subprojects.findAll {it.name != 'integration-tests'}) {
ext {
ossrhUsername = project.hasProperty('ossrhUsername') ? project.property('ossrhUsername') : ''
ossrhPassword = project.hasProperty('ossrhPassword') ? project.property('ossrhPassword') : ''
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")
}

publishing {
Expand All @@ -150,7 +150,12 @@ configure(subprojects.findAll {it.name != 'integration-tests'}) {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }

repository(url: 'https://oss.sonatype.org/service/local/staging/deploy/maven2/') {
onlyIf {
ossrhUsername != '' && ossrhPassword != ''
}

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

bintray {
user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY')
user = bintrayUser
key = bintrayKey
publications = ['mavenJava']
publish = true
pkg {
Expand All @@ -214,19 +219,26 @@ configure(subprojects.findAll {it.name != 'integration-tests'}) {
//TODO run clean & closeAndPromoteRepository once
dependsOn 'build'
dependsOn 'uploadArchives'
dependsOn 'bintrayUpload'

if (!isSnapshotVersion && bintrayUser != '' && bintrayKey != '') {
dependsOn 'bintrayUpload'
tasks.findByName('bintrayUpload').mustRunAfter 'build'
}
tasks.findByName('uploadArchives').mustRunAfter 'build'
tasks.findByName('bintrayUpload').mustRunAfter 'build'
}
}

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


task jacocoRootTestReport(type: org.gradle.testing.jacoco.tasks.JacocoReport) {
dependsOn = subprojects.test
additionalSourceDirs = files(subprojects.sourceSets.main.allSource.srcDirs)
sourceDirectories = files(subprojects.sourceSets.main.allSource.srcDirs)
classDirectories = files(subprojects.sourceSets.main.output)
classDirectories = files(subprojects.sourceSets.main.output)
executionData = files(subprojects.jacocoTestReport.executionData)
reports {
xml.enabled = true
Expand Down
Loading

0 comments on commit 13bdc71

Please sign in to comment.