1
0
mirror of https://github.com/GeyserMC/Floodgate.git synced 2025-12-19 14:59:20 +00:00

Attempt to not publish specific modules

This commit is contained in:
Tim203
2022-03-06 12:24:54 +01:00
parent 0e1e1b823c
commit 18a3a2e41e
4 changed files with 10 additions and 11 deletions

View File

@@ -30,6 +30,9 @@ import org.gradle.api.artifacts.ProjectDependency
import org.gradle.kotlin.dsl.named
import org.gradle.kotlin.dsl.the
fun Project.isSnapshot(): Boolean =
version.toString().endsWith("-SNAPSHOT")
fun Project.fullVersion(): String {
var version = version.toString()
if (version.endsWith("-SNAPSHOT")) {

View File

@@ -32,12 +32,4 @@ java {
targetCompatibility = JavaVersion.VERSION_1_8
withSourcesJar()
}
publishing {
publications.create<MavenPublication>("mavenJava") {
groupId = project.group as String
artifactId = "floodgate-" + project.name
version = project.version as String
}
}

View File

@@ -33,7 +33,11 @@ tasks {
}
publishing {
publications.named<MavenPublication>("mavenJava") {
publications.create<MavenPublication>("mavenJava") {
groupId = project.group as String
artifactId = "floodgate-" + project.name
version = project.version as String
artifact(tasks["shadowJar"])
artifact(tasks["sourcesJar"])
}
@@ -42,7 +46,7 @@ publishing {
artifactory {
publish {
repository {
setRepoKey("maven-snapshots")
setRepoKey(if (isSnapshot()) "maven-snapshots" else "maven-releases")
setMavenCompatible(true)
}
defaults {