Skip to content

Commit

Permalink
feat!: update gradle to 8.5 (#92203)
Browse files Browse the repository at this point in the history
* update gradle to 8.5
* using JavaToolChain with Java 17
* replaced calls to deprecated code where possible
* updated documentation
* removed usage if scmversion-plugin
  • Loading branch information
skiesewetter-intershop committed Jan 10, 2024
1 parent e140bcb commit a3c35b7
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 44 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ The plugin can be applied to all Gradle Intershop projects.
In build.gradle:
```groovy
plugins {
id "com.intershop.gradle.architectural.report" version "4.0.0"
id "com.intershop.gradle.architectural.report" version "5.0.0"
}
architectureReport {
Expand All @@ -35,7 +35,7 @@ architectureReport {
In build.gradle.kts:
```kotlin
plugins {
id("com.intershop.gradle.architectural.report") version "4.0.0"
id("com.intershop.gradle.architectural.report") version "5.0.0"
}

architectureReport {
Expand Down
58 changes: 25 additions & 33 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,27 +35,17 @@ plugins {
// artifact signing - necessary on Maven Central
signing

// intershop version plugin
id("com.intershop.gradle.scmversion") version "6.2.1"

// plugin for publishing to Gradle Portal
id("com.gradle.plugin-publish") version "1.2.1"
}

scm {
version {
type = "threeDigits"
initialVersion = "1.0.0"
}
}

// release configuration
group = "com.intershop.gradle.architectural.report"
description = "Gradle architectural report plugin"

// IMPORTANT version referenced at README.md, adapt it there
version = scm.version.version
// IMPORTANT version referenced at README.md, adapt it there
// apply gradle property 'projectVersion' to project.version, default to 'LOCAL'
val projectVersion : String? by project
version = projectVersion ?: "LOCAL"

// set correct project status
if (project.version.toString().endsWith("-SNAPSHOT")) {
Expand All @@ -68,11 +58,13 @@ val sonatypePassword: String? by project
repositories {
gradlePluginPortal()
mavenCentral()
mavenLocal()
}

val pluginUrl = "https://github.com/IntershopCommunicationsAG/${project.name}"
gradlePlugin {
website.set("https://github.com/IntershopCommunicationsAG/${project.name}")
vcsUrl.set("https://github.com/IntershopCommunicationsAG/${project.name}")
website.set(pluginUrl)
vcsUrl.set(pluginUrl)
plugins {
create("ArchitectureReportPlugin") {
id = "com.intershop.gradle.architectural.report"
Expand All @@ -85,27 +77,36 @@ gradlePlugin {
}

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17

withJavadocJar()
withSourcesJar()
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}

// set correct project status
if (project.version.toString().endsWith("-SNAPSHOT")) {
status = "snapshot'"
status = "snapshot"
}

jacoco {
toolVersion = "0.8.10"
}

tasks {
withType<Test> {
useJUnitPlatform()
testing {
suites.withType<JvmTestSuite> {
useJUnitJupiter()
dependencies {
runtimeOnly("org.junit.platform:junit-platform-launcher:1.10.1")
implementation("org.junit.jupiter:junit-jupiter:5.10.1")
implementation("org.hamcrest:hamcrest:2.2")
implementation("com.google.jimfs:jimfs:1.3.0")
implementation("com.squareup.okhttp3:mockwebserver:4.12.0")
}
}
}

tasks {
register("generateResources") {
// Generate properties file with plugin version to access this information in plugin itself
val versionPropertyFile = project.layout.buildDirectory.file("generated/version.properties")
Expand All @@ -116,10 +117,6 @@ tasks {
}
}

withType<KotlinCompile> {
kotlinOptions.jvmTarget = JavaVersion.VERSION_17.toString()
}

withType<ProcessResources> {
from(files(getTasksByName("generateResources", false)))
}
Expand Down Expand Up @@ -179,9 +176,9 @@ publishing {
}

scm {
connection.set("https://github.com/IntershopCommunicationsAG/${project.name}.git")
connection.set(pluginUrl)
developerConnection.set("[email protected]:IntershopCommunicationsAG/${project.name}.git")
url.set("https://github.com/IntershopCommunicationsAG/${project.name}")
url.set(pluginUrl)
}
}
}
Expand Down Expand Up @@ -216,9 +213,4 @@ dependencies {

runtimeOnly("ch.qos.logback:logback-classic:1.4.14")

testRuntimeOnly("org.junit.platform:junit-platform-launcher:1.10.1")
testImplementation("org.junit.jupiter:junit-jupiter:5.10.1")
testImplementation("org.hamcrest:hamcrest:2.2")
testImplementation("com.google.jimfs:jimfs:1.3.0")
testImplementation("com.squareup.okhttp3:mockwebserver:4.12.0")
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
14 changes: 7 additions & 7 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,15 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -202,11 +202,11 @@ fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
Expand Down
13 changes: 12 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
rootProject.name = "architectural-report-gradle-plugin"
plugins {
id("com.gradle.enterprise") version "3.16.1"
}

gradleEnterprise {
buildScan {
termsOfServiceUrl = "https://gradle.com/terms-of-service"
termsOfServiceAgree = "yes"
}
}

rootProject.name = "architectural-report-gradle-plugin"

0 comments on commit a3c35b7

Please sign in to comment.