Skip to content

Commit

Permalink
Merge branch 'master' into publish-actions
Browse files Browse the repository at this point in the history
  • Loading branch information
P1otrulla authored Jul 13, 2024
2 parents c36b6a5 + fd5446e commit 9b909ae
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,27 @@ repositories {
mavenCentral()
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
}

dependencies {
compileOnly("org.spigotmc:spigot-api:1.19-R0.1-SNAPSHOT")
}

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

withSourcesJar()
withJavadocJar()
}

tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
}

publishing {
publications {
create<MavenPublication>("maven") {
from(project.components["java"])
artifactId = "craftinglib"
}
}

repositories {
mavenLocal()

maven(
name = "eternalcode",
url = "https://repo.eternalcode.pl",
Expand All @@ -46,19 +39,15 @@ publishing {
)
}
}

fun RepositoryHandler.maven(name: String, url: String, username: String, password: String) {
val isSnapshot = version.toString().endsWith("-SNAPSHOT")

this.maven {
this.name =
if (isSnapshot) "${name}Snapshots"
else "${name}Releases"

this.url =
if (isSnapshot) uri("$url/snapshots")
else uri("$url/releases")

this.credentials {
this.username = System.getenv(username)
this.password = System.getenv(password)
Expand Down

0 comments on commit 9b909ae

Please sign in to comment.