|
4 | 4 | */ |
5 | 5 | package net.minecraftforge.gradleutils; |
6 | 6 |
|
7 | | -import groovy.lang.Closure; |
8 | | -import org.gradle.api.Action; |
9 | | -import org.gradle.api.artifacts.repositories.MavenArtifactRepository; |
10 | | - |
11 | | -import java.io.File; |
12 | | - |
13 | 7 | /// The GradleUtils extension for [projects][org.gradle.api.Project], which include additional utilities that are only |
14 | 8 | /// available for them. |
15 | 9 | /// |
|
20 | 14 | /// - Register the `configureTeamCity` task to the project for working with TeamCity CI pipelines. |
21 | 15 | /// |
22 | 16 | /// @see GradleUtilsExtension |
23 | | -sealed public interface GradleUtilsExtensionForProject extends GradleUtilsExtension permits GradleUtilsExtensionInternal.ForProject { |
| 17 | +public sealed interface GradleUtilsExtensionForProject extends GradleUtilsExtension permits GradleUtilsExtensionInternal.ForProject { |
24 | 18 | /// Utilities for working with a [org.gradle.api.publish.maven.MavenPom] for publishing artifacts. |
25 | 19 | /// |
26 | 20 | /// @return The POM utilities |
27 | 21 | /// @see PomUtils |
28 | 22 | PomUtils getPom(); |
29 | | - |
30 | | - /// Get a configuring closure to be passed into [org.gradle.api.artifacts.dsl.RepositoryHandler#maven(Closure)] in a |
31 | | - /// publishing block. |
32 | | - /// |
33 | | - /// This closure respects the current project's version in regard to publishing to a release or snapshot |
34 | | - /// repository. |
35 | | - /// |
36 | | - /// **Important:** The following environment variables must be set for this to work: |
37 | | - /// - `MAVEN_USER`: Containing the username to use for authentication |
38 | | - /// - `MAVEN_PASSWORD`: Containing the password to use for authentication |
39 | | - /// |
40 | | - /// The following environment variables are optional: |
41 | | - /// - `MAVEN_URL_RELEASE`: Containing the URL to use for the release repository |
42 | | - /// - `MAVEN_URL_SNAPSHOT`: Containing the URL to use for the snapshot repository |
43 | | - /// |
44 | | - /// If the required environment variables are not present, the output Maven will be a local folder named `repo` on |
45 | | - /// the root of the [project directory][org.gradle.api.file.ProjectLayout#getProjectDirectory()]. |
46 | | - /// |
47 | | - /// If the `MAVEN_URL_RELEASE` variable is not set, the Forge releases repository will be used |
48 | | - /// (`https://maven.minecraftforge.net/releases`). |
49 | | - /// |
50 | | - /// @return The closure |
51 | | - default Action<MavenArtifactRepository> getPublishingForgeMaven() { |
52 | | - return getPublishingForgeMaven("https://maven.minecraftforge.net/releases"); |
53 | | - } |
54 | | - |
55 | | - /// Get a configuring closure to be passed into [org.gradle.api.artifacts.dsl.RepositoryHandler#maven(Closure)] in a |
56 | | - /// publishing block. |
57 | | - /// |
58 | | - /// This closure respects the current project's version in regard to publishing to a release or snapshot |
59 | | - /// repository. |
60 | | - /// |
61 | | - /// **Important:** The following environment variables must be set for this to work: |
62 | | - /// - `MAVEN_USER`: Containing the username to use for authentication |
63 | | - /// - `MAVEN_PASSWORD`: Containing the password to use for authentication |
64 | | - /// |
65 | | - /// The following environment variables are optional: |
66 | | - /// - `MAVEN_URL_RELEASE`: Containing the URL to use for the release repository |
67 | | - /// - `MAVEN_URL_SNAPSHOT`: Containing the URL to use for the snapshot repository |
68 | | - /// |
69 | | - /// If the required environment variables are not present, the output Maven will be a local folder named `repo` on |
70 | | - /// the root of the [project directory][org.gradle.api.file.ProjectLayout#getProjectDirectory()]. |
71 | | - /// |
72 | | - /// If the `MAVEN_URL_RELEASE` variable is not set, the passed in fallback URL will be used for the release |
73 | | - /// repository. |
74 | | - /// |
75 | | - /// @param fallbackPublishingEndpoint The fallback URL for the release repository |
76 | | - /// @return The closure |
77 | | - Action<MavenArtifactRepository> getPublishingForgeMaven(String fallbackPublishingEndpoint); |
78 | | - |
79 | | - /// Get a configuring closure to be passed into [org.gradle.api.artifacts.dsl.RepositoryHandler#maven(Closure)] in a |
80 | | - /// publishing block. |
81 | | - /// |
82 | | - /// This closure respects the current project's version in regard to publishing to a release or snapshot |
83 | | - /// repository. |
84 | | - /// |
85 | | - /// **Important:** The following environment variables must be set for this to work: |
86 | | - /// - `MAVEN_USER`: Containing the username to use for authentication |
87 | | - /// - `MAVEN_PASSWORD`: Containing the password to use for authentication |
88 | | - /// |
89 | | - /// The following environment variables are optional: |
90 | | - /// - `MAVEN_URL_RELEASE`: Containing the URL to use for the release repository |
91 | | - /// - `MAVEN_URL_SNAPSHOT`: Containing the URL to use for the snapshot repository |
92 | | - /// |
93 | | - /// If the required environment variables are not present, the output Maven will be set to the given default |
94 | | - /// folder. |
95 | | - /// |
96 | | - /// If the `MAVEN_URL_RELEASE` variable is not set, the passed in fallback URL will be used for the release |
97 | | - /// repository. |
98 | | - /// |
99 | | - /// @param fallbackPublishingEndpoint The fallback URL for the release repository |
100 | | - /// @param defaultFolder The default folder if the required maven information is not set |
101 | | - /// @return The closure |
102 | | - default Action<MavenArtifactRepository> getPublishingForgeMaven(String fallbackPublishingEndpoint, File defaultFolder) { |
103 | | - return getPublishingForgeMaven(fallbackPublishingEndpoint, defaultFolder, new File(defaultFolder.getAbsoluteFile().getParentFile(), "snapshots")); |
104 | | - } |
105 | | - |
106 | | - /// Get a configuring closure to be passed into [org.gradle.api.artifacts.dsl.RepositoryHandler#maven(Closure)] in a |
107 | | - /// publishing block. |
108 | | - /// |
109 | | - /// This closure respects the current project's version in regard to publishing to a release or snapshot |
110 | | - /// repository. |
111 | | - /// |
112 | | - /// **Important:** The following environment variables must be set for this to work: |
113 | | - /// - `MAVEN_USER`: Containing the username to use for authentication |
114 | | - /// - `MAVEN_PASSWORD`: Containing the password to use for authentication |
115 | | - /// |
116 | | - /// The following environment variables are optional: |
117 | | - /// - `MAVEN_URL_RELEASE`: Containing the URL to use for the release repository |
118 | | - /// - `MAVEN_URL_SNAPSHOT`: Containing the URL to use for the snapshot repository |
119 | | - /// |
120 | | - /// If the required environment variables are not present, the output Maven will be set to the given default |
121 | | - /// folder. |
122 | | - /// |
123 | | - /// If the `MAVEN_URL_RELEASE` variable is not set, the passed in fallback URL will be used for the release |
124 | | - /// repository. |
125 | | - /// |
126 | | - /// @param fallbackPublishingEndpoint The fallback URL for the release repository |
127 | | - /// @param defaultFolder The default folder if the required maven information is not set |
128 | | - /// @param defaultSnapshotFolder The default folder for the snapshot repository if the required maven |
129 | | - /// information is not set |
130 | | - /// @return The closure |
131 | | - Action<MavenArtifactRepository> getPublishingForgeMaven(String fallbackPublishingEndpoint, File defaultFolder, File defaultSnapshotFolder); |
132 | 23 | } |
0 commit comments