Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to gradle8.7 #111

Merged
merged 5 commits into from
May 27, 2024
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,4 @@ docs/build
.project
.classpath
bin
logs
51 changes: 23 additions & 28 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import java.text.SimpleDateFormat

plugins {
id 'org.jetbrains.kotlin.jvm' version '1.8.10'
id 'org.jetbrains.kotlin.jvm' version '1.9.24'
id "application"
id "distribution"
id "idea"
id "jacoco"
id "com.github.johnrengelman.shadow" version "5.2.0"
id "com.diffplug.gradle.spotless" version "3.25.0"
id "com.github.johnrengelman.shadow" version "8.1.1"
id "com.diffplug.spotless" version "6.25.0"
id "de.undercouch.download" version "4.1.2"
id "de.marcphilipp.nexus-publish" version "0.4.0"
id 'io.codearte.nexus-staging' version '0.21.1'
id 'io.codearte.nexus-staging' version '0.30.0'
id "com.jfrog.bintray" version "1.8.4"
}

Expand All @@ -19,21 +19,20 @@ mainClassName = 'org.web3j.console.Web3j'
applicationName = 'web3j'

ext {
web3jVersion = '4.11.2'
picocli = '4.6.0'
slf4jVersion = '1.7.30'
junitVersion = '5.8.2'
mockitoVersion = '4.1.0'
gsonVersion = '2.8.6'
wireMockVersion = '2.25.1'
kotlinLoggin = '1.7.9'
dockerJavaVersion = '3.2.5'
web3jVersion = '4.12.0'
picocli = '4.7.6'
slf4jVersion = '2.0.13'
junitVersion = '5.9.3'
mockitoVersion = '5.12.0'
mockitoInline = '5.2.0'
gsonVersion = '2.11.0'
wireMockVersion = '3.6.0'
kotlinLoggin = '3.0.5'
dockerJavaVersion = '3.3.6'
web3jEpirusVersion = '0.0.7'
jaxbVersion = '2.2.11'
activationVersion = '1.1.1'
log4jVersion = '2.15.0'
semverVersion = '0.9.0'
commonsLangVersion = '3.9'
log4jVersion = '2.23.1'
semverVersion = '0.10.2'
commonsLangVersion = '3.14.0'
jansiVersion = '2.4.1'
}

Expand Down Expand Up @@ -75,11 +74,11 @@ test {
}

distZip {
archiveName "web3j-${project.version}.zip"
archiveFileName.set("web3j-${project.version}.zip")
}

distTar {
archiveName "web3j-${project.version}.tar"
archiveFileName.set("web3j-${project.version}.tar")
}

dependencies {
Expand All @@ -93,10 +92,6 @@ dependencies {
"io.epirus:epirus-web3j:$web3jEpirusVersion",
"info.picocli:picocli:$picocli",
files('libs/smartcheck.jar'),
"javax.xml.bind:jaxb-api:$jaxbVersion",
"com.sun.xml.bind:jaxb-core:$jaxbVersion",
"com.sun.xml.bind:jaxb-impl:$jaxbVersion",
"javax.activation:activation:$activationVersion",
"com.google.code.gson:gson:$gsonVersion",
"org.apache.commons:commons-lang3:$commonsLangVersion",
"com.github.zafarkhaja:java-semver:$semverVersion",
Expand All @@ -110,8 +105,8 @@ dependencies {

testImplementation "org.junit.jupiter:junit-jupiter:$junitVersion",
"org.mockito:mockito-core:$mockitoVersion",
"org.mockito:mockito-inline:$mockitoVersion",
"com.github.tomakehurst:wiremock-jre8:$wireMockVersion"
"org.mockito:mockito-inline:$mockitoInline",
"org.wiremock:wiremock:$wireMockVersion"
}


Expand All @@ -136,9 +131,9 @@ def getTimestamp() {
classes { dependsOn createProperties }

task shadowBugWorkaround(type: Jar) {
archiveBaseName = 'nested-gradle-jar'
archiveBaseName.set('nested-gradle-jar')
from files(file("${rootDir}/gradle/wrapper/gradle-wrapper.jar"))
destinationDir file('build/shadow-bug-workaround')
destinationDirectory.set(file('build/shadow-bug-workaround'))
}

shadowJar {
Expand Down
4 changes: 3 additions & 1 deletion gradle/jacoco/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ task jacocoRootTestReport(type: org.gradle.testing.jacoco.tasks.JacocoReport) {
getAdditionalSourceDirs().from(subprojects.sourceSets.main.allSource.srcDirs)
getClassDirectories().from(subprojects.sourceSets.main.output)
getExecutionData().from(subprojects.jacocoTestReport.executionData)
reports { xml.enabled = true }
reports {
xml.required.set(true)
}

doFirst {
getExecutionData().from(executionData.findAll { it.exists() })
Expand Down
1 change: 0 additions & 1 deletion gradle/repositories/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,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/" }
}
24 changes: 20 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,20 @@ spotless {
}
}

spotlessCheck.dependsOn('downloadJavaLicense', 'downloadFormatterProperties')
tasks.named('spotlessJava') {
dependsOn downloadJavaLicense, downloadFormatterProperties
dependsOn tasks.named('compileJava'), tasks.named('compileTestJava'), tasks.named('processResources'), tasks.named('processTestResources'), tasks.named('startScripts'), tasks.named('startShadowScripts')
mustRunAfter tasks.named('spotlessGroovyGradle'), tasks.named('test'), tasks.named('jacocoTestReport')
}

tasks.named('spotlessKotlin') {
dependsOn downloadJavaLicense, downloadFormatterProperties
dependsOn tasks.named('compileJava'), tasks.named('compileTestJava'), tasks.named('processResources'), tasks.named('processTestResources'), tasks.named('spotlessJava'), tasks.named('startScripts'), tasks.named('startShadowScripts')
mustRunAfter tasks.named('spotlessGroovyGradle'), tasks.named('test'), tasks.named('jacocoTestReport')
}

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

Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 3 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#Tue Nov 19 11:45:38 GMT 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
Loading