Skip to content

Commit adae93f

Browse files
committed
Consolidate PomUtils#addRemoteDetails
Removes `#addForgeDetails`. Forge organization information is included if the URL contains "github.com/MinecraftForge/".
1 parent 8e567e9 commit adae93f

File tree

5 files changed

+11
-34
lines changed

5 files changed

+11
-34
lines changed

settings.gradle

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@ rootProject.name = 'gradleutils'
66

77
dependencyResolutionManagement {
88
repositories {
9+
//mavenLocal()
10+
mavenCentral()
911
maven { url = 'https://maven.minecraftforge.net/' }
1012
maven { url = 'https://maven.moddinglegacy.com' } // Gradle API
11-
maven { url = 'https://repo.eclipse.org/content/groups/releases/' }
12-
mavenCentral()
13-
//mavenLocal()
1413
}
1514

1615
versionCatalogs.register('libs') {

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,6 @@ sealed interface Licenses permits PomUtilsInternal.Licenses {
4646
/// {@linkplain MavenPomDeveloper#getId() ID} and {@linkplain MavenPomDeveloper#getName() name}.
4747
Map<String, Action<? super MavenPomDeveloper>> developers = PomUtilsInternal.makeDevelopers();
4848

49-
/// Adds MinecraftForge-specific details to the given POM.
50-
///
51-
/// @param pom The POM to add details to
52-
@ApiStatus.Internal
53-
static void addForgeDetails(MavenPom pom) {
54-
PomUtilsInternal.addForgeDetails(pom);
55-
}
56-
5749
/// Adds details from the project's remote URL to the given POM.
5850
///
5951
/// @param pom The POM to add details to

src/main/groovy/net/minecraftforge/gradleutils/PomUtilsImpl.groovy

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,4 @@ import javax.inject.Inject
4141
// Overridden by Git Version Plugin
4242
throw this.problems.pomUtilsGitVersionMissing()
4343
}
44-
45-
@Override
46-
void addRemoteDetails(MavenPom pom, String url) {
47-
super.addRemoteDetails(pom, url)
48-
49-
if (url.contains('github.com/MinecraftForge/')) {
50-
SharedUtil.ensureAfterEvaluate(this.project) {
51-
pom.organization { organization ->
52-
if (organization.name.orNull != Constants.FORGE_ORG_NAME)
53-
this.problems.reportPomUtilsForgeProjWithoutForgeOrg()
54-
}
55-
}
56-
}
57-
}
5844
}

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

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,6 @@ private static Action<? super MavenPomDeveloper> makeDev(String id, String name,
8686
};
8787
}
8888

89-
static void addForgeDetails(MavenPom pom) {
90-
pom.organization(organization -> {
91-
organization.getName().set(Constants.FORGE_ORG_NAME);
92-
organization.getUrl().set(Constants.FORGE_ORG_URL);
93-
});
94-
}
95-
9689
@Override
9790
@MustBeInvokedByOverriders
9891
default void addRemoteDetails(MavenPom pom, String url) {
@@ -119,6 +112,14 @@ default void addRemoteDetails(MavenPom pom, String url) {
119112
ci.getSystem().set("github");
120113
ci.getUrl().set(fullURL + "/actions");
121114
});
115+
116+
// the rest is Forge-exclusive information
117+
if (!strippedUrl.contains("github.com/MinecraftForge/")) return;
118+
119+
pom.organization(organization -> {
120+
organization.getName().set(Constants.FORGE_ORG_NAME);
121+
organization.getUrl().set(Constants.FORGE_ORG_URL);
122+
});
122123
}
123124

124125
private static String stripProtocol(String url) {

src/main/groovy/net/minecraftforge/gradleutils/package-info.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
/// [net.minecraftforge.gradleutils.PomUtils] that help eliminate duplicate code within buildscripts and allow us to
88
/// change any default values, such as Maven URLs, in case things change unexpectedly.
99
///
10-
/// If you are a non-Forge consumer, it is recommended not to use any Forge-specific APIs, including methods such as
11-
/// [net.minecraftforge.gradleutils.PomUtils#addForgeDetails(org.gradle.api.publish.maven.MavenPom)] and the
10+
/// If you are a non-Forge consumer, it is recommended not to use any Forge-specific APIs such as the
1211
/// [net.minecraftforge.gradleutils.GenerateActionsWorkflow] task.
1312
package net.minecraftforge.gradleutils;

0 commit comments

Comments
 (0)