Skip to content

Commit

Permalink
Updated gradle to use version catalog
Browse files Browse the repository at this point in the history
  • Loading branch information
manami-project committed May 11, 2024
1 parent 906906a commit 4395984
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 24 deletions.
46 changes: 22 additions & 24 deletions build.gradle.kts
@@ -1,11 +1,14 @@
plugins {
kotlin("jvm") version "1.9.23"
alias(libs.plugins.kotlin.jvm)
`maven-publish`
`java-library`
jacoco
id("com.github.nbaztec.coveralls-jacoco") version "1.2.19"
alias(libs.plugins.coveralls.jacoco)
}

group = "io.github.manamiproject"
version = project.findProperty("release.version") as String? ?: ""

val projectName = "modb-anilist"
val githubUsername = "manami-project"

Expand All @@ -29,17 +32,12 @@ repositories {
}
}

group = "io.github.manamiproject"
version = project.findProperty("release.version") as String? ?: ""

dependencies {
api(kotlin("stdlib"))
api("io.github.manamiproject:modb-core:12.0.0-rc5")

implementation(platform(kotlin("bom")))
api(libs.kotlin.stdlib)
api(libs.modb.core)

testImplementation("ch.qos.logback:logback-classic:1.5.6")
testImplementation("io.github.manamiproject:modb-test:1.6.8")
testImplementation(libs.logback.classic)
testImplementation(libs.modb.test)
}

kotlin {
Expand All @@ -60,6 +58,19 @@ tasks.withType<Test> {
maxParallelForks = Runtime.getRuntime().availableProcessors()
}

tasks.jacocoTestReport {
reports {
html.required.set(false)
xml.required.set(true)
xml.outputLocation.set(file("${layout.buildDirectory}/reports/jacoco/test/jacocoFullReport.xml"))
}
dependsOn(allprojects.map { it.tasks.named<Test>("test") })
}

coverallsJacoco {
reportPath = "${layout.buildDirectory}/reports/jacoco/test/jacocoFullReport.xml"
}

val sourcesJar by tasks.registering(Jar::class) {
archiveClassifier.set("sources")
from(sourceSets.main.get().allSource)
Expand Down Expand Up @@ -114,19 +125,6 @@ publishing {
}
}

coverallsJacoco {
reportPath = "${layout.buildDirectory}/reports/jacoco/test/jacocoFullReport.xml"
}

tasks.jacocoTestReport {
reports {
html.required.set(false)
xml.required.set(true)
xml.outputLocation.set(file("${layout.buildDirectory}/reports/jacoco/test/jacocoFullReport.xml"))
}
dependsOn(allprojects.map { it.tasks.named<Test>("test") })
}

fun parameter(name: String, default: String = ""): String {
val env = System.getenv(name) ?: ""
if (env.isNotBlank()) {
Expand Down
16 changes: 16 additions & 0 deletions gradle/libs.versions.toml
@@ -0,0 +1,16 @@
[versions]
kotlin = "1.9.24"
coveralls-jacoco = "1.2.20"
logback-classic = "1.5.6"
modb-core = "12.0.1"
modb-test = "1.6.9"

[libraries]
kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" }
logback-classic = { module = "ch.qos.logback:logback-classic", version.ref = "logback-classic" }
modb-core = { module = "io.github.manamiproject:modb-core", version.ref = "modb-core" }
modb-test = { module = "io.github.manamiproject:modb-test", version.ref = "modb-test" }

[plugins]
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
coveralls-jacoco = { id = "com.github.nbaztec.coveralls-jacoco", version.ref = "coveralls-jacoco" }

0 comments on commit 4395984

Please sign in to comment.