Skip to content

Commit

Permalink
Merge pull request #85 from hyperledger/upgradeGradle8.7
Browse files Browse the repository at this point in the history
Upgrade gradle to 8.7
  • Loading branch information
gtebrean authored May 23, 2024
2 parents 8e39807 + 8387bdf commit 8031cb3
Show file tree
Hide file tree
Showing 14 changed files with 337 additions and 240 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,20 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [4.12.0]() (Upcoming)

### Bug Fixes

*

### Features

*

### BREAKING CHANGES

* Upgrade to Gradle 8.7 []()

# [4.11.3](https://github.com/web3j/web3j-gradle-plugin/releases/tag/v4.11.3) (2024-05-02)

### Bug Fixes
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,7 @@ To specify and add different source sets, use the `sourceSets` DSL:
sourceSets {
main {
solidity {
srcDir {
"my/custom/path/to/solidity"
}
srcDir 'my/custom/path/to/solidity'
}
}
}
Expand Down
34 changes: 27 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ plugins {
id 'idea'
id 'maven-publish'
id 'jacoco'
id 'com.diffplug.gradle.spotless' version '4.5.1'
id 'com.gradle.plugin-publish' version '1.2.0'
id 'de.undercouch.download' version '4.1.1'
id 'com.diffplug.spotless' version '6.25.0'
id 'com.gradle.plugin-publish' version '1.2.1'
id 'de.undercouch.download' version '4.1.2'
}

description = 'Gradle plugin providing tasks to generate Web3j contracts from Solidity.'
Expand All @@ -23,6 +23,7 @@ apply {
'javadoc',
'repositories',
'spotless',
'junit'
].each { buildScript ->
download {
src "https://raw.githubusercontent.com/hyperledger/web3j-build-tools/main/gradle/$buildScript/build.gradle"
Expand All @@ -39,9 +40,6 @@ repositories {
maven {
url 'https://plugins.gradle.org/m2/'
}
maven {
url 'https://artifacts.consensys.net/public/maven/maven/'
}
}

dependencies {
Expand All @@ -52,7 +50,6 @@ dependencies {
implementation("org.web3j:codegen:$web3jVersion") {
exclude group: 'org.slf4j', module: 'slf4j-nop'
}
testImplementation "junit:junit:$junitVersion"

configurations.all {
resolutionStrategy {
Expand Down Expand Up @@ -103,3 +100,26 @@ task generateVersionProperties {
tasks.withType(Test) {
reports.html.destination file("${reporting.baseDir}/${name}")
}

tasks.named('spotlessJava') {
dependsOn downloadJavaLicense, downloadFormatterProperties
mustRunAfter tasks.named('compileJava')
mustRunAfter tasks.named('spotlessGroovyGradle')
dependsOn tasks.named('javadoc')
dependsOn tasks.named('pluginDescriptors')
dependsOn tasks.named('processResources')
}

tasks.named('spotlessKotlin') {
dependsOn downloadJavaLicense, downloadFormatterProperties
mustRunAfter tasks.named('compileJava')
mustRunAfter tasks.named('spotlessGroovyGradle')
dependsOn tasks.named('spotlessJava')
}

tasks.named('spotlessCheck') {
dependsOn downloadJavaLicense, downloadFormatterProperties
dependsOn tasks.named('spotlessJava')
dependsOn tasks.named('spotlessKotlin')
dependsOn tasks.named('spotlessGroovyGradle')
}
7 changes: 3 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
group=org.web3j
version=4.11.3
version=4.12.0-SNAPSHOT
org.gradle.caching=true
org.gradle.parallel=true
solidityPluginVersion=0.4.0
kotlinVersion=1.8.10
junitVersion=4.12
solidityPluginVersion=0.5.0
kotlinVersion=1.9.24
2 changes: 1 addition & 1 deletion gradle/jacoco/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ task jacocoRootTestReport(type: org.gradle.testing.jacoco.tasks.JacocoReport) {
getClassDirectories().from(subprojects.sourceSets.main.output)
getExecutionData().from(subprojects.jacocoTestReport.executionData)
reports {
xml.enabled true
xml.required.set(true)
}

doFirst {
Expand Down
17 changes: 17 additions & 0 deletions gradle/junit/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
ext {
junitVersion = '5.9.3'
}

dependencies {
testImplementation "org.junit.jupiter:junit-jupiter-engine:$junitVersion",
"org.junit.jupiter:junit-jupiter-api:$junitVersion",
"org.junit.jupiter:junit-jupiter-params:$junitVersion"
}

test {
useJUnitPlatform()

testLogging {
events "passed", "skipped", "failed"
}
}
1 change: 0 additions & 1 deletion gradle/repositories/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ repositories {
jcenter()
maven { url 'https://oss.sonatype.org/content/repositories/releases/' }
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url "https://artifacts.consensys.net/public/maven/maven/" }
}
26 changes: 22 additions & 4 deletions gradle/spotless/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

apply plugin: 'com.diffplug.gradle.spotless'
apply plugin: 'com.diffplug.spotless'
apply plugin: "de.undercouch.download"

task downloadJavaLicense(type: Download) {
Expand All @@ -26,7 +26,7 @@ spotless {
exclude '**/build/install/**'
}
removeUnusedImports()
googleJavaFormat("1.7").aosp()
googleJavaFormat('1.17.0').aosp()
importOrder 'java', '', 'org.web3j', '\\#'
trimTrailingWhitespace()
endWithNewline()
Expand All @@ -39,7 +39,7 @@ spotless {
exclude '**/.gradle/**'
exclude '**/build/install/**'
}
ktlint('0.31.0')
ktlint('0.49.1')
trimTrailingWhitespace()
endWithNewline()
licenseHeaderFile "$rootDir/gradle/spotless/java.license"
Expand All @@ -52,4 +52,22 @@ spotless {
}
}

spotlessCheck.dependsOn('downloadJavaLicense', 'downloadFormatterProperties')
tasks.named('spotlessJava') {
dependsOn downloadJavaLicense, downloadFormatterProperties
mustRunAfter tasks.named('compileJava')
mustRunAfter tasks.named('spotlessGroovyGradle')
}

tasks.named('spotlessKotlin') {
dependsOn downloadJavaLicense, downloadFormatterProperties
mustRunAfter tasks.named('compileJava')
mustRunAfter tasks.named('spotlessGroovyGradle')
dependsOn tasks.named('spotlessJava')
}

tasks.named('spotlessCheck') {
dependsOn downloadJavaLicense, downloadFormatterProperties
dependsOn tasks.named('spotlessJava')
dependsOn tasks.named('spotlessKotlin')
dependsOn tasks.named('spotlessGroovyGradle')
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 8031cb3

Please sign in to comment.