|
10 | 10 | import org.gradle.api.file.Directory; |
11 | 11 | import org.gradle.api.provider.Provider; |
12 | 12 |
|
| 13 | +import java.io.File; |
| 14 | + |
13 | 15 | /// Contains various utilities for working with Gradle scripts. |
14 | 16 | /// |
15 | 17 | /// [Projects][org.gradle.api.Project] that apply GradleUtils are given [GradleUtilsExtensionForProject]. |
@@ -72,7 +74,7 @@ public sealed interface GradleUtilsExtension permits GradleUtilsExtensionInterna |
72 | 74 | /// |
73 | 75 | /// @return The closure |
74 | 76 | default Action<MavenArtifactRepository> getPublishingForgeMaven() { |
75 | | - return getPublishingForgeMaven("https://maven.minecraftforge.net/releases"); |
| 77 | + return getPublishingForgeMaven(Constants.FORGE_MAVEN_RELEASE); |
76 | 78 | } |
77 | 79 |
|
78 | 80 | /// Get a configuring closure to be passed into [org.gradle.api.artifacts.dsl.RepositoryHandler#maven(Closure)] in a |
@@ -117,5 +119,141 @@ default Action<MavenArtifactRepository> getPublishingForgeMaven() { |
117 | 119 | /// @param fallbackPublishingEndpoint The fallback URL for the release repository |
118 | 120 | /// @param defaultFolder The default folder if the required maven information is not set |
119 | 121 | /// @return The closure |
120 | | - Action<MavenArtifactRepository> getPublishingForgeMaven(String fallbackPublishingEndpoint, Provider<? extends Directory> defaultFolder); |
| 122 | + Action<MavenArtifactRepository> getPublishingForgeMaven(String fallbackPublishingEndpoint, Object defaultFolder); |
| 123 | + |
| 124 | + /// Get a configuring closure to be passed into [org.gradle.api.artifacts.dsl.RepositoryHandler#maven(Closure)] in a |
| 125 | + /// publishing block. |
| 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 | + /// - Please note that since Forge does not have a snapshot repository, snapshot maven publishing via GradleUtils is |
| 134 | + /// no longer supported as of 3.0.0. |
| 135 | + /// |
| 136 | + /// If the required environment variables are not present, the output Maven will be set to the given default folder. |
| 137 | + /// |
| 138 | + /// If the `MAVEN_URL_RELEASE` variable is not set, the Forge releases repository will be used |
| 139 | + /// (`https://maven.minecraftforge.net/releases`). |
| 140 | + /// |
| 141 | + /// @param defaultFolder The default folder if the required maven information is not set |
| 142 | + /// @return The closure |
| 143 | + default Action<MavenArtifactRepository> getPublishingForgeMaven(File defaultFolder) { |
| 144 | + return this.getPublishingForgeMaven(Constants.FORGE_MAVEN_RELEASE, defaultFolder); |
| 145 | + } |
| 146 | + |
| 147 | + /// Get a configuring closure to be passed into [org.gradle.api.artifacts.dsl.RepositoryHandler#maven(Closure)] in a |
| 148 | + /// publishing block. |
| 149 | + /// **Important:** The following environment variables must be set for this to work: |
| 150 | + /// - `MAVEN_USER`: Containing the username to use for authentication |
| 151 | + /// - `MAVEN_PASSWORD`: Containing the password to use for authentication |
| 152 | + /// |
| 153 | + /// The following environment variables are optional: |
| 154 | + /// - `MAVEN_URL(_RELEASE)`: Containing the URL to use for the release repository |
| 155 | + /// - Please note that since Forge does not have a snapshot repository, snapshot maven publishing via GradleUtils is |
| 156 | + /// no longer supported as of 3.0.0. |
| 157 | + /// |
| 158 | + /// If the required environment variables are not present, the output Maven will be set to the given default |
| 159 | + /// folder. |
| 160 | + /// |
| 161 | + /// If the `MAVEN_URL(_RELEASE)` variable is not set, the passed in fallback URL will be used for the release |
| 162 | + /// repository. |
| 163 | + /// |
| 164 | + /// @param fallbackPublishingEndpoint The fallback URL for the release repository |
| 165 | + /// @param defaultFolder The default folder if the required maven information is not set |
| 166 | + /// @return The closure |
| 167 | + Action<MavenArtifactRepository> getPublishingForgeMaven(String fallbackPublishingEndpoint, File defaultFolder); |
| 168 | + |
| 169 | + /// Get a configuring closure to be passed into [org.gradle.api.artifacts.dsl.RepositoryHandler#maven(Closure)] in a |
| 170 | + /// publishing block. |
| 171 | + /// |
| 172 | + /// **Important:** The following environment variables must be set for this to work: |
| 173 | + /// - `MAVEN_USER`: Containing the username to use for authentication |
| 174 | + /// - `MAVEN_PASSWORD`: Containing the password to use for authentication |
| 175 | + /// |
| 176 | + /// The following environment variables are optional: |
| 177 | + /// - `MAVEN_URL(_RELEASE)`: Containing the URL to use for the release repository |
| 178 | + /// - Please note that since Forge does not have a snapshot repository, snapshot maven publishing via GradleUtils is |
| 179 | + /// no longer supported as of 3.0.0. |
| 180 | + /// |
| 181 | + /// If the required environment variables are not present, the output Maven will be set to the given default folder. |
| 182 | + /// |
| 183 | + /// If the `MAVEN_URL_RELEASE` variable is not set, the Forge releases repository will be used |
| 184 | + /// (`https://maven.minecraftforge.net/releases`). |
| 185 | + /// |
| 186 | + /// @param defaultFolder The default folder if the required maven information is not set |
| 187 | + /// @return The closure |
| 188 | + default Action<MavenArtifactRepository> getPublishingForgeMaven(Directory defaultFolder) { |
| 189 | + return this.getPublishingForgeMaven(Constants.FORGE_MAVEN_RELEASE, defaultFolder); |
| 190 | + } |
| 191 | + |
| 192 | + /// Get a configuring closure to be passed into [org.gradle.api.artifacts.dsl.RepositoryHandler#maven(Closure)] in a |
| 193 | + /// publishing block. |
| 194 | + /// **Important:** The following environment variables must be set for this to work: |
| 195 | + /// - `MAVEN_USER`: Containing the username to use for authentication |
| 196 | + /// - `MAVEN_PASSWORD`: Containing the password to use for authentication |
| 197 | + /// |
| 198 | + /// The following environment variables are optional: |
| 199 | + /// - `MAVEN_URL(_RELEASE)`: Containing the URL to use for the release repository |
| 200 | + /// - Please note that since Forge does not have a snapshot repository, snapshot maven publishing via GradleUtils is |
| 201 | + /// no longer supported as of 3.0.0. |
| 202 | + /// |
| 203 | + /// If the required environment variables are not present, the output Maven will be set to the given default |
| 204 | + /// folder. |
| 205 | + /// |
| 206 | + /// If the `MAVEN_URL(_RELEASE)` variable is not set, the passed in fallback URL will be used for the release |
| 207 | + /// repository. |
| 208 | + /// |
| 209 | + /// @param fallbackPublishingEndpoint The fallback URL for the release repository |
| 210 | + /// @param defaultFolder The default folder if the required maven information is not set |
| 211 | + /// @return The closure |
| 212 | + Action<MavenArtifactRepository> getPublishingForgeMaven(String fallbackPublishingEndpoint, Directory defaultFolder); |
| 213 | + |
| 214 | + /// Get a configuring closure to be passed into [org.gradle.api.artifacts.dsl.RepositoryHandler#maven(Closure)] in a |
| 215 | + /// publishing block. |
| 216 | + /// |
| 217 | + /// **Important:** The following environment variables must be set for this to work: |
| 218 | + /// - `MAVEN_USER`: Containing the username to use for authentication |
| 219 | + /// - `MAVEN_PASSWORD`: Containing the password to use for authentication |
| 220 | + /// |
| 221 | + /// The following environment variables are optional: |
| 222 | + /// - `MAVEN_URL(_RELEASE)`: Containing the URL to use for the release repository |
| 223 | + /// - Please note that since Forge does not have a snapshot repository, snapshot maven publishing via GradleUtils is |
| 224 | + /// no longer supported as of 3.0.0. |
| 225 | + /// |
| 226 | + /// If the required environment variables are not present, the output Maven will be set to the given default folder. |
| 227 | + /// |
| 228 | + /// If the `MAVEN_URL_RELEASE` variable is not set, the Forge releases repository will be used |
| 229 | + /// (`https://maven.minecraftforge.net/releases`). |
| 230 | + /// |
| 231 | + /// @param defaultFolder The default folder if the required maven information is not set |
| 232 | + /// @return The closure |
| 233 | + default Action<MavenArtifactRepository> getPublishingForgeMaven(Provider<?> defaultFolder) { |
| 234 | + return this.getPublishingForgeMaven(Constants.FORGE_MAVEN_RELEASE, defaultFolder); |
| 235 | + } |
| 236 | + |
| 237 | + /// Get a configuring closure to be passed into [org.gradle.api.artifacts.dsl.RepositoryHandler#maven(Closure)] in a |
| 238 | + /// publishing block. |
| 239 | + /// **Important:** The following environment variables must be set for this to work: |
| 240 | + /// - `MAVEN_USER`: Containing the username to use for authentication |
| 241 | + /// - `MAVEN_PASSWORD`: Containing the password to use for authentication |
| 242 | + /// |
| 243 | + /// The following environment variables are optional: |
| 244 | + /// - `MAVEN_URL(_RELEASE)`: Containing the URL to use for the release repository |
| 245 | + /// - Please note that since Forge does not have a snapshot repository, snapshot maven publishing via GradleUtils is |
| 246 | + /// no longer supported as of 3.0.0. |
| 247 | + /// |
| 248 | + /// If the required environment variables are not present, the output Maven will be set to the given default |
| 249 | + /// folder. |
| 250 | + /// |
| 251 | + /// If the `MAVEN_URL(_RELEASE)` variable is not set, the passed in fallback URL will be used for the release |
| 252 | + /// repository. |
| 253 | + /// |
| 254 | + /// @param fallbackPublishingEndpoint The fallback URL for the release repository |
| 255 | + /// @param defaultFolder The default folder if the required maven information is not set |
| 256 | + /// @return The closure |
| 257 | + Action<MavenArtifactRepository> getPublishingForgeMaven(String fallbackPublishingEndpoint, Provider<?> defaultFolder); |
| 258 | + |
121 | 259 | } |
0 commit comments