Skip to content

Commit

Permalink
Fixed build.gradle 😆
Browse files Browse the repository at this point in the history
  • Loading branch information
Outspending committed Dec 29, 2023
1 parent 2ceb51f commit 37f1d98
Show file tree
Hide file tree
Showing 2 changed files with 111 additions and 2 deletions.
111 changes: 111 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
plugins {
id 'io.papermc.paperweight.userdev' version '1.5.11'
id 'com.github.johnrengelman.shadow' version '8.1.1'
id 'java-library'
}

allprojects {
apply plugin: 'java'
apply plugin: 'maven-publish'
apply plugin: 'com.github.johnrengelman.shadow'

group = 'com.github.Outspending'
version = '0.0.1'

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'
}

}

subprojects {

repositories {
mavenCentral()
maven {
name = "papermc-repo"
url = "https://repo.papermc.io/repository/maven-public/"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/groups/public/"
}
}

dependencies {
compileOnly 'org.projectlombok:lombok:1.18.30'
annotationProcessor 'org.projectlombok:lombok:1.18.30'
}

}

repositories {
mavenCentral()
maven {
name = "papermc-repo"
url = "https://repo.papermc.io/repository/maven-public/"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/groups/public/"
}
}



// NMS Versions
def biomesNMSVersions = ["1.19_R2", "1.19_R3", "1.20_R1", "1.20_R2", "1.20_R3"]

dependencies {
paperweight.paperDevBundle("1.20-R0.1-SNAPSHOT")

implementation project(':NMS:Wrapper')
biomesNMSVersions.each { version ->
implementation project(":NMS:${version}")
}

compileOnly 'org.projectlombok:lombok:1.18.30'
annotationProcessor 'org.projectlombok:lombok:1.18.30'

}

publishMavenPublicationToMavenLocal {
// Throws an error if we don't explicitly say we're using the output
// of reobfJar in the final build.
dependsOn(reobfJar)
}

reobfJar {
// Make sure it's the correct name for when it's inserted into the publication
outputJar.set(buildFile)
}

wrapper {
gradleVersion = '8.1.1'
distributionType = Wrapper.DistributionType.ALL
}
2 changes: 0 additions & 2 deletions build.gradle/META-INF/MANIFEST.MF

This file was deleted.

0 comments on commit 37f1d98

Please sign in to comment.