initial project files
This commit is contained in:
57
build.gradle.kts
Normal file
57
build.gradle.kts
Normal file
@@ -0,0 +1,57 @@
|
||||
import java.io.ByteArrayOutputStream
|
||||
|
||||
plugins {
|
||||
`maven-publish`
|
||||
}
|
||||
|
||||
allprojects {
|
||||
group = "net.tomatentum.cutin"
|
||||
version = "0.1.0-RC1" + (if (!project.hasProperty("release")) ("-" + getGitHash()) else "")
|
||||
description = "A lightweight Reflection abstraction specifically but not exclusively made for tueem/Marinara."
|
||||
plugins.withType<JavaPlugin> {
|
||||
tasks.withType<Jar>().configureEach {
|
||||
archiveBaseName.set("cutin-" + archiveBaseName.get())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
subprojects {
|
||||
apply(plugin = "maven-publish")
|
||||
apply(plugin = "java-library")
|
||||
|
||||
plugins.withType<MavenPublishPlugin> {
|
||||
publishing {
|
||||
publications {
|
||||
create<MavenPublication>("maven") {
|
||||
if (!project.hasProperty("release"))
|
||||
artifactId = project.getName() + "-dev"
|
||||
from(components["java"])
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
name = "Gitea"
|
||||
url = uri("https://git.tomatentum.net/api/packages/tueem/maven/")
|
||||
|
||||
credentials(HttpHeaderCredentials::class) {
|
||||
name = "Authorization"
|
||||
value = "token " + System.getenv("GITEA_TOKEN")
|
||||
}
|
||||
authentication {
|
||||
create<HttpHeaderAuthentication>("header")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun getGitHash(): String {
|
||||
val output = ByteArrayOutputStream()
|
||||
project.exec {
|
||||
commandLine("git", "rev-parse", "--short", "HEAD")
|
||||
standardOutput = output
|
||||
}
|
||||
return output.toString().trim()
|
||||
}
|
||||
Reference in New Issue
Block a user