Files
cobblemon/gradle/build-logic/src/main/kotlin/cobblemon.publish-conventions.gradle.kts
T
terrainwax da5272c473 Speed up the Gradle build
- Exclude assets/data (~250MB) from sources jars
- Limit licenser to .kt/.java so it doesn't scan ~29k resource files
- Enable the Gradle daemon and build cache
- The versioning plugin runs a full JGit status (~28s on this repo) in every project replace by ou own helper that use git local or CI env variable
2026-09-24 10:04:35 +02:00

61 lines
1.7 KiB
Kotlin

import utilities.VersionType
import utilities.isSnapshot
import utilities.gitCommit
import utilities.writeVersion
plugins {
id("java")
id("java-library")
id("maven-publish")
id("dev.architectury.loom")
}
java {
withSourcesJar()
withJavadocJar()
}
publishing {
repositories {
maven("https://maven.impactdev.net/repository/development/") {
name = "ImpactDev-Public"
credentials {
username = System.getenv("COBBLEMON_MAVEN_USER")
password = System.getenv("COBBLEMON_MAVEN_PASSWORD")
}
}
maven {
val snapshot = project.isSnapshot()
val releases = uri("https://artefacts.cobblemon.com/releases")
val snapshots = uri("https://artefacts.cobblemon.com/snapshots")
url = if (snapshot) snapshots else releases
name = "Reposilite.${if (snapshot) "Snapshots" else "Releases"}"
credentials {
username = System.getenv("COBBLEMON_REPOSILITE_USERNAME")
password = System.getenv("COBBLEMON_REPOSILITE_PASSWORD")
}
}
}
publications {
create<MavenPublication>(project.name) {
artifact(tasks.remapJar)
artifact(tasks.remapSourcesJar)
@Suppress("UnstableApiUsage")
loom.disableDeprecatedPomGeneration(this)
groupId = "com.cobblemon"
artifactId = project.findProperty("maven.artifactId")?.toString() ?: project.name
version = project.writeVersion(VersionType.PUBLISHING)
pom {
properties = mapOf(
"gitCommit" to project.gitCommit()
)
}
}
}
}