From 11169d669149b1b802f697b75cba7a0b62586513 Mon Sep 17 00:00:00 2001 From: Kushal Pisavadia Date: Mon, 27 Jan 2025 23:01:19 +0000 Subject: [PATCH] Upgrade gradle to 8.12.1 (from 8.12) and fix some build warnings (#910) Build warning fixes: * Return `tasks.register` as `tasks.create` is deprecated * Use property accessor `.files` instead of function `.files()` --- buildSrc/src/main/kotlin/pklGradlePluginTest.gradle.kts | 6 +++--- gradle/wrapper/gradle-wrapper.properties | 4 ++-- pkl-executor/pkl-executor.gradle.kts | 4 ++-- pkl-tools/pkl-tools.gradle.kts | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/buildSrc/src/main/kotlin/pklGradlePluginTest.gradle.kts b/buildSrc/src/main/kotlin/pklGradlePluginTest.gradle.kts index 7a06d426..6865cb05 100644 --- a/buildSrc/src/main/kotlin/pklGradlePluginTest.gradle.kts +++ b/buildSrc/src/main/kotlin/pklGradlePluginTest.gradle.kts @@ -87,11 +87,11 @@ tasks.addRule("Pattern: compatibilityTest[All|Releases|Latest|Candidate|Nightly| } } -fun createCompatibilityTestTask(versionInfo: GradleVersionInfo): Task = +fun createCompatibilityTestTask(versionInfo: GradleVersionInfo) = createCompatibilityTestTask(versionInfo.version, versionInfo.downloadUrl) -fun createCompatibilityTestTask(version: String, downloadUrl: String): Task { - return tasks.create("compatibilityTest$version", Test::class.java) { +fun createCompatibilityTestTask(version: String, downloadUrl: String): TaskProvider { + return tasks.register("compatibilityTest$version", Test::class.java) { mustRunAfter(tasks.test) maxHeapSize = tasks.test.get().maxHeapSize diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e1b837a1..d7104778 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,7 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionSha256Sum=7a00d51fb93147819aab76024feece20b6b84e420694101f276be952e08bef03 -distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip +distributionSha256Sum=8d97a97984f6cbd2b85fe4c60a743440a347544bf18818048e611f5288d46c94 +distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/pkl-executor/pkl-executor.gradle.kts b/pkl-executor/pkl-executor.gradle.kts index 05583f19..bf362fcd 100644 --- a/pkl-executor/pkl-executor.gradle.kts +++ b/pkl-executor/pkl-executor.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved. + * Copyright © 2024-2025 Apple Inc. and the Pkl project authors. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -68,7 +68,7 @@ sourceSets { main { java { srcDir("src/main/java") } } } val prepareHistoricalDistributions by tasks.registering { val outputDir = layout.buildDirectory.dir("pklHistoricalDistributions") - inputs.files(pklHistoricalDistributions.files()) + inputs.files(pklHistoricalDistributions.files) outputs.dir(outputDir) doLast { val distributionDir = outputDir.get().asFile.toPath().also(Files::createDirectories) diff --git a/pkl-tools/pkl-tools.gradle.kts b/pkl-tools/pkl-tools.gradle.kts index 980d79c5..52217509 100644 --- a/pkl-tools/pkl-tools.gradle.kts +++ b/pkl-tools/pkl-tools.gradle.kts @@ -52,13 +52,13 @@ dependencies { // TODO: need to figure out how to properly generate javadoc here. // For now, we'll include a dummy javadoc jar. -val javadocDummy by tasks.creating(Javadoc::class) { source = dummy.allJava } +val javadocDummy by tasks.registering(Javadoc::class) { source = dummy.allJava } java { withJavadocJar() } val javadocJar by tasks.existing(Jar::class) { - from(javadocDummy.outputs.files) + from(javadocDummy.get().outputs.files) archiveBaseName.set("pkl-tools-all") }