Skip to content

Commit

Permalink
Merge branch 'release/os/5.2' of https://github.com/corda/corda-api i…
Browse files Browse the repository at this point in the history
…nto nandor/CORE-16870/nullable-params-queries

# Conflicts:
#	gradle.properties
  • Loading branch information
nkovacsx committed Dec 19, 2023
2 parents c883bce + dfe053d commit 0e50c09
Show file tree
Hide file tree
Showing 77 changed files with 1,319 additions and 336 deletions.
4 changes: 3 additions & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
Jenkinsfile @corda/blt
.ci/** @corda/blt

gradle/* @corda/blt
gradle/wrapper @corda/blt
*.toml @corda/corda5-team-leads

*.gradle @corda/blt
gradle.properties @corda/corda5-team-leads

Expand Down
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: "gradle"
directory: "/"
schedule:
interval: "daily"
rebase-strategy: "disabled"
2 changes: 1 addition & 1 deletion .github/workflows/check-pr-title.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ jobs:
steps:
- uses: morrisoncole/[email protected]
with:
title-regex: '^((CORDA|EG|ENT|INFRA|CORE|DOC|ES)-\d+)(.*)'
title-regex: '^((CORDA|EG|ENT|INFRA|CORE|DOC|ES|DA5)-\d+)(.*)'
on-failed-regex-comment: "PR title failed to match regex -> `%regex%`"
repo-token: "${{ secrets.GITHUB_TOKEN }}"
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"
}
72 changes: 20 additions & 52 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,22 @@ buildscript {
ext {
vcsUrl = System.getenv('GIT_URL') ?: 'https://github.com/corda/corda-api.git'
}

dependencies {
classpath "org.jetbrains.dokka:dokka-core:$dokkaVersion"
constraints {
classpath("org.jsoup:jsoup:1.15.3") {
because "required until dokka plugin updates it's internal version of jsoup, not fixed as of dokka 1.7.10"
}
}
}
}

plugins {
id 'net.corda.cordapp.cordapp-configuration'
id 'org.jetbrains.kotlin.jvm' apply false
id 'org.jetbrains.kotlin.plugin.allopen' apply false
id 'org.jetbrains.kotlin.plugin.jpa' apply false
id 'io.gitlab.arturbosch.detekt' apply false
id 'io.snyk.gradle.plugin.snykplugin'
id 'org.ajoberstar.grgit' // used for GIT interaction (e.g. extract commit hash)
alias libs.plugins.kotlin.jvm apply false
alias libs.plugins.kotlin.allopen apply false
alias libs.plugins.kotlin.jpa apply false
alias libs.plugins.detekt apply false
alias libs.plugins.snyk
alias libs.plugins.grgit // used for GIT interaction (e.g. extract commit hash)
id 'corda.root-publish'
id 'jacoco' // test coverage
id 'com.dorongold.task-tree' // utility to visualise Gradle task DAG
id 'org.jetbrains.dokka'
id 'com.github.ben-manes.versions' // discover possible dependency version upgrades
id 'org.cyclonedx.bom' apply false
alias libs.plugins.task.tree // utility to visualise Gradle task DAG
alias libs.plugins.dokka
alias libs.plugins.dependency.check.versions // discover possible dependency version upgrades
alias libs.plugins.cyclonedx.bom apply false
}

snyk {
Expand Down Expand Up @@ -61,11 +52,11 @@ def revision = {
void configureKotlinForOSGi(Configuration configuration) {
configuration.resolutionStrategy {
dependencySubstitution {
substitute module('org.jetbrains.kotlin:kotlin-stdlib-jdk8') using module("org.jetbrains.kotlin:kotlin-osgi-bundle:$kotlinVersion")
substitute module('org.jetbrains.kotlin:kotlin-stdlib-jdk7') using module("org.jetbrains.kotlin:kotlin-osgi-bundle:$kotlinVersion")
substitute module('org.jetbrains.kotlin:kotlin-stdlib-common') using module("org.jetbrains.kotlin:kotlin-osgi-bundle:$kotlinVersion")
substitute module('org.jetbrains.kotlin:kotlin-stdlib') using module("org.jetbrains.kotlin:kotlin-osgi-bundle:$kotlinVersion")
substitute module('org.jetbrains.kotlin:kotlin-reflect') using module("org.jetbrains.kotlin:kotlin-osgi-bundle:$kotlinVersion")
substitute module('org.jetbrains.kotlin:kotlin-stdlib-jdk8') using module("org.jetbrains.kotlin:kotlin-osgi-bundle:${libs.versions.kotlinVersion.get()}")
substitute module('org.jetbrains.kotlin:kotlin-stdlib-jdk7') using module("org.jetbrains.kotlin:kotlin-osgi-bundle:${libs.versions.kotlinVersion.get()}")
substitute module('org.jetbrains.kotlin:kotlin-stdlib-common') using module("org.jetbrains.kotlin:kotlin-osgi-bundle:${libs.versions.kotlinVersion.get()}")
substitute module('org.jetbrains.kotlin:kotlin-stdlib') using module("org.jetbrains.kotlin:kotlin-osgi-bundle:${libs.versions.kotlinVersion.get()}")
substitute module('org.jetbrains.kotlin:kotlin-reflect') using module("org.jetbrains.kotlin:kotlin-osgi-bundle:${libs.versions.kotlinVersion.get()}")
}
}
}
Expand Down Expand Up @@ -108,7 +99,9 @@ subprojects {
releasable = true // all corda-api jars are externally consumable
}

apply plugin: 'org.cyclonedx.bom'
// NOTE: according to this we shouldn't be using subprojects:
// https://discuss.gradle.org/t/apply-plugin-with-version-catalog/43029
apply plugin: libs.plugins.cyclonedx.bom.get().pluginId
cyclonedxBom {
includeConfigs = ["runtimeClasspath"]
skipProjects = [rootProject.name]
Expand Down Expand Up @@ -162,21 +155,7 @@ 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'

detektPlugins "io.gitlab.arturbosch.detekt:detekt-formatting:$detektPluginVersion"
detektPlugins libs.detekt.formatting
}

// Making all persistence entity open and with an empty constructor to allow Hibernate to work.
Expand Down Expand Up @@ -259,17 +238,6 @@ subprojects {
}
}

pluginManager.withPlugin('io.gitlab.arturbosch.detekt'){
dependencies {
detekt "io.gitlab.arturbosch.detekt:detekt-cli:$detektPluginVersion"
constraints {
detekt("org.yaml:snakeyaml:$snakeyamlVersion") {
because "required until detekt plugin updates it's internal version of snakeYaml, not fixed as of detekt version 1.21"
}
}
}
}

// we do this to allow for Gradle task caching. OSGI attribute Bnd-LastModified breaks gradle caching as it is a timestamp
// below block tells Gradle to ignore specifically the Bnd-LastModified attribute of the manifest when checking if
// a task is up-to-date, this has no impact on publishing or production of jar.
Expand Down Expand Up @@ -407,4 +375,4 @@ if (project.hasProperty('generateSBOM')) {
artifactoryPublish {
publications('sbom')
}
}
}
22 changes: 4 additions & 18 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ repositories {
// So we'll load it into our own object to grab what we need.
def constants = new Properties()
file("$rootDir/../gradle.properties").withInputStream { InputStream input -> constants.load(input) }
def bndVersion = constants.getProperty('bndVersion')
def bndlibVersion = constants.getProperty('bndlibVersion')
def internalPluginVersion = constants.getProperty('internalPluginVersion')
def artifactoryContextUrl = constants.getProperty('artifactoryContextUrl')

Expand Down Expand Up @@ -51,23 +49,11 @@ repositories {

dependencies {
constraints {
implementation('biz.aQute.bnd:biz.aQute.bndlib') {
version {
require bndlibVersion
}
}
implementation('biz.aQute.bnd:biz.aQute.bnd.embedded-repo') {
version {
require bndlibVersion
}
}
implementation('biz.aQute.bnd:biz.aQute.resolve') {
version {
require bndlibVersion
}
}
implementation libs.bnd.lib
implementation libs.bnd.embedded.repo
implementation libs.bnd.resolve
}
implementation "biz.aQute.bnd:biz.aQute.bnd.gradle:$bndVersion"
implementation libs.bnd.gradle

if (System.getenv('CORDA_ARTIFACTORY_USERNAME') != null || project.hasProperty('cordaArtifactoryUsername')) {
implementation "com.r3.internal.gradle.plugins:publish:$internalPluginVersion"
Expand Down
7 changes: 7 additions & 0 deletions buildSrc/settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
dependencyResolutionManagement {
versionCatalogs {
create('libs', { from(files("../gradle/libs.versions.toml")) })
}
}

rootProject.name = 'buildSrc'
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")
}
}
}
33 changes: 4 additions & 29 deletions corda-api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,41 +26,16 @@ dependencies {
api project(':membership')
api project(':serialization')

api('javax.persistence:javax.persistence-api') {
version {
require javaxPersistenceApiVersion
}
}
api('org.jetbrains.kotlin:kotlin-osgi-bundle') {
version {
require kotlinVersion
}
}
api(libs.javax.persistence.api)
api(libs.kotlin.osgi.bundle)
api('org.jetbrains:annotations') {
version {
require jetbrainsAnnotationsVersion
}
}
api('org.osgi:osgi.annotation') {
version {
require osgiAnnotationVersion
}
}
api('org.osgi:osgi.core') {
version {
require osgiVersion
}
}
api('org.osgi:org.osgi.service.component.annotations') {
version {
require osgiScrAnnotationVersion
}
}
api('org.slf4j:slf4j-api') {
api(libs.bundles.osgi)
api(libs.slf4j) {
because 'Corda 5.1 only supports SLF4J 1.x'
version {
strictly slf4jVersion
}
}
}
}
Expand Down
5 changes: 2 additions & 3 deletions cordapp-configuration/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ java {
}

dependencies {
testImplementation "org.junit.jupiter:junit-jupiter-api:$junitVersion"
testImplementation "org.junit.jupiter:junit-jupiter-params:$junitVersion"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitVersion"
testImplementation libs.bundles.test
testRuntimeOnly libs.bundles.test.runtime
}

tasks.named('jar', Jar) {
Expand Down
4 changes: 1 addition & 3 deletions cordapp-configuration/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
org.gradle.java.installations.auto-download=false
org.gradle.jvmargs=-XX:+UseG1GC -Xmx1g
org.gradle.caching=false

junitVersion=5.7.2
org.gradle.caching=false
3 changes: 3 additions & 0 deletions cordapp-configuration/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@ dependencyResolutionManagement {
repositories {
mavenCentral()
}
versionCatalogs {
create('libs', { from(files("../gradle/libs.versions.toml")) })
}
}
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
}

10 changes: 5 additions & 5 deletions data/avro-schema/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ plugins {
id 'corda-api.common-library'
id 'corda.common-publishing'
id 'corda.java-only'
id "com.github.davidmc24.gradle.plugin.avro-base"
alias libs.plugins.avro.gradle
}

dependencies {
api "org.apache.avro:avro:$avroVersion"
api libs.avro
constraints {
implementation("com.fasterxml.jackson.core:jackson-databind:$jacksonVersion") {
implementation(libs.jackson.databind) {
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
Loading

0 comments on commit 0e50c09

Please sign in to comment.