Skip to content

Commit 13bdc71

Browse files
authored
Merge pull request #730 from web3j/release/3.6
Merge release/3.6 onto master ahead of the release build
2 parents 2a259ec + 69349ad commit 13bdc71

42 files changed

Lines changed: 648 additions & 168 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ hs_err_pid*
1919
*/build/
2020
*/out/
2121

22-
gradle.properties
23-
2422
# Ignore Gradle GUI config
2523
gradle-app.setting
2624

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

3634
.idea
3735
*.iml
36+
*.ipr
37+
*.iws
38+
3839
geth.sh
3940

4041
# Sphinx generated docs

.gitlab-ci.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
variables:
2+
MAVEN_CLI_OPTS: "-s .m2/settings.xml --batch-mode"
3+
MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository"
4+
5+
cache:
6+
paths:
7+
- .m2/repository/
8+
- target/
9+
10+
stages:
11+
- build
12+
- test
13+
14+
build:
15+
stage: build
16+
script:
17+
- gradle clean build
18+
19+
unit tests:
20+
stage: test
21+
script:
22+
- gradle test
23+
24+
# integration tests:
25+
# stage: test
26+
# script:
27+
# - $ ./gradlew -Pintegration-tests=true :integration-tests:test

README.rst

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,10 @@ demonstrates a number of core features of Ethereum with web3j, including:
109109
Getting started
110110
---------------
111111

112-
Add the relevant dependency to your project:
112+
Typically your application should depend on release versions of web3j, but you may also use snapshot dependencies
113+
for early access to features and fixes, refer to the `Snapshot Dependencies`_ section.
114+
115+
| Add the relevant dependency to your project:
113116
114117
Maven
115118
-----
@@ -134,6 +137,7 @@ Android:
134137
<version>3.3.1-android</version>
135138
</dependency>
136139
140+
137141
Gradle
138142
------
139143

@@ -568,6 +572,42 @@ To run the integration tests:
568572
569573
$ ./gradlew -Pintegration-tests=true :integration-tests:test
570574
575+
576+
Snapshot Dependencies
577+
---------------------
578+
579+
Snapshot versions of web3j follow the ``<major>.<minor>.<build>-SNAPSHOT`` convention, for example: 3.6.0-SNAPSHOT.
580+
581+
| If you would like to use snapshots instead please add a new maven repository pointing to:
582+
583+
::
584+
585+
https://oss.sonatype.org/content/repositories/snapshots
586+
587+
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.
588+
589+
Sample gradle configuration:
590+
591+
.. code-block:: groovy
592+
593+
repositories {
594+
maven {
595+
url "https://oss.sonatype.org/content/repositories/snapshots"
596+
}
597+
}
598+
599+
Sample maven configuration:
600+
601+
.. code-block:: xml
602+
603+
<repositories>
604+
<repository>
605+
<id>sonatype-snasphots</id>
606+
<name>Sonatype snapshots repo</name>
607+
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
608+
</repository>
609+
</repositories>
610+
571611
Thanks and credits
572612
------------------
573613

build.gradle

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
buildscript {
32
ext.bouncycastleVersion = '1.54'
43
ext.jacksonVersion = '2.8.5'
@@ -28,6 +27,7 @@ buildscript {
2827

2928
plugins {
3029
id "com.jfrog.bintray" version "1.7.3"
30+
id "net.researchgate.release" version "2.7.0"
3131
}
3232

3333
apply plugin: 'java'
@@ -44,9 +44,6 @@ allprojects {
4444
sourceCompatibility = 1.8
4545
targetCompatibility = 1.8
4646

47-
group 'org.web3j'
48-
version '3.5.0'
49-
5047
apply plugin: 'java'
5148
apply plugin: 'jacoco'
5249
apply plugin: 'checkstyle'
@@ -92,11 +89,11 @@ subprojects {
9289

9390
dependencies {
9491
testCompile "junit:junit:$junitVersion",
95-
"org.mockito:mockito-core:$mockitoVersion"
92+
"org.mockito:mockito-core:$mockitoVersion"
9693
}
9794
}
9895

99-
configure(subprojects.findAll {it.name != 'integration-tests'}) {
96+
configure(subprojects.findAll { it.name != 'integration-tests' }) {
10097
// Required for Maven Nexus repository
10198
apply plugin: 'maven'
10299
apply plugin: 'signing'
@@ -127,6 +124,9 @@ configure(subprojects.findAll {it.name != 'integration-tests'}) {
127124
ext {
128125
ossrhUsername = project.hasProperty('ossrhUsername') ? project.property('ossrhUsername') : ''
129126
ossrhPassword = project.hasProperty('ossrhPassword') ? project.property('ossrhPassword') : ''
127+
bintrayUser = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
128+
bintrayKey = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY')
129+
isSnapshotVersion = project.version.endsWith("-SNAPSHOT")
130130
}
131131

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

153-
repository(url: 'https://oss.sonatype.org/service/local/staging/deploy/maven2/') {
153+
onlyIf {
154+
ossrhUsername != '' && ossrhPassword != ''
155+
}
156+
157+
String repoUrl = isSnapshotVersion ? "http://oss.sonatype.org/content/repositories/snapshots/" : "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
158+
repository(url: repoUrl) {
154159
authentication(
155160
userName: ossrhUsername,
156161
password: ossrhPassword
@@ -193,8 +198,8 @@ configure(subprojects.findAll {it.name != 'integration-tests'}) {
193198
}
194199

195200
bintray {
196-
user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
197-
key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY')
201+
user = bintrayUser
202+
key = bintrayKey
198203
publications = ['mavenJava']
199204
publish = true
200205
pkg {
@@ -214,19 +219,26 @@ configure(subprojects.findAll {it.name != 'integration-tests'}) {
214219
//TODO run clean & closeAndPromoteRepository once
215220
dependsOn 'build'
216221
dependsOn 'uploadArchives'
217-
dependsOn 'bintrayUpload'
218222

223+
if (!isSnapshotVersion && bintrayUser != '' && bintrayKey != '') {
224+
dependsOn 'bintrayUpload'
225+
tasks.findByName('bintrayUpload').mustRunAfter 'build'
226+
}
219227
tasks.findByName('uploadArchives').mustRunAfter 'build'
220-
tasks.findByName('bintrayUpload').mustRunAfter 'build'
221228
}
222229
}
223230

231+
release {
232+
tagTemplate = 'v${version}'
233+
failOnCommitNeeded = true
234+
}
235+
224236

225237
task jacocoRootTestReport(type: org.gradle.testing.jacoco.tasks.JacocoReport) {
226238
dependsOn = subprojects.test
227239
additionalSourceDirs = files(subprojects.sourceSets.main.allSource.srcDirs)
228240
sourceDirectories = files(subprojects.sourceSets.main.allSource.srcDirs)
229-
classDirectories = files(subprojects.sourceSets.main.output)
241+
classDirectories = files(subprojects.sourceSets.main.output)
230242
executionData = files(subprojects.jacocoTestReport.executionData)
231243
reports {
232244
xml.enabled = true

0 commit comments

Comments
 (0)