Skip to content

Commit

Permalink
I don't know how to read build scripts sometimes.
Browse files Browse the repository at this point in the history
(cherry picked from commit aeffeb9)
  • Loading branch information
tech-6 committed Nov 27, 2024
1 parent b090a2f commit 21f2f72
Showing 1 changed file with 30 additions and 7 deletions.
37 changes: 30 additions & 7 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -78,19 +78,31 @@ allprojects {
throw IllegalStateException("Version is not set, please run 'git fetch --tags' command to fetch tags from main repository.")
}


repositories {
maven("https://mvn.littleoni.net/releases") {
maven("https://maven.reposilite.com/maven-central") {
mavenContent {
releasesOnly()
}
}
maven("https://maven.reposilite.com/releases") {
mavenContent {
releasesOnly()
}
}
maven("https://mvn.littleoni.net/snapshots") {
maven("https://maven.reposilite.com/snapshots") {
mavenContent {
snapshotsOnly()
}
}
maven("https://jitpack.io") {
mavenContent {
releasesOnly()
}
}
}


java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
Expand All @@ -103,7 +115,8 @@ allprojects {
compilerOptions {
jvmTarget = JvmTarget.JVM_11
languageVersion = KotlinVersion.KOTLIN_1_9
freeCompilerArgs = listOf("-Xjvm-default=all") // For generating default methods in interfaces
freeCompilerArgs =
listOf("-Xjvm-default=all") // For generating default methods in interfaces
}
}
}
Expand Down Expand Up @@ -132,8 +145,12 @@ subprojects {
publishing {
repositories {
maven {
name = "panda-repository"
url = uri("https://maven.reposilite.com/${if (version.toString().endsWith("-SNAPSHOT")) "snapshots" else "releases"}")
name = "LittleOniMaven"
url = uri(
"https://mvn.littleoni.net/${
if (version.toString().endsWith("-SNAPSHOT")) "snapshots" else "releases"
}"
)
credentials {
username = System.getenv("MAVEN_NAME") ?: property("mavenUser").toString()
password = System.getenv("MAVEN_TOKEN") ?: property("mavenPassword").toString()
Expand All @@ -149,9 +166,15 @@ subprojects {
pom.withXml {
val repositories = asNode().appendNode("repositories")
project.repositories.findAll(closureOf<Any> {
if (this is MavenArtifactRepository && this.url.toString().startsWith("https")) {
if (this is MavenArtifactRepository && this.url.toString()
.startsWith("https")
) {
val repository = repositories.appendNode("repository")
repository.appendNode("id", this.url.toString().replace("https://", "").replace(".", "-").replace("/", "-"))
repository.appendNode(
"id",
this.url.toString().replace("https://", "").replace(".", "-")
.replace("/", "-")
)
repository.appendNode("url", this.url.toString())
}
})
Expand Down

0 comments on commit 21f2f72

Please sign in to comment.