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

Support java.toolchain.languageVersion detection in build.gradle files #32023

Open
rarkins opened this issue Oct 19, 2024 · 0 comments
Open

Support java.toolchain.languageVersion detection in build.gradle files #32023

rarkins opened this issue Oct 19, 2024 · 0 comments
Labels
manager:gradle-wrapper priority-4-low Low priority, unlikely to be done unless it becomes important to more people type:feature Feature (new functionality)

Comments

@rarkins
Copy link
Collaborator

rarkins commented Oct 19, 2024

Describe the proposed change(s).

Related discussion: #31987

Example from a build.gradle.kts file:

java {
    toolchain {
        languageVersion = JavaLanguageVersion.of(22)
    }
}

Ideally this would be used as part of

export async function getJvmConfiguration(
gradlewFile: string,
): Promise<string | null> {
const daemonJvmFile = join(
dirname(gradlewFile),
'gradle/gradle-daemon-jvm.properties',
);
const daemonJvm = await readLocalFile(daemonJvmFile, 'utf8');
if (daemonJvm) {
const TOOLCHAIN_VERSION_REGEX = regEx(
'^(?:toolchainVersion\\s*=\\s*)(?<version>\\d+)$',
'm',
);
const toolChainMatch = TOOLCHAIN_VERSION_REGEX.exec(daemonJvm);
if (toolChainMatch?.groups) {
return toolChainMatch.groups.version;
}
}
return null;
}

@rarkins rarkins added priority-4-low Low priority, unlikely to be done unless it becomes important to more people manager:gradle-wrapper type:feature Feature (new functionality) labels Oct 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
manager:gradle-wrapper priority-4-low Low priority, unlikely to be done unless it becomes important to more people type:feature Feature (new functionality)
Projects
None yet
Development

No branches or pull requests

1 participant