File tree Expand file tree Collapse file tree
src/main/groovy/net/minecraftforge/gradleutils Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99import org .gradle .api .artifacts .repositories .MavenArtifactRepository ;
1010import org .gradle .api .file .Directory ;
1111import org .gradle .api .provider .Provider ;
12+ import org .gradle .api .provider .ProviderConvertible ;
1213
1314import java .io .File ;
1415
@@ -19,6 +20,9 @@ public sealed interface GradleUtilsExtension permits GradleUtilsExtensionForProj
1920 /// The name for this extension.
2021 String NAME = "gradleutils" ;
2122
23+
24+ /* MAVEN REPOSITORIES */
25+
2226 /**
2327 * A closure for the Forge maven to be passed into
2428 * {@link org.gradle.api.artifacts.dsl.RepositoryHandler#maven(Closure)}.
@@ -54,6 +58,9 @@ public sealed interface GradleUtilsExtension permits GradleUtilsExtensionForProj
5458 */
5559 Action <MavenArtifactRepository > minecraftLibsMaven = GradleUtilsExtensionInternal .minecraftLibsMaven ;
5660
61+
62+ /* PUBLISHING */
63+
5764 /// Get a configuring closure to be passed into [org.gradle.api.artifacts.dsl.RepositoryHandler#maven(Closure)] in a
5865 /// publishing block.
5966 ///
@@ -261,4 +268,15 @@ default Action<MavenArtifactRepository> getPublishingForgeMaven(Provider<?> defa
261268 /// @return The POM utilities
262269 /// @see PomUtils
263270 PomUtils getPom ();
271+
272+
273+ /* MISCELLANEOUS */
274+
275+ static <T > T unpack (Provider <T > value ) {
276+ return value .get ();
277+ }
278+
279+ static <T > T unpack (ProviderConvertible <T > value ) {
280+ return unpack (value .asProvider ());
281+ }
264282}
You can’t perform that action at this time.
0 commit comments