Bump Gradle to 9.4.1 (#1502)

This commit is contained in:
Daniel Chao
2026-04-07 08:32:43 -07:00
committed by GitHub
parent 7dedddcdb1
commit 8b892f9409
16 changed files with 49 additions and 19 deletions
@@ -1,5 +1,5 @@
/*
* Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved.
* Copyright © 2024-2026 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.
@@ -19,12 +19,14 @@ import java.io.File;
import org.gradle.api.file.RegularFileProperty;
import org.gradle.api.provider.Property;
import org.gradle.api.provider.Provider;
import org.gradle.api.tasks.CacheableTask;
import org.gradle.api.tasks.Input;
import org.gradle.api.tasks.Optional;
import org.gradle.api.tasks.OutputFile;
import org.pkl.cli.CliImportAnalyzer;
import org.pkl.cli.CliImportAnalyzerOptions;
@CacheableTask
public abstract class AnalyzeImportsTask extends ModulesTask {
@OutputFile
@Optional
@@ -36,11 +36,14 @@ import org.gradle.api.provider.MapProperty;
import org.gradle.api.provider.Property;
import org.gradle.api.provider.Provider;
import org.gradle.api.provider.ProviderFactory;
import org.gradle.api.tasks.CacheableTask;
import org.gradle.api.tasks.Input;
import org.gradle.api.tasks.InputFile;
import org.gradle.api.tasks.InputFiles;
import org.gradle.api.tasks.Internal;
import org.gradle.api.tasks.Optional;
import org.gradle.api.tasks.PathSensitive;
import org.gradle.api.tasks.PathSensitivity;
import org.gradle.api.tasks.TaskAction;
import org.pkl.commons.cli.CliBaseOptions;
import org.pkl.core.evaluatorSettings.Color;
@@ -48,6 +51,7 @@ import org.pkl.core.util.LateInit;
import org.pkl.core.util.Nullable;
import org.pkl.gradle.utils.PluginUtils;
@CacheableTask
public abstract class BasePklTask extends DefaultTask {
private static final String TRUFFLE_USE_FALLBACK_RUNTIME_FLAG = "truffle.UseFallbackRuntime";
@@ -67,6 +71,7 @@ public abstract class BasePklTask extends DefaultTask {
public abstract MapProperty<String, String> getExternalProperties();
@InputFiles
@PathSensitive(PathSensitivity.ABSOLUTE)
public abstract ConfigurableFileCollection getModulePath();
@Internal
@@ -79,6 +84,7 @@ public abstract class BasePklTask extends DefaultTask {
@InputFile
@Optional
@PathSensitive(PathSensitivity.ABSOLUTE)
public Provider<File> getSettingsModuleFile() {
return getParsedSettingsModule()
.map(
@@ -1,5 +1,5 @@
/*
* Copyright © 2024-2025 Apple Inc. and the Pkl project authors. All rights reserved.
* Copyright © 2024-2026 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.
@@ -18,10 +18,12 @@ package org.pkl.gradle.task;
import org.gradle.api.file.DirectoryProperty;
import org.gradle.api.provider.MapProperty;
import org.gradle.api.provider.Property;
import org.gradle.api.tasks.CacheableTask;
import org.gradle.api.tasks.Input;
import org.gradle.api.tasks.Optional;
import org.gradle.api.tasks.OutputDirectory;
@CacheableTask
public abstract class CodeGenTask extends ModulesTask {
@OutputDirectory
public abstract DirectoryProperty getOutputDir();
@@ -1,5 +1,5 @@
/*
* Copyright © 2024-2025 Apple Inc. and the Pkl project authors. All rights reserved.
* Copyright © 2024-2026 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.
@@ -24,6 +24,7 @@ import org.gradle.api.file.FileCollection;
import org.gradle.api.file.RegularFileProperty;
import org.gradle.api.provider.Property;
import org.gradle.api.provider.Provider;
import org.gradle.api.tasks.CacheableTask;
import org.gradle.api.tasks.Input;
import org.gradle.api.tasks.Internal;
import org.gradle.api.tasks.Optional;
@@ -32,6 +33,7 @@ import org.gradle.api.tasks.OutputFiles;
import org.pkl.cli.CliEvaluator;
import org.pkl.cli.CliEvaluatorOptions;
@CacheableTask
public abstract class EvalTask extends ModulesTask {
// not tracked because it might contain placeholders
@@ -1,5 +1,5 @@
/*
* Copyright © 2024-2025 Apple Inc. and the Pkl project authors. All rights reserved.
* Copyright © 2024-2026 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.
@@ -17,11 +17,13 @@ package org.pkl.gradle.task;
import java.io.File;
import org.gradle.api.provider.Property;
import org.gradle.api.tasks.CacheableTask;
import org.gradle.api.tasks.Input;
import org.gradle.api.tasks.Optional;
import org.pkl.codegen.java.CliJavaCodeGenerator;
import org.pkl.codegen.java.CliJavaCodeGeneratorOptions;
@CacheableTask
public abstract class JavaCodeGenTask extends CodeGenTask {
@Input
public abstract Property<Boolean> getGenerateGetters();
@@ -1,5 +1,5 @@
/*
* Copyright © 2024-2025 Apple Inc. and the Pkl project authors. All rights reserved.
* Copyright © 2024-2026 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.
@@ -17,10 +17,12 @@ package org.pkl.gradle.task;
import java.io.File;
import org.gradle.api.provider.Property;
import org.gradle.api.tasks.CacheableTask;
import org.gradle.api.tasks.Input;
import org.pkl.codegen.kotlin.CliKotlinCodeGenerator;
import org.pkl.codegen.kotlin.CliKotlinCodeGeneratorOptions;
@CacheableTask
public abstract class KotlinCodeGenTask extends CodeGenTask {
@Input
public abstract Property<Boolean> getGenerateKdoc();
@@ -30,16 +30,20 @@ import org.gradle.api.file.FileCollection;
import org.gradle.api.provider.ListProperty;
import org.gradle.api.provider.Property;
import org.gradle.api.provider.Provider;
import org.gradle.api.tasks.CacheableTask;
import org.gradle.api.tasks.Input;
import org.gradle.api.tasks.InputFiles;
import org.gradle.api.tasks.Internal;
import org.gradle.api.tasks.Optional;
import org.gradle.api.tasks.PathSensitive;
import org.gradle.api.tasks.PathSensitivity;
import org.gradle.api.tasks.TaskAction;
import org.pkl.commons.cli.CliBaseOptions;
import org.pkl.core.evaluatorSettings.Color;
import org.pkl.core.util.Pair;
import org.pkl.gradle.utils.PluginUtils;
@CacheableTask
public abstract class ModulesTask extends BasePklTask {
// We expose the contents of this property as task inputs via the sourceModuleFiles
// and sourceModuleUris properties. We cannot use two separate properties because
@@ -49,6 +53,7 @@ public abstract class ModulesTask extends BasePklTask {
public abstract ListProperty<Object> getSourceModules();
@InputFiles
@PathSensitive(PathSensitivity.ABSOLUTE)
public abstract ListProperty<File> getTransitiveModules();
private final Map<List<Object>, Pair<List<File>, List<URI>>> parsedSourceModulesCache =
@@ -63,6 +68,7 @@ public abstract class ModulesTask extends BasePklTask {
// We use @InputFiles and FileCollection here to ensure that file contents are tracked.
@InputFiles
@PathSensitive(PathSensitivity.ABSOLUTE)
public FileCollection getSourceModuleFiles() {
return getProject().files(getParsedSourceModules().map(it -> it.first));
}
@@ -1,5 +1,5 @@
/*
* Copyright © 2024-2025 Apple Inc. and the Pkl project authors. All rights reserved.
* Copyright © 2024-2026 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.
@@ -17,11 +17,13 @@ package org.pkl.gradle.task;
import org.gradle.api.file.DirectoryProperty;
import org.gradle.api.provider.Property;
import org.gradle.api.tasks.CacheableTask;
import org.gradle.api.tasks.Input;
import org.gradle.api.tasks.OutputDirectory;
import org.pkl.doc.CliDocGenerator;
import org.pkl.doc.CliDocGeneratorOptions;
@CacheableTask
public abstract class PkldocTask extends ModulesTask {
@OutputDirectory
public abstract DirectoryProperty getOutputDir();
@@ -1,5 +1,5 @@
/*
* Copyright © 2024-2025 Apple Inc. and the Pkl project authors. All rights reserved.
* Copyright © 2024-2026 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.
@@ -27,6 +27,8 @@ import org.gradle.api.tasks.InputFiles;
import org.gradle.api.tasks.Internal;
import org.gradle.api.tasks.Optional;
import org.gradle.api.tasks.OutputDirectory;
import org.gradle.api.tasks.PathSensitive;
import org.gradle.api.tasks.PathSensitivity;
import org.gradle.api.tasks.UntrackedTask;
import org.pkl.cli.CliProjectPackager;
import org.pkl.commons.cli.CliTestOptions;
@@ -34,6 +36,7 @@ import org.pkl.commons.cli.CliTestOptions;
@UntrackedTask(because = "Output names are known only after execution")
public abstract class ProjectPackageTask extends BasePklTask {
@InputFiles
@PathSensitive(PathSensitivity.ABSOLUTE)
public abstract ConfigurableFileCollection getProjectDirectories();
@Internal
@@ -1,5 +1,5 @@
/*
* Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved.
* Copyright © 2024-2026 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.
@@ -23,10 +23,14 @@ import java.util.stream.Collectors;
import org.gradle.api.InvalidUserDataException;
import org.gradle.api.file.ConfigurableFileCollection;
import org.gradle.api.provider.Provider;
import org.gradle.api.tasks.CacheableTask;
import org.gradle.api.tasks.InputFiles;
import org.gradle.api.tasks.Internal;
import org.gradle.api.tasks.PathSensitive;
import org.gradle.api.tasks.PathSensitivity;
import org.pkl.cli.CliProjectResolver;
@CacheableTask
public abstract class ProjectResolveTask extends BasePklTask {
@Internal
public abstract ConfigurableFileCollection getProjectDirectories();
@@ -34,6 +38,7 @@ public abstract class ProjectResolveTask extends BasePklTask {
// Only the `PklProject` files matter for creating PklProject.deps.json files.
// Otherwise, these tasks can be considered up to date.
@InputFiles
@PathSensitive(PathSensitivity.ABSOLUTE)
public Provider<List<File>> getProjectPklFiles() {
return getProjectDirectories()
.getElements()
@@ -18,12 +18,14 @@ package org.pkl.gradle.task;
import java.io.PrintWriter;
import org.gradle.api.file.DirectoryProperty;
import org.gradle.api.provider.Property;
import org.gradle.api.tasks.CacheableTask;
import org.gradle.api.tasks.Input;
import org.gradle.api.tasks.Optional;
import org.gradle.api.tasks.OutputDirectory;
import org.pkl.cli.CliTestRunner;
import org.pkl.commons.cli.CliTestOptions;
@CacheableTask
public abstract class TestTask extends ModulesTask {
@Optional
@OutputDirectory