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 e6a015b
Show file tree
Hide file tree
Showing 9 changed files with 74 additions and 29 deletions.
2 changes: 1 addition & 1 deletion application/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ dependencies {
compileOnly 'org.osgi:osgi.core'

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

testApi 'org.jetbrains.kotlin:kotlin-osgi-bundle'
testImplementation "org.assertj:assertj-core:$assertjVersion"
testImplementation libs.bundles.test
}
31 changes: 17 additions & 14 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ subprojects {
ext {
releasable = true // all corda-api jars are externally consumable
}

apply plugin: 'org.cyclonedx.bom'
cyclonedxBom {
includeConfigs = ["runtimeClasspath"]
Expand Down Expand Up @@ -153,6 +152,10 @@ subprojects {
}
}

configure(subprojects.findAll {it.name != 'corda-api'}) {
apply plugin: 'org.jetbrains.kotlin.jvm'
}

pluginManager.withPlugin('org.jetbrains.kotlin.jvm') {
apply plugin: 'io.gitlab.arturbosch.detekt'
apply plugin: 'jacoco'
Expand All @@ -162,19 +165,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 libs.mockito
// 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
1 change: 1 addition & 0 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' apply true
id 'biz.aQute.bnd.builder'
}

Expand Down
19 changes: 11 additions & 8 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")
}
}
}
}
3 changes: 1 addition & 2 deletions crypto/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ dependencies {

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.test
}

4 changes: 2 additions & 2 deletions data/avro-schema/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ 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"
Expand All @@ -29,7 +29,7 @@ dependencies {

configurations.all {
resolutionStrategy {
// CVE-2023-42503, current version of Avro uses an outdated version
// CVE-2023-42503, current version o f Avro uses an outdated version
force "org.apache.commons:commons-compress:$commonsCompressVersion"
}
}
Expand Down
39 changes: 39 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
[versions]
kotlinVersion = "1.8.21"

# Logging
slf4jVersion = "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.+"
junitVersion = "5.10.0"
mockitoVersion = "5.3.+"
mockitoKotlinVersion = "4.1.+"

[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 = { group = "org.bouncycastle", name = "bcprov-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" }
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" }
mockito-core = { group = "org.mockito", name = "mockito-core", version.ref = "mockitoVersion" }
mockito-kotlin = { group = "org.mockito.kotlin", name = "mockito-kotlin", version.ref = "mockitoKotlinVersion" }
kotlin-test = { group = "org.jetbrains.kotlin", name = "kotlin-test", version.ref = "kotlinVersion" }

[bundles]
test = ["junit", "junit-api", "junit-params", "junit-engine", "mockito-core", "mockito-kotlin", "assertj-core", "kotlin-test"]
2 changes: 1 addition & 1 deletion ledger/ledger-utxo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ dependencies {

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

testImplementation "org.assertj:assertj-core:$assertjVersion"
testImplementation libs.bundles.test
}

0 comments on commit e6a015b

Please sign in to comment.