Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maven publishing #3

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 53 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,60 @@
plugins {
`jar-build` // defined in buildSrc
`maven-publish`
id("com.palantir.git-version") version "0.15.0"
}

version = "mcb1.0_01"
val versionDetails: groovy.lang.Closure<com.palantir.gradle.gitversion.VersionDetails> by extra
val details = versionDetails()
val gitVersion: groovy.lang.Closure<String> by extra
val gitrev = details.commitDistance
// val side = "client"
val branch = details.branchName
version = "mc.$branch+build.$gitrev"

tasks.jar {
enabled = false
}

val clientMappingsJar = layout.buildDirectory.file("libs/ChaosMappings-$version-client.jar")
val clientMappingsArtifact = artifacts.add("archives", clientMappingsJar.get().asFile) {
type = "jar"
}
val serverMappingsJar = layout.buildDirectory.file("libs/ChaosMappings-$version-server.jar")
val serverMappingsArtifact = artifacts.add("archives", serverMappingsJar.get().asFile) {
type = "jar"
}
publishing {
repositories {
maven {
// TODO: Repo
url = uri(layout.buildDirectory.dir("repo"))
}
}
publications {
create<MavenPublication>("mavenJava") {
groupId = "org.duvetmc"
artifact(clientMappingsArtifact)
artifact(serverMappingsArtifact)
pom {
organization {
url.set("https://github.com/DuvetMC")
name.set("DuvetMC")
}
name.set("$version-mappings")
description.set("Chaotically created mappings for $version")
url.set("https://github.com/DuvetMC/ChaosMappings/tree/$version")
licenses {
license {
name.set("CC0-1.0")
url.set("https://creativecommons.org/publicdomain/zero/1.0/legalcode")
}
}
scm {
connection.set("scm:git:git+https://github.com/DuvetMC/ChaosMappings.git")
developerConnection.set("scm:git:ssh://[email protected]:DuvetMC/ChaosMappings.git")
url.set("https://github.com/DuvetMC/ChaosMappings")
}
}
}
}
}