Skip to content

Commit

Permalink
Add the option to publish to a different LDTTeam repo, also move arou…
Browse files Browse the repository at this point in the history
…nd the modding registration.
  • Loading branch information
marchermans committed Jan 7, 2025
1 parent 1d77ad5 commit 29dd214
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,6 @@ public void apply(@NotNull Project target) {
* @param target The target project.
*/
private void configureRepositories(@NotNull Project target) {
target.getRepositories().maven(maven -> {
maven.setUrl("https://ldtteam.jfrog.io/ldtteam/modding/");
maven.setName("LDT Team Modding");
});
target.getRepositories().mavenLocal();
target.getRepositories().mavenCentral();
target.getRepositories().flatDir(dir -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,22 @@ public void pom(Action<? super POM> configure) {
}

/**
* Configures the publishing system to publish the project to the LDTTeam Maven repository.
* Configures the publishing system to publish the project to the LDTTeam Mod Maven repository.
* <p>
* Also configures the POM to publish to the LDTTeam Maven repository.
*/
public void publishToLDTTeam() {
public void publishAsLDTTeamMod() {
publishToLDTTeamMaven("mods-maven");
}

/**
* Configures the publishing system to publish the project to the LDTTeam repository.
* <p>
* Also configures the POM to publish to the LDTTeam Maven repository.
*
* @param repositoryId The Artifactory repository id to publish to.
*/
public void publishToLDTTeamMaven(final String repositoryId) {
//LDTTeam always overrides configured POM settings
pom(POM::distributeOnLDTTeamMaven);

Expand All @@ -92,7 +103,7 @@ public void publishToLDTTeam() {
if (username.isPresent() && password.isPresent()) {
publishing.repositories(mavenRepositories -> {
mavenRepositories.maven(mavenRepository -> {
mavenRepository.setUrl("https://ldtteam.jfrog.io/ldtteam/mods-maven");
mavenRepository.setUrl("https://ldtteam.jfrog.io/ldtteam/%s".formatted(repositoryId));
mavenRepository.credentials(credentials -> {
credentials.setUsername(username.get());
credentials.setPassword(password.get());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ public void apply(@NotNull Project target) {

TableauScriptingExtension.register(target, NeoGradleExtension.EXTENSION_NAME, NeoGradleExtension.class, target);

target.getRepositories().maven(maven -> {
maven.setUrl("https://ldtteam.jfrog.io/ldtteam/modding/");
maven.setName("LDT Team Modding");
});

configureLibraryConfigurations(target);
configureSourceSets(target);
configureRuns(target);
Expand Down

0 comments on commit 29dd214

Please sign in to comment.