Skip to content

Commit

Permalink
Fix #61: Use version catalog to specify project and build dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
DPUkyle committed Sep 25, 2024
1 parent 5fb0590 commit 46c708d
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 23 deletions.
24 changes: 14 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import org.gosulang.gradle.build.VersionWriterTask
import java.nio.charset.StandardCharsets

plugins {
id 'com.gradle.plugin-publish' version "${gradlePublishPluginVersion}"
id 'net.researchgate.release' version "${researchgateReleaseGradlePluginVersion}"
alias(libs.plugins.plugin.publish)
alias(libs.plugins.release)
id 'groovy'
id 'java-gradle-plugin'
id 'maven-publish'
Expand Down Expand Up @@ -40,14 +40,18 @@ repositories {
}

dependencies {
testImplementation platform("org.junit:junit-bom:${junitPlatformVersion}")
testImplementation "org.junit.jupiter:junit-jupiter"
testRuntimeOnly "org.junit.vintage:junit-vintage-engine"
testImplementation "junit:junit:${junitVersion}" //TODO refactor existing unit tests and get rid of junit 4
testImplementation "org.hamcrest:hamcrest-library:${hamcrestLibraryVersion}"
testImplementation "org.spockframework:spock-core:${spockCoreVersion}"
testImplementation "org.assertj:assertj-core:${assertjCoreVersion}"
testImplementation "org.opentest4j:opentest4j:${opentest4jVersion}"
testImplementation platform(libs.junit.platform)
testImplementation libs.junit.jupiter
testRuntimeOnly libs.junit.vintageEngine
testImplementation libs.junit4
testImplementation libs.hamcrest
testImplementation(libs.spock.core) {
artifact {
type = "jar"
}
}
testImplementation libs.assertj
testImplementation libs.opentest4j
}

java {
Expand Down
14 changes: 1 addition & 13 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,5 @@ org.gradle.workers.max=1
gosuVersion=1.17.8
testedVersions=8.2,8.10.1

# Gradle plugins
gradlePublishPluginVersion=0.15.0
researchgateReleaseGradlePluginVersion=3.0.2

# For docker container
javaVersion=11

# Test implementation dependencies
assertjCoreVersion=3.24.2
hamcrestLibraryVersion=2.2
spockCoreVersion=2.3-groovy-3.0@jar
junitVersion=4.13.2
junitPlatformVersion=5.8.2
opentest4jVersion=1.3.0
javaVersion=11
13 changes: 13 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[libraries]
junit-platform = { module = "org.junit:junit-bom", version = "5.8.2" }
junit-jupiter = { module = "org.junit.jupiter:junit-jupiter" } # version inherited from junit-bom
junit-vintageEngine = { module = "org.junit.vintage:junit-vintage-engine" } # version inherited from junit-bom
junit4 = { module = "junit:junit", version = "4.13.2" }
hamcrest = { module = "org.hamcrest:hamcrest-library", version = "2.2" }
spock-core = { module = "org.spockframework:spock-core", version = "2.3-groovy-3.0" }
assertj = { module = "org.assertj:assertj-core", version = "3.24.2" }
opentest4j = { module = "org.opentest4j:opentest4j", version = "1.3.0" }

[plugins]
plugin-publish = { id = "com.gradle.plugin-publish", version = "0.15.0" }
release = { id = "net.researchgate.release", version = "3.0.2" }

0 comments on commit 46c708d

Please sign in to comment.