Skip to content

Build is upgraded to Gradle 9.0.0 #851

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

Merged
merged 4 commits into from
Aug 4, 2025
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
54 changes: 25 additions & 29 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ repositories {
val isDevelopmentRelease = !hasProperty("finalRelease")
val releaseVersion = releaseVersion()
val releaseNotes = releaseNotes()
val distributionVersion = distributionVersion()
val buildScanSummaryVersion = "1.0.5-2024.1"

allprojects {
Expand Down Expand Up @@ -278,44 +277,41 @@ val copyLegacyMavenScripts by tasks.registering(Sync::class) {
into(layout.buildDirectory.dir("scripts/maven-legacy"))
}

val assembleGradleScripts by tasks.registering(Zip::class) {
group = "build"
val packageGradleScripts by tasks.registering(PackageScripts::class) {
description = "Packages the Gradle experiment scripts in a zip archive."
archiveBaseName.set("develocity-gradle-build-validation")
archiveFileName.set(archiveBaseName.flatMap { a -> distributionVersion.map { v -> "$a-$v.zip" } })
from(copyGradleScripts)
into(archiveBaseName.get())
distributionName = "develocity-gradle-build-validation"
distributionContents.from(copyGradleScripts)
}

val assembleMavenScripts by tasks.registering(Zip::class) {
group = "build"
val packageMavenScripts by tasks.registering(PackageScripts::class) {
description = "Packages the Maven experiment scripts in a zip archive."
archiveBaseName.set("develocity-maven-build-validation")
archiveFileName.set(archiveBaseName.flatMap { a -> distributionVersion.map { v -> "$a-$v.zip" } })
from(copyMavenScripts)
into(archiveBaseName.get())
distributionName = "develocity-maven-build-validation"
distributionContents.from(copyMavenScripts)
}

val assembleLegacyGradleScripts by tasks.registering(Zip::class) {
group = "build"
description = "Packages the Gradle experiment scripts in a zip archive."
archiveBaseName.set("gradle-enterprise-gradle-build-validation")
archiveFileName.set(archiveBaseName.flatMap { a -> distributionVersion.map { v -> "$a-$v.zip" } })
from(copyLegacyGradleScripts)
into(archiveBaseName.get())
val packageLegacyGradleScripts by tasks.registering(PackageScripts::class) {
description = "Packages the legacy Gradle experiment scripts in a zip archive."
distributionName = "gradle-enterprise-gradle-build-validation"
distributionContents.from(copyLegacyGradleScripts)
}

val assembleLegacyMavenScripts by tasks.registering(Zip::class) {
val packageLegacyMavenScripts by tasks.registering(PackageScripts::class) {
description = "Packages the legacy Maven experiment scripts in a zip archive."
distributionName = "gradle-enterprise-maven-build-validation"
distributionContents.from(copyLegacyMavenScripts)
}

tasks.withType<PackageScripts>().configureEach {
group = "build"
description = "Packages the Maven experiment scripts in a zip archive."
archiveBaseName.set("gradle-enterprise-maven-build-validation")
archiveFileName.set(archiveBaseName.flatMap { a -> distributionVersion.map { v -> "$a-$v.zip" } })
from(copyLegacyMavenScripts)
into(archiveBaseName.get())
distributionVersion = distributionVersion()
}

val assembleScripts by tasks.registering {
dependsOn(tasks.withType<PackageScripts>())
}

tasks.assemble {
dependsOn(assembleGradleScripts, assembleMavenScripts, assembleLegacyGradleScripts, assembleLegacyMavenScripts)
dependsOn(assembleScripts)
}

val shellcheckGradleScripts by tasks.registering(Shellcheck::class) {
Expand Down Expand Up @@ -367,7 +363,7 @@ tasks.check {
val generateChecksums by tasks.registering(Checksum::class) {
group = "distribution"
description = "Generates checksums for the distribution zip files."
inputFiles.setFrom(assembleGradleScripts, assembleMavenScripts, assembleLegacyGradleScripts, assembleLegacyMavenScripts)
inputFiles.setFrom(packageGradleScripts, packageMavenScripts, packageLegacyGradleScripts, packageLegacyMavenScripts)
outputDirectory.set(layout.buildDirectory.dir("distributions/checksums").get().asFile)
checksumAlgorithm.set(Checksum.Algorithm.SHA512)
}
Expand All @@ -383,7 +379,7 @@ githubRelease {
overwrite.set(isDevelopmentRelease)
generateReleaseNotes.set(false)
body.set(releaseNotes)
releaseAssets(assembleGradleScripts, assembleMavenScripts, assembleLegacyGradleScripts, assembleLegacyMavenScripts, generateChecksums.map { it.outputs.files.asFileTree })
releaseAssets(packageGradleScripts, packageMavenScripts, packageLegacyGradleScripts, packageLegacyMavenScripts, generateChecksums.map { it.outputs.files.asFileTree })
}

val createReleaseTag by tasks.registering(CreateGitTag::class) {
Expand Down
6 changes: 3 additions & 3 deletions buildSrc/src/main/kotlin/ApplyArgbash.kt
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ abstract class ApplyArgbash @Inject constructor(
fun applyArgbash() {
val argbash = argbashHome.get().file("bin/argbash").asFile
scriptTemplates.get().visit {
if(!isDirectory) {
val relPath = relativePath.parent.pathString
val parentRelativePath = relativePath.parent?.pathString
if (!isDirectory && parentRelativePath != null) {
val basename = file.nameWithoutExtension
val outputFile = outputDir.get().file("$relPath/$basename.sh").asFile
val outputFile = outputDir.get().file("$parentRelativePath/$basename.sh").asFile
outputFile.parentFile.mkdirs()

logger.info("Applying argbash to $file")
Expand Down
39 changes: 39 additions & 0 deletions buildSrc/src/main/kotlin/PackageScripts.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import org.gradle.api.file.ConfigurableFileCollection
import org.gradle.api.provider.Property
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.InputFiles
import org.gradle.api.tasks.PathSensitive
import org.gradle.api.tasks.PathSensitivity
import org.gradle.api.tasks.bundling.Zip
import org.gradle.work.DisableCachingByDefault

@DisableCachingByDefault(because = "Not worth caching")
abstract class PackageScripts : Zip() {

@get:Input
abstract val distributionName: Property<String>

@get:Input
abstract val distributionVersion: Property<String>

@get:InputFiles
@get:PathSensitive(PathSensitivity.RELATIVE)
abstract val distributionContents: ConfigurableFileCollection

init {
archiveBaseName.set(distributionName)
archiveFileName.set(distributionName.zip(distributionVersion) { name, version -> "$name-$version.zip" })
from(distributionContents) {
include("**/*.sh")
filePermissions {
user {
execute = true
}
}
}
from(distributionContents) {
exclude("**/*.sh")
}
into(archiveBaseName)
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id("java")
id("com.github.johnrengelman.shadow") version "8.1.1"
id("com.gradleup.shadow") version "8.3.8"
}

repositories {
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=bd71102213493060956ec229d946beee57158dbd89d0e62b91bca0fa2c5f3531
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
distributionSha256Sum=8fad3d78296ca518113f3d29016617c7f9367dc005f932bd9d93bf45ba46072b
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion gradlew
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh

#
# Copyright © 2015-2021 the original authors.
# Copyright © 2015 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
Loading