Skip to content

Commit 1414387

Browse files
committed
Set ToolExec base properties using #set instead of #convention
The conventions of these properties can be easily overridden by other plugins such as the base 'java' plugin, where it sets the convention of the JavaLauncher to be the project toolchain. This caused issues with projects that required toolchain language version 8.
1 parent 08f48d8 commit 1414387

File tree

4 files changed

+4
-7
lines changed

4 files changed

+4
-7
lines changed

build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ plugins {
99
id 'eclipse'
1010
id 'maven-publish'
1111
id 'io.freefair.javadoc-links'
12-
alias libs.plugins.licenser
1312
id 'net.minecraftforge.gradleutils'
13+
alias libs.plugins.licenser
1414
alias libs.plugins.gitversion
1515
alias libs.plugins.changelog
1616
alias libs.plugins.plugin.publish
@@ -49,7 +49,6 @@ configurations {
4949
}
5050
}
5151

52-
named('apiElements', applyGradleVersionAttribute)
5352
named('runtimeElements', applyGradleVersionAttribute)
5453
named('shadowRuntimeElements', applyGradleVersionAttribute)
5554
}

settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ plugins {
2222

2323
// https://plugins.gradle.org/plugin/net.minecraftforge.gradleutils
2424
// Gradle utilities for Minecraft Forge projects.
25-
id 'net.minecraftforge.gradleutils' version '3.0.0-beta.10'
25+
id 'net.minecraftforge.gradleutils' version '3.0.0-beta.13'
2626
}
2727

2828
// Known bug with Groovy DSL in IntelliJ, it's never getting fixed

src/main/groovy/net/minecraftforge/gradleutils/GradleUtilsExtensionInternal.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
import org.gradle.api.reflect.HasPublicType;
1010
import org.gradle.api.reflect.TypeOf;
1111

12-
import java.util.Objects;
13-
1412
non-sealed interface GradleUtilsExtensionInternal extends GradleUtilsExtension, HasPublicType {
1513
@Override
1614
default TypeOf<?> getPublicType() {

src/main/groovy/net/minecraftforge/gradleutils/shared/ToolExecBase.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ protected ToolExecBase(Class<P> problemsType, Tool tool) {
6969
this.defaultToolDir.disallowChanges();
7070
this.defaultToolDir.finalizeValueOnRead();
7171

72-
this.getMainClass().convention(Objects.requireNonNull(tool.getMainClass(), "Tool must have a main class"));
73-
this.getJavaLauncher().convention(SharedUtil.launcherForStrictly(this.getJavaToolchainService(), tool.getJavaVersion()));
72+
this.getMainClass().set(Objects.requireNonNull(tool.getMainClass(), "Tool must have a main class"));
73+
this.getJavaLauncher().set(SharedUtil.launcherForStrictly(this.getJavaToolchainService(), tool.getJavaVersion()));
7474
}
7575

7676
/// The enhanced problems instance to use for this task.

0 commit comments

Comments
 (0)