Skip to content

Commit

Permalink
POC toml file version catalogue.
Browse files Browse the repository at this point in the history
  • Loading branch information
driessamyn committed Dec 1, 2023
1 parent 3ada743 commit a365fe7
Show file tree
Hide file tree
Showing 15 changed files with 74 additions and 53 deletions.
1 change: 0 additions & 1 deletion application/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,4 @@ dependencies {
compileOnly 'org.osgi:osgi.core'

testApi 'org.jetbrains.kotlin:kotlin-osgi-bundle'
testImplementation "org.assertj:assertj-core:$assertjVersion"
}
1 change: 0 additions & 1 deletion base/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@ dependencies {
compileOnly 'org.osgi:osgi.annotation'

testApi 'org.jetbrains.kotlin:kotlin-osgi-bundle'
testImplementation "org.assertj:assertj-core:$assertjVersion"
}
26 changes: 13 additions & 13 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -162,19 +162,19 @@ subprojects {
// thinking is that for the test dependencies it's ok as it'll keep things consistent.
// we can add exclusions, or review this if necessary.
dependencies {
// Test libraries -> keep consistent across modules
testImplementation "org.jetbrains.kotlin:kotlin-test:$kotlinVersion"
testImplementation "org.mockito:mockito-core:$mockitoVersion"
testImplementation("org.mockito.kotlin:mockito-kotlin:$mockitoKotlinVersion") {
// Excluding mockito-core and adding it implicitly above. This is done to allow the use of the latest version of mockito.
exclude group: 'mockito-core'
}

testImplementation "org.junit.jupiter:junit-jupiter:$junitVersion"

// Test runtime libraries -> also keep consistent
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitVersion"
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
// // Test libraries -> keep consistent across modules
// testImplementation "org.jetbrains.kotlin:kotlin-test:$kotlinVersion"
// testImplementation "org.mockito:mockito-core:$mockitoVersion"
// testImplementation("org.mockito.kotlin:mockito-kotlin:$mockitoKotlinVersion") {
// // Excluding mockito-core and adding it implicitly above. This is done to allow the use of the latest version of mockito.
// exclude group: 'mockito-core'
// }
//
// testImplementation "org.junit.jupiter:junit-jupiter:$junitVersion"
//
// // Test runtime libraries -> also keep consistent
// testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitVersion"
// testRuntimeOnly 'org.junit.platform:junit-platform-launcher'

detektPlugins "io.gitlab.arturbosch.detekt:detekt-formatting:$detektPluginVersion"
}
Expand Down
6 changes: 3 additions & 3 deletions buildSrc/src/main/groovy/corda-api.common-library.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

plugins {
id 'java-library'
id 'org.jetbrains.kotlin.jvm'
id 'biz.aQute.bnd.builder'
}

Expand All @@ -26,9 +27,8 @@ configurations {

dependencies {
compileOnly "org.jetbrains:annotations:$jetbrainsAnnotationsVersion"
testImplementation "org.junit.jupiter:junit-jupiter:$junitVersion"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitVersion"
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
testImplementation libs.bundles.test
testRuntimeOnly libs.bundles.test.runtime
}

tasks.named('jar', Jar) {
Expand Down
17 changes: 10 additions & 7 deletions buildSrc/src/main/groovy/corda.java-only.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
plugins {
id 'org.jetbrains.kotlin.jvm'
}

tasks.named('compileKotlin') {
doFirst {
throw new InvalidUserCodeException("Module '${project.path}' should only contain Java classes")
/**
* Apply this plugin to projects that must be implemented in pure Java.
* We cannot prevent such projects from applying the Kotlin Gradle plugin,
* but we can throw an exception if they try to compile any Kotlin classes.
*/
pluginManager.withPlugin('org.jetbrains.kotlin.jvm') {
tasks.named('compileKotlin') {
doFirst {
throw new InvalidUserCodeException("Module '${project.path}' should only contain Java classes")
}
}
}
5 changes: 1 addition & 4 deletions corda-api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,8 @@ dependencies {
require osgiScrAnnotationVersion
}
}
api('org.slf4j:slf4j-api') {
api(libs.slf4j) {
because 'Corda 5.1 only supports SLF4J 1.x'
version {
strictly slf4jVersion
}
}
}
}
Expand Down
5 changes: 1 addition & 4 deletions crypto/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ dependencies {
api platform(project(':corda-api'))
api project(':base')

testImplementation "org.bouncycastle:bcprov-jdk18on:$bouncycastleVersion"
testImplementation "org.bouncycastle:bcpkix-jdk18on:$bouncycastleVersion"
testImplementation "org.assertj:assertj-core:$assertjVersion"
testImplementation "org.junit.jupiter:junit-jupiter-api:$junitVersion"
testImplementation libs.bundles.bouncycastle
}

6 changes: 3 additions & 3 deletions data/avro-schema/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ plugins {
}

dependencies {
api "org.apache.avro:avro:$avroVersion"
api libs.avro
constraints {
implementation("com.fasterxml.jackson.core:jackson-databind:$jacksonVersion") {
because "required until new version of Avro available which updates Jackson"
}

implementation("org.apache.commons:commons-compress:$commonsCompressVersion") {
implementation(libs.commons.compress) {
because "CVE-2023-42503, current version of Avro uses an outdated version"
}
}
Expand All @@ -30,7 +30,7 @@ dependencies {
configurations.all {
resolutionStrategy {
// CVE-2023-42503, current version of Avro uses an outdated version
force "org.apache.commons:commons-compress:$commonsCompressVersion"
force libs.commons.compress
}
}

Expand Down
7 changes: 0 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,8 @@ dependencyCheckVersion=0.46.+
artifactoryPluginVersion = 4.28.2
snakeyamlVersion=2.0

# Logging
slf4jVersion = 1.7.36

# Main implementation dependencies
avroGradlePluginVersion=1.3.0
avroVersion = 1.11.3
commonsCompressVersion = 1.24.0
bouncycastleVersion = 1.73
grgitPluginVersion = 5.2.0
taskTreePluginVersion = 2.1.1
Expand All @@ -52,8 +47,6 @@ jacksonVersion = 2.15.2
# Testing
assertjVersion = 3.24.+
junitVersion = 5.10.0
mockitoVersion = 5.3.+
mockitoKotlinVersion = 4.1.+

# OSGi
bndVersion = 6.4.0
Expand Down
43 changes: 43 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
[versions]
kotlinVersion = "1.8.21"

# Logging
slf4jVersion = { strictly = "1.7.36" }

# Main implementation dependencies
avroVersion = "1.11.3"
commonsCompressVersion = "1.24.0"
bouncycastleVersion = "1.73"
javaxPersistenceApiVersion = "2.2"
jacksonVersion = "2.15.2"

# Testing
assertjVersion = "3.24.0"
junitVersion = "5.10.0"
mockitoVersion = "5.3.0"
mockitoKotlinVersion = "4.1.0"

[libraries]
slf4j = { group = "org.slf4j", name = "slf4j-api", version.ref = "slf4jVersion" }
avro = { group = "org.apache.avro", name = "avro", version.ref = "avroVersion" }
commons-compress = { group = "org.apache.commons", name = "commons-compress", version.ref = "commonsCompressVersion" }
bouncycastle-prov = { group = "org.bouncycastle", name = "bcprov-jdk18on", version.ref = "bouncycastleVersion" }
bouncycastle-pkix = { group = "org.bouncycastle", name = "bcpkix-jdk18on", version.ref = "bouncycastleVersion" }
javax-persistence-api = { group = "javax.persistence", name = "javax.persistence-api", version.ref = "javaxPersistenceApiVersion" }
jackson-databind = { group = "com.fasterxml.jackson.core", name = "jackson-databind", version.ref = "jacksonVersion" }
jackson-kotlin = { group = "com.fasterxml.jackson.module", name = "jackson-module-kotlin", version.ref = "jacksonVersion" }
jackson-yaml = { group = "com.fasterxml.jackson.module", name = "jackson-dataformat-yaml", version.ref = "jacksonVersion" }
assertj-core = { group = "org.assertj", name = "assertj-core", version.ref = "assertjVersion" }
kotlin-test = { group = "org.jetbrains.kotlin", name = "kotlin-test", version.ref = "kotlinVersion" }
junit = { group = "org.junit.jupiter", name = "junit-jupiter", version.ref = "junitVersion" }
junit-api = { group = "org.junit.jupiter", name = "junit-jupiter-api", version.ref = "junitVersion" }
junit-params = { group = "org.junit.jupiter", name = "junit-jupiter-params", version.ref = "junitVersion" }
junit-engine = { group = "org.junit.jupiter", name = "junit-jupiter-engine", version.ref = "junitVersion" }
junit-platform = { group = "org.junit.platform", name = "junit-platform-launcher" }
mockito-core = { group = "org.mockito", name = "mockito-core", version.ref = "mockitoVersion" }
mockito-kotlin = { group = "org.mockito.kotlin", name = "mockito-kotlin", version.ref = "mockitoKotlinVersion" }

[bundles]
bouncycastle = ["bouncycastle-prov", "bouncycastle-pkix"]
test = ["junit", "junit-api", "junit-params", "mockito-core", "mockito-kotlin", "assertj-core", "kotlin-test"]
test-runtime = ["junit-engine", "junit-platform"]
1 change: 0 additions & 1 deletion ledger/ledger-common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,4 @@ dependencies {
api project(':application')

testImplementation project(':crypto')
testImplementation "org.assertj:assertj-core:$assertjVersion"
}
2 changes: 0 additions & 2 deletions ledger/ledger-consensual/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,4 @@ dependencies {
compileOnly 'org.osgi:osgi.annotation'

api project(':ledger:ledger-common')

testImplementation "org.assertj:assertj-core:$assertjVersion"
}
2 changes: 0 additions & 2 deletions ledger/ledger-utxo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,4 @@ dependencies {
compileOnly 'org.osgi:osgi.annotation'

api project(':ledger:ledger-common')

testImplementation "org.assertj:assertj-core:$assertjVersion"
}
3 changes: 0 additions & 3 deletions membership/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,4 @@ dependencies {
compileOnly 'org.osgi:osgi.annotation'

api project(':base')

testImplementation "org.assertj:assertj-core:$assertjVersion"
testImplementation "org.mockito:mockito-core:$mockitoVersion"
}
2 changes: 0 additions & 2 deletions serialization/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,4 @@ dependencies {

compileOnly 'org.jetbrains:annotations'
compileOnly 'org.osgi:osgi.annotation'

testImplementation "org.assertj:assertj-core:$assertjVersion"
}

0 comments on commit a365fe7

Please sign in to comment.