Skip to content

Commit cc911de

Browse files
authored
Merge pull request #851 from gradle/erichaagdev/bump-gradle-9.0.0
Build is upgraded to Gradle 9.0.0
2 parents 69f2f3d + a8da858 commit cc911de

File tree

7 files changed

+71
-36
lines changed

7 files changed

+71
-36
lines changed

build.gradle.kts

Lines changed: 25 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ repositories {
5959
val isDevelopmentRelease = !hasProperty("finalRelease")
6060
val releaseVersion = releaseVersion()
6161
val releaseNotes = releaseNotes()
62-
val distributionVersion = distributionVersion()
6362
val buildScanSummaryVersion = "1.0.5-2024.1"
6463

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

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

290-
val assembleMavenScripts by tasks.registering(Zip::class) {
291-
group = "build"
286+
val packageMavenScripts by tasks.registering(PackageScripts::class) {
292287
description = "Packages the Maven experiment scripts in a zip archive."
293-
archiveBaseName.set("develocity-maven-build-validation")
294-
archiveFileName.set(archiveBaseName.flatMap { a -> distributionVersion.map { v -> "$a-$v.zip" } })
295-
from(copyMavenScripts)
296-
into(archiveBaseName.get())
288+
distributionName = "develocity-maven-build-validation"
289+
distributionContents.from(copyMavenScripts)
297290
}
298291

299-
val assembleLegacyGradleScripts by tasks.registering(Zip::class) {
300-
group = "build"
301-
description = "Packages the Gradle experiment scripts in a zip archive."
302-
archiveBaseName.set("gradle-enterprise-gradle-build-validation")
303-
archiveFileName.set(archiveBaseName.flatMap { a -> distributionVersion.map { v -> "$a-$v.zip" } })
304-
from(copyLegacyGradleScripts)
305-
into(archiveBaseName.get())
292+
val packageLegacyGradleScripts by tasks.registering(PackageScripts::class) {
293+
description = "Packages the legacy Gradle experiment scripts in a zip archive."
294+
distributionName = "gradle-enterprise-gradle-build-validation"
295+
distributionContents.from(copyLegacyGradleScripts)
306296
}
307297

308-
val assembleLegacyMavenScripts by tasks.registering(Zip::class) {
298+
val packageLegacyMavenScripts by tasks.registering(PackageScripts::class) {
299+
description = "Packages the legacy Maven experiment scripts in a zip archive."
300+
distributionName = "gradle-enterprise-maven-build-validation"
301+
distributionContents.from(copyLegacyMavenScripts)
302+
}
303+
304+
tasks.withType<PackageScripts>().configureEach {
309305
group = "build"
310-
description = "Packages the Maven experiment scripts in a zip archive."
311-
archiveBaseName.set("gradle-enterprise-maven-build-validation")
312-
archiveFileName.set(archiveBaseName.flatMap { a -> distributionVersion.map { v -> "$a-$v.zip" } })
313-
from(copyLegacyMavenScripts)
314-
into(archiveBaseName.get())
306+
distributionVersion = distributionVersion()
307+
}
308+
309+
val assembleScripts by tasks.registering {
310+
dependsOn(tasks.withType<PackageScripts>())
315311
}
316312

317313
tasks.assemble {
318-
dependsOn(assembleGradleScripts, assembleMavenScripts, assembleLegacyGradleScripts, assembleLegacyMavenScripts)
314+
dependsOn(assembleScripts)
319315
}
320316

321317
val shellcheckGradleScripts by tasks.registering(Shellcheck::class) {
@@ -367,7 +363,7 @@ tasks.check {
367363
val generateChecksums by tasks.registering(Checksum::class) {
368364
group = "distribution"
369365
description = "Generates checksums for the distribution zip files."
370-
inputFiles.setFrom(assembleGradleScripts, assembleMavenScripts, assembleLegacyGradleScripts, assembleLegacyMavenScripts)
366+
inputFiles.setFrom(packageGradleScripts, packageMavenScripts, packageLegacyGradleScripts, packageLegacyMavenScripts)
371367
outputDirectory.set(layout.buildDirectory.dir("distributions/checksums").get().asFile)
372368
checksumAlgorithm.set(Checksum.Algorithm.SHA512)
373369
}
@@ -383,7 +379,7 @@ githubRelease {
383379
overwrite.set(isDevelopmentRelease)
384380
generateReleaseNotes.set(false)
385381
body.set(releaseNotes)
386-
releaseAssets(assembleGradleScripts, assembleMavenScripts, assembleLegacyGradleScripts, assembleLegacyMavenScripts, generateChecksums.map { it.outputs.files.asFileTree })
382+
releaseAssets(packageGradleScripts, packageMavenScripts, packageLegacyGradleScripts, packageLegacyMavenScripts, generateChecksums.map { it.outputs.files.asFileTree })
387383
}
388384

389385
val createReleaseTag by tasks.registering(CreateGitTag::class) {

buildSrc/src/main/kotlin/ApplyArgbash.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ abstract class ApplyArgbash @Inject constructor(
4242
fun applyArgbash() {
4343
val argbash = argbashHome.get().file("bin/argbash").asFile
4444
scriptTemplates.get().visit {
45-
if(!isDirectory) {
46-
val relPath = relativePath.parent.pathString
45+
val parentRelativePath = relativePath.parent?.pathString
46+
if (!isDirectory && parentRelativePath != null) {
4747
val basename = file.nameWithoutExtension
48-
val outputFile = outputDir.get().file("$relPath/$basename.sh").asFile
48+
val outputFile = outputDir.get().file("$parentRelativePath/$basename.sh").asFile
4949
outputFile.parentFile.mkdirs()
5050

5151
logger.info("Applying argbash to $file")
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import org.gradle.api.file.ConfigurableFileCollection
2+
import org.gradle.api.provider.Property
3+
import org.gradle.api.tasks.Input
4+
import org.gradle.api.tasks.InputFiles
5+
import org.gradle.api.tasks.PathSensitive
6+
import org.gradle.api.tasks.PathSensitivity
7+
import org.gradle.api.tasks.bundling.Zip
8+
import org.gradle.work.DisableCachingByDefault
9+
10+
@DisableCachingByDefault(because = "Not worth caching")
11+
abstract class PackageScripts : Zip() {
12+
13+
@get:Input
14+
abstract val distributionName: Property<String>
15+
16+
@get:Input
17+
abstract val distributionVersion: Property<String>
18+
19+
@get:InputFiles
20+
@get:PathSensitive(PathSensitivity.RELATIVE)
21+
abstract val distributionContents: ConfigurableFileCollection
22+
23+
init {
24+
archiveBaseName.set(distributionName)
25+
archiveFileName.set(distributionName.zip(distributionVersion) { name, version -> "$name-$version.zip" })
26+
from(distributionContents) {
27+
include("**/*.sh")
28+
filePermissions {
29+
user {
30+
execute = true
31+
}
32+
}
33+
}
34+
from(distributionContents) {
35+
exclude("**/*.sh")
36+
}
37+
into(archiveBaseName)
38+
}
39+
}

components/configure-develocity-maven-extension/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
id("java")
3-
id("com.github.johnrengelman.shadow") version "8.1.1"
3+
id("com.gradleup.shadow") version "8.3.8"
44
}
55

66
repositories {

gradle/wrapper/gradle-wrapper.jar

1.65 KB
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionSha256Sum=bd71102213493060956ec229d946beee57158dbd89d0e62b91bca0fa2c5f3531
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
3+
distributionSha256Sum=8fad3d78296ca518113f3d29016617c7f9367dc005f932bd9d93bf45ba46072b
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip
55
networkTimeout=10000
66
validateDistributionUrl=true
77
zipStoreBase=GRADLE_USER_HOME

gradlew

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22

33
#
4-
# Copyright © 2015-2021 the original authors.
4+
# Copyright © 2015 the original authors.
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
77
# you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)