Skip to content

Commit

Permalink
publish implementation for easier abstraction
Browse files Browse the repository at this point in the history
  • Loading branch information
NonSwag committed Apr 6, 2024
1 parent 3bdccc2 commit af2833b
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ import net.minecrell.pluginyml.paper.PaperPluginDescription

plugins {
id("java")
id("maven-publish")
id("net.minecrell.plugin-yml.paper") version "0.6.0"
id("com.github.johnrengelman.shadow") version "8.1.1"
id("io.papermc.hangar-publish-plugin") version "0.1.2"
}

java {
withSourcesJar()
targetCompatibility = JavaVersion.VERSION_19
sourceCompatibility = JavaVersion.VERSION_19
}
Expand Down Expand Up @@ -124,4 +126,20 @@ hangarPublish { // docs - https://docs.papermc.io/misc/hangar-publishing
}
}
}
}

publishing {
publications.create<MavenPublication>("maven") {
from(components["java"])
}
repositories.maven {
val branch = if (version.toString().contains("-pre")) "snapshots" else "releases"
url = uri("https://repo.thenextlvl.net/$branch")
credentials {
if (extra.has("RELEASES_USER"))
username = extra["RELEASES_USER"].toString()
if (extra.has("RELEASES_PASSWORD"))
password = extra["RELEASES_PASSWORD"].toString()
}
}
}

0 comments on commit af2833b

Please sign in to comment.