Skip to content

Commit 724269f

Browse files
committed
Remove Gradle version attribute from the shared library
The Gradle version attribute is primarily used to enforce that a specific Gradle version is used for a plugin. Since the GradleUtils Shared library is not a plugin, this causes issues if added as a dependency because Gradle will indescriminately check the current daemon's running Gradle version even if it has nothing to do with its application. Since this is an internal library, I am not going to enforce the Gradle API dependency constraint on this library, especially since the Gradle API artifact is not centralized or declares any capabilities. But, if non-Forge consumers wish to use GradleUtils Shared for their plugins, it is up to them to make sure their implementation Gradle version is high enough. As if right now, it is 8.13.
1 parent 530f956 commit 724269f

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

gradleutils-shared/build.gradle

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,12 @@ base.archivesName = 'gradleutils-shared'
1919
group = 'net.minecraftforge'
2020
// version set by gitversion in settings.gradle
2121

22-
println "Version: $version"
23-
2422
java {
2523
toolchain.languageVersion = JavaLanguageVersion.of(8)
2624
withSourcesJar()
2725
withJavadocJar()
2826
}
2927

30-
configurations {
31-
// Applies the "Gradle Plugin API Version" attribute to configuration
32-
// This was added in Gradle 7, gives consumers useful errors if they are on an old version
33-
def applyGradleVersionAttribute = { Configuration configuration ->
34-
configuration.attributes {
35-
attribute(GradlePluginApiVersion.GRADLE_PLUGIN_API_VERSION_ATTRIBUTE, objects.named(GradlePluginApiVersion, libs.versions.gradle.asProvider().get()))
36-
}
37-
}
38-
39-
named(JavaPlugin.RUNTIME_ELEMENTS_CONFIGURATION_NAME, applyGradleVersionAttribute)
40-
named(ShadowJavaPlugin.SHADOW_RUNTIME_ELEMENTS_CONFIGURATION_NAME, applyGradleVersionAttribute)
41-
}
42-
4328
dependencies {
4429
// Static Analysis
4530
compileOnly libs.nulls

0 commit comments

Comments
 (0)