Skip to content

Commit

Permalink
Moved publishing to allprojects instead of subprojects
Browse files Browse the repository at this point in the history
  • Loading branch information
Outspending committed Dec 29, 2023
1 parent 782450e commit a0354be
Showing 1 changed file with 22 additions and 32 deletions.
54 changes: 22 additions & 32 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,28 @@ allprojects {
sourceCompatibility = 17
targetCompatibility = 17

// The file for publication.
def publishFile = layout.buildDirectory.file("libs/${project.name}-${project.version}.jar")

// publish NMS apis
// this is required because consumers require getting the POM
// files from this project's dependencies, even if they're completely
// shaded and included in this file.
//
// not optimal because this leads to more network calls when downloading
// the api for the first time.
publishing {
publications {
create('maven', MavenPublication) {
groupId = 'com.github.Outspending'
artifactId = project.name

artifact publishFile
from components.java
}
}
}

tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
Expand All @@ -40,23 +62,6 @@ subprojects {
annotationProcessor 'org.projectlombok:lombok:1.18.30'
}

// publish NMS apis
// this is required because consumers require getting the POM
// files from this project's dependencies, even if they're completely
// shaded and included in this file.
//
// not optimal because this leads to more network calls when downloading
// the api for the first time.
publishing {
publications {
create('maven', MavenPublication) {
groupId = 'com.github.Outspending'
artifactId = project.name

from components.java
}
}
}
}

repositories {
Expand Down Expand Up @@ -89,21 +94,6 @@ dependencies {

}

// The file for publication.
def buildFile = layout.buildDirectory.file("libs/BiomesAPI-${project.version}.jar")

publishing {
publications {
create('maven', MavenPublication) {
groupId = 'com.github.Outspending'
artifactId = 'BiomesAPI'

artifact buildFile
from components.java
}
}
}

publishMavenPublicationToMavenLocal {
// Throws an error if we don't explicitly say we're using the output
// of reobfJar in the final build.
Expand Down

0 comments on commit a0354be

Please sign in to comment.