Set up project structure

This commit is contained in:
2024-10-17 12:53:14 +01:00
commit 7201effd29
12 changed files with 539 additions and 0 deletions

50
build.gradle.kts Normal file
View File

@@ -0,0 +1,50 @@
import java.lang.System.getenv
plugins {
`version-catalog`
`maven-publish`
}
description = "Hlæja Version Catalog"
group = "ltd.hlaeja.catalog"
catalog {
versionCatalog {
from(files("hlaeja.versions.toml"))
}
}
publishing {
repositories {
fun retrieveConfiguration(
property: String,
environment: String,
): String? = project.findProperty(property)?.toString() ?: getenv(environment)
maven {
url = uri("https://maven.pkg.github.com/swordsteel/${project.name}")
name = "GitHubPackages"
credentials {
username = retrieveConfiguration("repository.user", "REPOSITORY_USER")
password = retrieveConfiguration("repository.token", "REPOSITORY_TOKEN")
}
}
}
publications {
create<MavenPublication>(project.name) {
groupId = "$group"
artifactId = project.name
version = version
from(components["versionCatalog"])
}
}
}
tasks.register("clean") {
group = "build"
doLast {
delete("${rootDir.path}/build")
println("Default Cleaning!")
}
}