@@ -17,7 +17,7 @@ plugins {
1717 alias libs. plugins. shadow
1818}
1919
20- final projectDisplayName = ' Git Version Gradle Plugin'
20+ gradleutils . displayName = ' Git Version Gradle Plugin'
2121description = ' A gradle plugin for using Git Version to manage version numbers.'
2222base. archivesName = ' gitversion-gradle'
2323group = ' net.minecraftforge'
@@ -29,18 +29,7 @@ java {
2929 withJavadocJar()
3030}
3131
32- configurations {
33- // Applies the "Gradle Plugin API Version" attribute to configuration
34- // This was added in Gradle 7, gives consumers useful errors if they are on an old version
35- def applyGradleVersionAttribute = { Configuration configuration ->
36- configuration. attributes {
37- attribute(GradlePluginApiVersion . GRADLE_PLUGIN_API_VERSION_ATTRIBUTE , objects. named(GradlePluginApiVersion , libs. versions. gradle. get()))
38- }
39- }
40-
41- named(JavaPlugin . RUNTIME_ELEMENTS_CONFIGURATION_NAME , applyGradleVersionAttribute)
42- named(ShadowJavaPlugin . SHADOW_RUNTIME_ELEMENTS_CONFIGURATION_NAME , applyGradleVersionAttribute)
43- }
32+ gradleutils. pluginDevDefaults(configurations, libs. versions. gradle)
4433
4534dependencies {
4635 // Static Analysis
@@ -60,15 +49,6 @@ dependencies {
6049 implementation libs. gson
6150}
6251
63- // Removes local Gradle API from compileOnly. This is a workaround for bugged plugins.
64- // Publish Plugin: https://github.com/gradle/plugin-portal-requests/issues/260
65- // Shadow: https://github.com/GradleUp/shadow/pull/1422
66- afterEvaluate { project ->
67- project. configurations. named(JavaPlugin . COMPILE_ONLY_CONFIGURATION_NAME ) { compileOnly ->
68- compileOnly. dependencies. remove(project. dependencies. gradleApi())
69- }
70- }
71-
7252license {
7353 header = rootProject. file(' ../LICENSE-header.txt' )
7454 newLine = false
@@ -85,17 +65,8 @@ tasks.named('shadowJar', ShadowJar) {
8565 relocationPrefix = ' net.minecraftforge.gitversion.gradle.shadow'
8666}
8767
88- tasks. withType(GroovyCompile ). configureEach {
89- groovyOptions. optimizationOptions. indy = true
90- }
91-
9268tasks. withType(Javadoc ). configureEach {
9369 javadocTool = javaToolchains. javadocToolFor { languageVersion = JavaLanguageVersion . of(24 ) }
94-
95- options { StandardJavadocDocletOptions options ->
96- options. windowTitle = projectDisplayName + project. version
97- options. tags ' apiNote:a:API Note:' , ' implNote:a:Implementation Note:'
98- }
9970}
10071
10172changelog {
@@ -110,7 +81,7 @@ gradlePlugin {
11081 plugins. register(' gitversion' ) {
11182 id = ' net.minecraftforge.gitversion'
11283 implementationClass = ' net.minecraftforge.gitversion.gradle.GitVersionPlugin'
113- displayName = projectDisplayName
84+ displayName = gradleutils . displayName
11485 description = project. description
11586 tags = [' git' , ' version' ]
11687 }
@@ -122,7 +93,7 @@ publishing {
12293 gradleutils. promote(it)
12394
12495 pom { pom ->
125- name = projectDisplayName
96+ name = gradleutils . displayName
12697 description = project. description
12798
12899 gradleutils. pom. addRemoteDetails(pom)
@@ -141,6 +112,3 @@ publishing {
141112 maven gradleutils. getPublishingForgeMaven(rootProject. file(' ../repo' ))
142113 }
143114}
144-
145- idea. module { downloadSources = downloadJavadoc = true }
146- eclipse. classpath { downloadSources = downloadJavadoc = true }
0 commit comments