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 10, 2024
1 parent 18c521e commit 9fe6f0b
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 27 deletions.
48 changes: 21 additions & 27 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
val junitVersion = "5.10.2"


plugins {
kotlin("jvm") version "1.9.23"
`maven-publish`
Expand All @@ -9,25 +6,22 @@ plugins {
id("com.github.nbaztec.coveralls-jacoco") version "1.2.19"
}

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

val projectName = "kommand"
val githubUsername = "manami-project"

repositories {
mavenCentral()
}

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

dependencies {
api(kotlin("stdlib"))

implementation(platform(kotlin("bom")))

testImplementation("org.junit.jupiter:junit-jupiter-engine:$junitVersion")
testImplementation("org.junit.jupiter:junit-jupiter-params:$junitVersion")
testImplementation("org.junit.platform:junit-platform-launcher:1.10.2")
testImplementation("org.assertj:assertj-core:3.25.3")
api(libs.kotlin.stdlib)
testImplementation(libs.junit.jupiter.engine)
testImplementation(libs.junit.jupiter.params)
testImplementation(libs.junit.platform.launcher)
testImplementation(libs.assertj.core)
}

kotlin {
Expand All @@ -48,6 +42,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 @@ -102,19 +109,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
17 changes: 17 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[versions]
assertj-core = "3.25.3"
junit-jupiter = "5.10.2"
platform-launcher = "1.10.2"
kotlin = "1.9.24"
coveralls-jacoco = "1.2.20"

[libraries]
assertj-core = { module = "org.assertj:assertj-core", version.ref = "assertj-core" }
junit-jupiter-engine = { module = "org.junit.jupiter:junit-jupiter-engine", version.ref = "junit-jupiter" }
junit-jupiter-params = { module = "org.junit.jupiter:junit-jupiter-params", version.ref = "junit-jupiter" }
junit-platform-launcher = { module = "org.junit.platform:junit-platform-launcher", version.ref = "platform-launcher" }
kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" }

[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 9fe6f0b

Please sign in to comment.