Skip to content
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

Add default includeAllJdks option to generateGradleJdkConfigs #493

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
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
5 changes: 5 additions & 0 deletions changelog/@unreleased/pr-493.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: fix
fix:
description: Add default includeAllJdks option to generateGradleJdkConfigs
links:
- https://github.com/palantir/gradle-jdks/pull/493
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.gradle.api.tasks.Input;
import org.gradle.api.tasks.Nested;
import org.gradle.api.tasks.TaskAction;
import org.gradle.api.tasks.options.Option;
import org.gradle.jvm.toolchain.JavaLanguageVersion;

/**
Expand All @@ -52,6 +53,12 @@ public abstract class GradleJdksConfigs extends DefaultTask {
@Input
public abstract MapProperty<String, String> getCaCerts();

@Input
@Option(
option = "includeAllJdks",
description = "Generates the configuration directories for all configured Java major versions.")
public abstract Property<Boolean> getIncludeAllJdks();

abstract Directory gradleDirectory();

protected abstract void applyGradleJdkFileAction(
Expand All @@ -65,6 +72,11 @@ protected abstract void applyGradleJdkFileAction(

protected abstract void maybePrepareForAction(List<Path> targetPaths);

public GradleJdksConfigs() {
// TODO(crogoz): change to false, once we switch to using jdksExtension's jdkMajorVersionsToUse
getIncludeAllJdks().convention(true);
}

@TaskAction
public final void action() {
Path gradleJdksDir = gradleDirectory().dir("jdks").getAsFile().toPath();
Expand Down