Use consistent project name variable

Refactor project to use a constant variable for the repository name. This ensures consistency and reduces the risk of errors when referencing the project name in multiple places. Updates were made in settings.gradle.kts, .gitea/template, and Main.kt to use the REPO_NAME variable.
This commit is contained in:
2024-12-01 11:34:00 +01:00
parent 1f6dc536fb
commit e1e6f3c9ec
3 changed files with 4 additions and 2 deletions

View File

@@ -1,2 +1,3 @@
# Repo name
settings.gradle.kts
**.kt

View File

@@ -1,4 +1,5 @@
plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.5.0"
}
rootProject.name = "{{.RepoName}}"
val REPO_NAME = "template"
rootProject.name = "${REPO_NAME}"

View File

@@ -25,7 +25,7 @@ fun main() {
Class.forName("nl.astraeus.jdbc.Driver")
Database.initialize(HikariConfig().apply {
driverClassName = "nl.astraeus.jdbc.Driver"
jdbcUrl = "jdbc:stat:webServerPort=6001:jdbc:sqlite:data/{{.RepoName}}.db"
jdbcUrl = "jdbc:stat:webServerPort=6001:jdbc:sqlite:data/${REPO_NAME}.db"
username = "sa"
password = ""
maximumPoolSize = 25