11plugins {
22 id ' java-library'
33 id ' idea'
4+ id ' eclipse'
45 id ' maven-publish'
56 alias libs. plugins. licenser
67 alias libs. plugins. gradleutils
8+ alias libs. plugins. gitversion
9+ alias libs. plugins. changelog
710}
811
9- final projectDisplayName = ' Download Utils'
10- final projectVendor = ' Forge Development LLC'
12+ gradleutils. displayName = ' Download Utils'
1113description = ' Utilities for simple download tasks'
1214group = ' net.minecraftforge'
1315version = gitversion. tagOffset
1416
1517println " Version: $version "
1618
17- // IDE linting + no need to say 'sourceSets.java11' every time
18- final java11 = sourceSets. create(' java11' )
19-
2019java {
21- toolchain. languageVersion = JavaLanguageVersion . of 8
20+ toolchain. languageVersion = JavaLanguageVersion . of( 8 )
2221 withSourcesJar()
23-
24- registerFeature(java11. name) {
25- usingSourceSet java11
26- capability project. group. toString(), project. name, project. version. toString()
27- disablePublication()
28- }
29- }
30-
31- configurations {
32- named(java11. implementationConfigurationName) { extendsFrom implementation }
33- named(java11. compileOnlyConfigurationName) { extendsFrom compileOnly }
3422}
3523
3624dependencies {
37- implementation project(' :log-utils' )
38-
3925 compileOnly libs. nulls
26+
27+ implementation projects. logUtils
4028}
4129
30+ final java11 = configurations. detachedConfiguration(
31+ dependencies. create(projects. downloadUtils. java11) {
32+ transitive = false
33+ }
34+ )
35+
4236tasks. named(' jar' , Jar ) {
37+ dependsOn java11. buildDependencies
38+
4339 manifest {
4440 attributes([
4541 ' Automatic-Module-Name' : ' net.minecraftforge.utils.download' ,
4642 ' Multi-Release' : ' true'
4743 ])
48- attributes([
49- ' Specification-Title' : projectDisplayName,
50- ' Specification-Vendor' : projectVendor,
51- ' Specification-Version' : gitversion. info. tag,
52- ' Implementation-Title' : projectDisplayName,
53- ' Implementation-Vendor' : projectVendor,
54- ' Implementation-Version' : project. version
55- ], ' net/minecraftforge/util/download/' )
56- }
5744
58- into(' META-INF/versions/11' ) {
59- from java11. output
45+ gradleutils. manifestDefaults(it, ' net/minecraftforge/util/download/' )
6046 }
61- }
6247
63- tasks. named(java11. compileJavaTaskName, JavaCompile ) {
64- javaCompiler = javaToolchains. compilerFor {
65- languageVersion = JavaLanguageVersion . of 11
48+ into(' META-INF/versions/11' ) {
49+ from(provider { zipTree(java11. singleFile) }) {
50+ exclude ' META-INF/**'
51+ }
6652 }
6753}
6854
69- tasks. withType(JavaCompile ). configureEach {
70- options. encoding = ' UTF-8'
71- }
72-
7355license {
7456 header = rootProject. file(' LICENSE-header.txt' )
7557 newLine = false
@@ -78,20 +60,24 @@ license {
7860
7961changelog {
8062 fromBase()
81- publishAll = false
8263}
8364
8465publishing {
66+ repositories {
67+ maven gradleutils. publishingForgeMaven
68+ }
69+
8570 publications. register(' mavenJava' , MavenPublication ). configure {
8671 from components. java
8772
88- artifactId = project. name
73+ changelog. publish(it)
74+ gradleutils. promote(it)
8975
9076 pom { pom ->
91- name = projectDisplayName
77+ name = gradleutils . displayName
9278 description = project. description
9379
94- gradleutils. pom. setGitHubDetails pom
80+ gradleutils. pom. addRemoteDetails( pom)
9581
9682 licenses {
9783 license gradleutils.pom.licenses.LGPLv2_1
@@ -103,10 +89,4 @@ publishing {
10389 }
10490 }
10591 }
106-
107- repositories {
108- maven gradleutils. publishingForgeMaven
109- }
11092}
111-
112- idea. module { downloadSources = downloadJavadoc = true }
0 commit comments