|
8 | 8 | import org.gradle.api.Action; |
9 | 9 | import org.gradle.api.artifacts.repositories.MavenArtifactRepository; |
10 | 10 |
|
11 | | -import java.io.File; |
12 | | - |
13 | 11 | /// Contains various utilities for working with Gradle scripts. |
14 | 12 | /// |
15 | | -/// [Projects][org.gradle.api.Project] that apply GradleUtils are given [GradleUtilsExtension.ForProject]. |
16 | | -public sealed interface GradleUtilsExtension permits GradleUtilsExtensionInternal, GradleUtilsExtension.ForProject { |
| 13 | +/// [Projects][org.gradle.api.Project] that apply GradleUtils are given [GradleUtilsExtensionForProject]. |
| 14 | +public sealed interface GradleUtilsExtension permits GradleUtilsExtensionInternal, GradleUtilsExtensionForProject { |
17 | 15 | /// The name for this extension. |
18 | 16 | String NAME = "gradleutils"; |
19 | 17 |
|
@@ -51,125 +49,4 @@ public sealed interface GradleUtilsExtension permits GradleUtilsExtensionInterna |
51 | 49 | * </code></pre> |
52 | 50 | */ |
53 | 51 | Action<MavenArtifactRepository> minecraftLibsMaven = GradleUtilsExtensionInternal.minecraftLibsMaven; |
54 | | - |
55 | | - /// The GradleUtils extension for {@linkplain org.gradle.api.Project projects}, which include additional utilities |
56 | | - /// that are only available for them. |
57 | | - /// |
58 | | - /// When applied, GradleUtils will |
59 | | - /// - Create a referenceable [PomUtils] instance in [#getPom()]. |
60 | | - /// - Register the `generateActionsWorkflow` task to the project for generating a default template GitHub Actions |
61 | | - /// workflow. |
62 | | - /// - Register the `configureTeamCity` task to the project for working with TeamCity CI pipelines. |
63 | | - /// |
64 | | - /// @see GradleUtilsExtension |
65 | | - sealed interface ForProject extends GradleUtilsExtension permits GradleUtilsExtensionInternal.ForProject { |
66 | | - /// Utilities for working with a [org.gradle.api.publish.maven.MavenPom] for publishing artifacts. |
67 | | - /// |
68 | | - /// @return The POM utilities |
69 | | - /// @see PomUtils |
70 | | - PomUtils getPom(); |
71 | | - |
72 | | - /// Get a configuring closure to be passed into [org.gradle.api.artifacts.dsl.RepositoryHandler#maven(Closure)] |
73 | | - /// in a publishing block. |
74 | | - /// |
75 | | - /// This closure respects the current project's version in regard to publishing to a release or snapshot |
76 | | - /// repository. |
77 | | - /// |
78 | | - /// **Important:** The following environment variables must be set for this to work: |
79 | | - /// - `MAVEN_USER`: Containing the username to use for authentication |
80 | | - /// - `MAVEN_PASSWORD`: Containing the password to use for authentication |
81 | | - /// |
82 | | - /// The following environment variables are optional: |
83 | | - /// - `MAVEN_URL_RELEASE`: Containing the URL to use for the release repository |
84 | | - /// - `MAVEN_URL_SNAPSHOT`: Containing the URL to use for the snapshot repository |
85 | | - /// |
86 | | - /// If the required environment variables are not present, the output Maven will be a local folder named `repo` |
87 | | - /// on the root of the [project directory][org.gradle.api.file.ProjectLayout#getProjectDirectory()]. |
88 | | - /// |
89 | | - /// If the `MAVEN_URL_RELEASE` variable is not set, the Forge releases repository will be used |
90 | | - /// (`https://maven.minecraftforge.net/releases`). |
91 | | - /// |
92 | | - /// @return The closure |
93 | | - default Action<MavenArtifactRepository> getPublishingForgeMaven() { |
94 | | - return getPublishingForgeMaven("https://maven.minecraftforge.net/releases"); |
95 | | - } |
96 | | - |
97 | | - /// Get a configuring closure to be passed into [org.gradle.api.artifacts.dsl.RepositoryHandler#maven(Closure)] |
98 | | - /// in a publishing block. |
99 | | - /// |
100 | | - /// This closure respects the current project's version in regard to publishing to a release or snapshot |
101 | | - /// repository. |
102 | | - /// |
103 | | - /// **Important:** The following environment variables must be set for this to work: |
104 | | - /// - `MAVEN_USER`: Containing the username to use for authentication |
105 | | - /// - `MAVEN_PASSWORD`: Containing the password to use for authentication |
106 | | - /// |
107 | | - /// The following environment variables are optional: |
108 | | - /// - `MAVEN_URL_RELEASE`: Containing the URL to use for the release repository |
109 | | - /// - `MAVEN_URL_SNAPSHOT`: Containing the URL to use for the snapshot repository |
110 | | - /// |
111 | | - /// If the required environment variables are not present, the output Maven will be a local folder named `repo` |
112 | | - /// on the root of the [project directory][org.gradle.api.file.ProjectLayout#getProjectDirectory()]. |
113 | | - /// |
114 | | - /// If the `MAVEN_URL_RELEASE` variable is not set, the passed in fallback URL will be used for the release |
115 | | - /// repository. |
116 | | - /// |
117 | | - /// @param fallbackPublishingEndpoint The fallback URL for the release repository |
118 | | - /// @return The closure |
119 | | - Action<MavenArtifactRepository> getPublishingForgeMaven(String fallbackPublishingEndpoint); |
120 | | - |
121 | | - /// Get a configuring closure to be passed into [org.gradle.api.artifacts.dsl.RepositoryHandler#maven(Closure)] |
122 | | - /// in a publishing block. |
123 | | - /// |
124 | | - /// This closure respects the current project's version in regard to publishing to a release or snapshot |
125 | | - /// repository. |
126 | | - /// |
127 | | - /// **Important:** The following environment variables must be set for this to work: |
128 | | - /// - `MAVEN_USER`: Containing the username to use for authentication |
129 | | - /// - `MAVEN_PASSWORD`: Containing the password to use for authentication |
130 | | - /// |
131 | | - /// The following environment variables are optional: |
132 | | - /// - `MAVEN_URL_RELEASE`: Containing the URL to use for the release repository |
133 | | - /// - `MAVEN_URL_SNAPSHOT`: Containing the URL to use for the snapshot repository |
134 | | - /// |
135 | | - /// If the required environment variables are not present, the output Maven will be set to the given default |
136 | | - /// folder. |
137 | | - /// |
138 | | - /// If the `MAVEN_URL_RELEASE` variable is not set, the passed in fallback URL will be used for the release |
139 | | - /// repository. |
140 | | - /// |
141 | | - /// @param fallbackPublishingEndpoint The fallback URL for the release repository |
142 | | - /// @param defaultFolder The default folder if the required maven information is not set |
143 | | - /// @return The closure |
144 | | - default Action<MavenArtifactRepository> getPublishingForgeMaven(String fallbackPublishingEndpoint, File defaultFolder) { |
145 | | - return getPublishingForgeMaven(fallbackPublishingEndpoint, defaultFolder, new File(defaultFolder.getAbsoluteFile().getParentFile(), "snapshots")); |
146 | | - } |
147 | | - |
148 | | - /// Get a configuring closure to be passed into [org.gradle.api.artifacts.dsl.RepositoryHandler#maven(Closure)] |
149 | | - /// in a publishing block. |
150 | | - /// |
151 | | - /// This closure respects the current project's version in regard to publishing to a release or snapshot |
152 | | - /// repository. |
153 | | - /// |
154 | | - /// **Important:** The following environment variables must be set for this to work: |
155 | | - /// - `MAVEN_USER`: Containing the username to use for authentication |
156 | | - /// - `MAVEN_PASSWORD`: Containing the password to use for authentication |
157 | | - /// |
158 | | - /// The following environment variables are optional: |
159 | | - /// - `MAVEN_URL_RELEASE`: Containing the URL to use for the release repository |
160 | | - /// - `MAVEN_URL_SNAPSHOT`: Containing the URL to use for the snapshot repository |
161 | | - /// |
162 | | - /// If the required environment variables are not present, the output Maven will be set to the given default |
163 | | - /// folder. |
164 | | - /// |
165 | | - /// If the `MAVEN_URL_RELEASE` variable is not set, the passed in fallback URL will be used for the release |
166 | | - /// repository. |
167 | | - /// |
168 | | - /// @param fallbackPublishingEndpoint The fallback URL for the release repository |
169 | | - /// @param defaultFolder The default folder if the required maven information is not set |
170 | | - /// @param defaultSnapshotFolder The default folder for the snapshot repository if the required maven |
171 | | - /// information is not set |
172 | | - /// @return The closure |
173 | | - Action<MavenArtifactRepository> getPublishingForgeMaven(String fallbackPublishingEndpoint, File defaultFolder, File defaultSnapshotFolder); |
174 | | - } |
175 | 52 | } |
0 commit comments