Resolve conflicts.

This commit is contained in:
Jose Coll 2023-12-19 08:46:26 +00:00
parent 292258a985
commit c1fe0e739a
8 changed files with 129 additions and 321 deletions

View File

@ -1,58 +0,0 @@
#!groovy
/**
* Jenkins pipeline to build Corda Opensource Pull Requests with JDK11.
*/
@Library('corda-shared-build-pipeline-steps')
import static com.r3.build.BuildControl.killAllExistingBuildsForJob
killAllExistingBuildsForJob(env.JOB_NAME, env.BUILD_NUMBER.toInteger())
pipeline {
agent {
dockerfile {
label 'standard'
additionalBuildArgs '--build-arg USER="${USER}"' // DON'T change quotation - USER variable is substituted by SHELL!!!!
filename '.ci/dev/compatibility/DockerfileJDK11'
}
}
options {
timestamps()
timeout(time: 3, unit: 'HOURS')
buildDiscarder(logRotator(daysToKeepStr: '14', artifactDaysToKeepStr: '14'))
}
environment {
ARTIFACTORY_CREDENTIALS = credentials('artifactory-credentials')
BUILD_CACHE_CREDENTIALS = credentials('gradle-ent-cache-credentials')
BUILD_CACHE_PASSWORD = "${env.BUILD_CACHE_CREDENTIALS_PSW}"
BUILD_CACHE_USERNAME = "${env.BUILD_CACHE_CREDENTIALS_USR}"
CORDA_ARTIFACTORY_PASSWORD = "${env.ARTIFACTORY_CREDENTIALS_PSW}"
CORDA_ARTIFACTORY_USERNAME = "${env.ARTIFACTORY_CREDENTIALS_USR}"
CORDA_GRADLE_SCAN_KEY = credentials('gradle-build-scans-key')
CORDA_USE_CACHE = "corda-remotes"
}
stages {
stage('JDK 11 Compile') {
steps {
authenticateGradleWrapper()
sh "./gradlew --no-daemon --parallel --build-cache -Pcompilation.allWarningsAsErrors=true -Ptests.failFast=false " +
"-Ptests.ignoreFailures=true clean compileAll --stacktrace"
}
}
stage('Deploy nodes') {
steps {
sh "./gradlew --no-daemon --build-cache deployNodes"
}
}
}
post {
always {
findBuildScans()
}
cleanup {
deleteDir() /* clean up our workspace */
}
}
}

View File

@ -15,48 +15,35 @@ pipeline {
* List environment variables in alphabetical order * List environment variables in alphabetical order
*/ */
environment { environment {
SNYK_API_TOKEN = credentials('c4-os-snyk-api-token-secret')
C4_OS_SNYK_ORG_ID = credentials('c4-os-snyk-org-id')
ARTIFACTORY_CREDENTIALS = credentials('artifactory-credentials') ARTIFACTORY_CREDENTIALS = credentials('artifactory-credentials')
BUILD_CACHE_CREDENTIALS = credentials('gradle-ent-cache-credentials')
BUILD_CACHE_PASSWORD = "${env.BUILD_CACHE_CREDENTIALS_PSW}"
BUILD_CACHE_USERNAME = "${env.BUILD_CACHE_CREDENTIALS_USR}"
CORDA_ARTIFACTORY_PASSWORD = "${env.ARTIFACTORY_CREDENTIALS_PSW}" CORDA_ARTIFACTORY_PASSWORD = "${env.ARTIFACTORY_CREDENTIALS_PSW}"
CORDA_ARTIFACTORY_USERNAME = "${env.ARTIFACTORY_CREDENTIALS_USR}" CORDA_ARTIFACTORY_USERNAME = "${env.ARTIFACTORY_CREDENTIALS_USR}"
CORDA_GRADLE_SCAN_KEY = credentials('gradle-build-scans-key')
CORDA_USE_CACHE = "corda-remotes" CORDA_USE_CACHE = "corda-remotes"
C4_OS_SNYK_ORG_ID = credentials('c4-os-snyk-org-id') JAVA_HOME = "/usr/lib/jvm/java-17-amazon-corretto"
SNYK_API_TOKEN = credentials('c4-os-snyk-api-token-secret')
} }
stages { stages {
stage('Detekt check') { stage('Detekt check') {
steps { steps {
authenticateGradleWrapper() authenticateGradleWrapper()
sh "./gradlew --no-daemon --parallel --build-cache clean detekt" sh "./gradlew --no-daemon clean detekt"
} }
} }
stage('Compilation warnings check') { stage('Compilation warnings check') {
steps { steps {
sh "./gradlew --no-daemon --parallel --build-cache -Pcompilation.warningsAsErrors=true compileAll" /*
* TODO JDK17: Re-enable warnings as errors
*/
sh "./gradlew --no-daemon -Pcompilation.warningsAsErrors=false compileAll"
} }
} }
stage('Snyk Delta') { stage('Snyk Delta') {
agent { agent { label 'standard' }
docker {
image 'build-zulu-openjdk:8'
reuseNode true
registryUrl 'https://engineering-docker.software.r3.com/'
registryCredentialsId 'artifactory-credentials'
args '-v /tmp:/host_tmp'
}
}
environment {
GRADLE_USER_HOME = "/host_tmp/gradle"
}
steps { steps {
authenticateGradleWrapper()
sh 'mkdir -p ${GRADLE_USER_HOME}'
authenticateGradleWrapper() authenticateGradleWrapper()
snykDeltaScan(env.SNYK_API_TOKEN, env.C4_OS_SNYK_ORG_ID) snykDeltaScan(env.SNYK_API_TOKEN, env.C4_OS_SNYK_ORG_ID)
} }
@ -64,21 +51,19 @@ pipeline {
stage('No API change check') { stage('No API change check') {
steps { steps {
sh "./gradlew --no-daemon --parallel --build-cache generateApi" sh "./gradlew --no-daemon generateApi"
sh ".ci/check-api-changes.sh" sh ".ci/check-api-changes.sh"
} }
} }
stage('Deploy Nodes') { stage('Deploy Nodes') {
steps { steps {
sh "./gradlew --no-daemon --build-cache jar deployNodes" sh "./gradlew --no-daemon jar deployNodes"
} }
} }
} }
post { post {
always {
findBuildScans()
}
cleanup { cleanup {
deleteDir() /* clean up our workspace */ deleteDir() /* clean up our workspace */
} }

View File

@ -1,8 +1,11 @@
import com.r3.testing.DistributeTestsBy import com.r3.testing.DistributeTestsBy
import com.r3.testing.PodLogLevel import com.r3.testing.PodLogLevel
import net.corda.plugins.apiscanner.GenerateApi
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import static org.gradle.api.JavaVersion.VERSION_11 import static org.gradle.api.JavaVersion.VERSION_17
import static org.gradle.api.JavaVersion.VERSION_1_8 import static org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
import static org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_8
buildscript { buildscript {
// For sharing constants between builds // For sharing constants between builds
@ -15,26 +18,18 @@ buildscript {
ext.corda_build_edition = System.getenv("CORDA_BUILD_EDITION")?.trim() ?: "Corda Open Source" ext.corda_build_edition = System.getenv("CORDA_BUILD_EDITION")?.trim() ?: "Corda Open Source"
ext.corda_platform_version = constants.getProperty("platformVersion") ext.corda_platform_version = constants.getProperty("platformVersion")
ext.corda_shell_version = constants.getProperty("cordaShellVersion")
ext.gradle_plugins_version = constants.getProperty("gradlePluginsVersion") ext.gradle_plugins_version = constants.getProperty("gradlePluginsVersion")
// Dependency versions. Can run 'gradle dependencyUpdates' to find new versions of things. // Dependency versions. Can run 'gradle dependencyUpdates' to find new versions of things.
// //
// TODO: Sort this alphabetically. // TODO: Sort this alphabetically.
ext.kotlin_version = constants.getProperty("kotlinVersion")
ext.warnings_as_errors = project.hasProperty("compilation.warningsAsErrors") ? project.property("compilation.warningsAsErrors").toBoolean() : false ext.warnings_as_errors = project.hasProperty("compilation.warningsAsErrors") ? project.property("compilation.warningsAsErrors").toBoolean() : false
ext.quasar_group = 'co.paralleluniverse' ext.quasar_group = 'co.paralleluniverse'
// Set version of Quasar according to version of Java used: // Set version of Quasar according to version of Java used:
if (JavaVersion.current().isJava8()) {
ext.quasar_version = constants.getProperty("quasarVersion") ext.quasar_version = constants.getProperty("quasarVersion")
ext.quasar_classifier = constants.getProperty("quasarClassifier") ext.quasar_classifier = constants.getProperty("quasarClassifier")
ext.jdkClassifier = constants.getProperty("jdkClassifier")
} else {
ext.quasar_version = constants.getProperty("quasarVersion11")
ext.quasar_classifier = constants.getProperty("quasarClassifier11")
ext.jdkClassifier = constants.getProperty("jdkClassifier11")
}
ext.cordaScanApiClassifier = jdkClassifier
ext.quasar_exclusions = [ ext.quasar_exclusions = [
'co.paralleluniverse**', 'co.paralleluniverse**',
'groovy**', 'groovy**',
@ -49,7 +44,7 @@ buildscript {
'org.junit**', 'org.junit**',
'org.slf4j**', 'org.slf4j**',
'worker.org.gradle.**', 'worker.org.gradle.**',
'com.nhaarman.mockito_kotlin**', 'org.mockito.kotlin**',
'org.assertj**', 'org.assertj**',
'org.hamcrest**', 'org.hamcrest**',
'org.mockito**', 'org.mockito**',
@ -116,7 +111,6 @@ buildscript {
ext.class_graph_version = constants.getProperty('classgraphVersion') ext.class_graph_version = constants.getProperty('classgraphVersion')
ext.jcabi_manifests_version = constants.getProperty("jcabiManifestsVersion") ext.jcabi_manifests_version = constants.getProperty("jcabiManifestsVersion")
ext.picocli_version = constants.getProperty("picocliVersion") ext.picocli_version = constants.getProperty("picocliVersion")
ext.commons_lang_version = constants.getProperty("commonsLangVersion")
ext.commons_io_version = constants.getProperty("commonsIoVersion") ext.commons_io_version = constants.getProperty("commonsIoVersion")
ext.controlsfx_version = constants.getProperty("controlsfxVersion") ext.controlsfx_version = constants.getProperty("controlsfxVersion")
ext.detekt_version = constants.getProperty('detektVersion') ext.detekt_version = constants.getProperty('detektVersion')
@ -124,20 +118,27 @@ buildscript {
ext.commons_configuration2_version = constants.getProperty("commonsConfiguration2Version") ext.commons_configuration2_version = constants.getProperty("commonsConfiguration2Version")
ext.commons_text_version = constants.getProperty("commonsTextVersion") ext.commons_text_version = constants.getProperty("commonsTextVersion")
ext.snake_yaml_version = constants.getProperty("snakeYamlVersion") ext.snake_yaml_version = constants.getProperty("snakeYamlVersion")
ext.javaassist_version = constants.getProperty("javaassistVersion")
if (JavaVersion.current().isJava8()) {
ext.fontawesomefx_commons_version = constants.getProperty("fontawesomefxCommonsJava8Version")
ext.fontawesomefx_fontawesome_version = constants.getProperty("fontawesomefxFontawesomeJava8Version")
} else {
ext.fontawesomefx_commons_version = constants.getProperty("fontawesomefxCommonsVersion") ext.fontawesomefx_commons_version = constants.getProperty("fontawesomefxCommonsVersion")
ext.fontawesomefx_fontawesome_version = constants.getProperty("fontawesomefxFontawesomeVersion") ext.fontawesomefx_fontawesome_version = constants.getProperty("fontawesomefxFontawesomeVersion")
} ext.javaassist_version = constants.getProperty("javaassistVersion")
ext.test_add_opens = [
'--add-opens', 'java.base/java.time=ALL-UNNAMED',
'--add-opens', 'java.base/java.io=ALL-UNNAMED',
'--add-opens', 'java.base/java.util=ALL-UNNAMED',
'--add-opens', 'java.base/java.net=ALL-UNNAMED',
'--add-opens', 'java.base/java.nio=ALL-UNNAMED',
'--add-opens', 'java.base/java.lang.invoke=ALL-UNNAMED',
'--add-opens', 'java.base/java.security.cert=ALL-UNNAMED',
'--add-opens', 'java.base/java.security=ALL-UNNAMED',
'--add-opens', 'java.base/javax.net.ssl=ALL-UNNAMED',
'--add-opens', 'java.base/java.lang=ALL-UNNAMED',
'--add-opens', 'java.base/java.util.concurrent=ALL-UNNAMED',
'--add-opens', 'java.sql/java.sql=ALL-UNNAMED'
]
ext.test_add_exports = [
'--add-exports', 'java.base/sun.nio.ch=ALL-UNNAMED'
]
// Update 121 is required for ObjectInputFilter.
// Updates [131, 161] also have zip compression bugs on MacOS (High Sierra).
// when the java version in NodeStartup.hasMinimumJavaVersion() changes, so must this check
ext.java8_minUpdateVersion = constants.getProperty('java8MinUpdateVersion')
ext.corda_revision = { ext.corda_revision = {
try { try {
"git rev-parse HEAD".execute().text.trim() "git rev-parse HEAD".execute().text.trim()
@ -171,6 +172,7 @@ buildscript {
content { content {
includeGroupByRegex 'net\\.corda(\\..*)?' includeGroupByRegex 'net\\.corda(\\..*)?'
includeGroupByRegex 'com\\.r3(\\..*)?' includeGroupByRegex 'com\\.r3(\\..*)?'
includeGroup 'co.paralleluniverse'
} }
} }
maven { maven {
@ -180,34 +182,27 @@ buildscript {
includeGroupByRegex 'com\\.r3(\\..*)?' includeGroupByRegex 'com\\.r3(\\..*)?'
} }
} }
gradlePluginPortal()
mavenCentral() mavenCentral()
jcenter() jcenter()
} }
} }
dependencies { dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-allopen:$kotlin_version"
classpath "net.corda.plugins:publish-utils:$gradle_plugins_version"
classpath "net.corda.plugins:quasar-utils:$gradle_plugins_version" classpath "net.corda.plugins:quasar-utils:$gradle_plugins_version"
classpath "net.corda.plugins:cordformation:$gradle_plugins_version" classpath "net.corda.plugins:cordformation:$gradle_plugins_version"
classpath "net.corda.plugins:cordapp:$gradle_plugins_version" classpath "net.corda.plugins:cordapp:$gradle_plugins_version"
classpath "net.corda.plugins:api-scanner:$gradle_plugins_version" classpath "net.corda.plugins:api-scanner:$gradle_plugins_version"
classpath "net.corda.plugins:jar-filter:$gradle_plugins_version" classpath "net.corda.plugins:jar-filter:$gradle_plugins_version"
classpath "net.sf.proguard:proguard-gradle:$proguard_version" classpath "com.guardsquare:proguard-gradle:$proguard_version"
classpath 'com.github.ben-manes:gradle-versions-plugin:0.15.0' classpath 'com.github.ben-manes:gradle-versions-plugin:0.15.0'
classpath "org.jetbrains.kotlin:kotlin-noarg:$kotlin_version" classpath "org.jetbrains.dokka:dokka-base:$dokka_version"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:${dokka_version}"
classpath "net.i2p.crypto:eddsa:$eddsa_version" // Needed for ServiceIdentityGenerator in the build environment. classpath "net.i2p.crypto:eddsa:$eddsa_version" // Needed for ServiceIdentityGenerator in the build environment.
classpath "org.owasp:dependency-check-gradle:${dependency_checker_version}" classpath "org.owasp:dependency-check-gradle:$dependency_checker_version"
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:$artifactory_plugin_version" classpath "org.jfrog.buildinfo:build-info-extractor-gradle:$artifactory_plugin_version"
// Capsule gradle plugin forked and maintained locally to support Gradle 5.x // Capsule gradle plugin forked and maintained locally to support Gradle 5.x
// See https://github.com/corda/gradle-capsule-plugin // See https://github.com/corda/gradle-capsule-plugin
classpath "us.kirchmeier:gradle-capsule-plugin:1.0.4_r3" classpath "us.kirchmeier:gradle-capsule-plugin:1.0.5_r3"
classpath group: "com.r3.testing", name: "gradle-distributed-testing-plugin", version: '1.3.0' classpath group: "com.r3.testing", name: "gradle-distributed-testing-plugin", version: '1.3.0'
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.8" classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.8"
classpath "com.gradle:gradle-enterprise-gradle-plugin:$gradleEnterprisePlugin"
classpath "com.gradle:common-custom-user-data-gradle-plugin:$customUserDataGradlePlugin"
} }
configurations.classpath { configurations.classpath {
@ -217,32 +212,18 @@ buildscript {
} }
plugins { plugins {
// Add the shadow plugin to the plugins classpath for the entire project. id 'org.jetbrains.kotlin.jvm' apply false
id 'com.github.johnrengelman.shadow' version '2.0.4' apply false id 'org.jetbrains.kotlin.plugin.allopen' apply false
id 'org.jetbrains.kotlin.plugin.jpa' apply false
id 'com.github.johnrengelman.shadow' version '7.1.2' apply false
id "org.ajoberstar.grgit" version "4.0.0" id "org.ajoberstar.grgit" version "4.0.0"
id 'corda.root-publish'
id "org.jetbrains.dokka" version "1.8.20"
} }
apply plugin: 'project-report' apply plugin: 'project-report'
apply plugin: 'com.github.ben-manes.versions' apply plugin: 'com.github.ben-manes.versions'
apply plugin: 'net.corda.plugins.publish-utils'
apply plugin: 'com.jfrog.artifactory'
apply plugin: 'com.r3.testing.distributed-testing' apply plugin: 'com.r3.testing.distributed-testing'
apply plugin: "com.gradle.build-scan"
apply plugin: "com.gradle.common-custom-user-data-gradle-plugin"
buildScan {
server = gradleEnterpriseUrl
allowUntrustedServer = false
def apiKey = project.findProperty('CORDA_GRADLE_SCAN_KEY') ?: System.getenv('CORDA_GRADLE_SCAN_KEY')
if (apiKey?.trim()) {
publishAlways()
capture {
taskInputFiles = true
}
uploadInBackground = false
accessKey = apiKey
}
}
// If the command line project option -PversionFromGit is added to the gradle invocation, we'll resolve // If the command line project option -PversionFromGit is added to the gradle invocation, we'll resolve
// the latest git commit hash and timestamp and create a version postfix from that // the latest git commit hash and timestamp and create a version postfix from that
@ -257,26 +238,17 @@ if (ext.versionSuffix != ""){
ext.corda_release_version = "${ext.baseVersion}".toString() ext.corda_release_version = "${ext.baseVersion}".toString()
} }
// We need the following three lines even though they're inside an allprojects {} block below because otherwise logger.lifecycle("JDK: {}", System.getProperty("java.home"))
// IntelliJ gets confused when importing the project and ends up erasing and recreating the .idea directory, along
// with the run configurations. It also doesn't realise that the project is a Java 8 project and misconfigures
// the resulting import. This fixes it.
apply plugin: 'java'
logger.lifecycle("Java version: {}", JavaVersion.current())
sourceCompatibility = VERSION_1_8
targetCompatibility = JavaVersion.current().isJava8() ? VERSION_1_8 : VERSION_11
logger.lifecycle("Java source compatibility: {}", sourceCompatibility)
logger.lifecycle("Java target compatibility: {}", targetCompatibility)
logger.lifecycle("Quasar version: {}", quasar_version) logger.lifecycle("Quasar version: {}", quasar_version)
logger.lifecycle("Quasar classifier: {}", quasar_classifier.toString()) logger.lifecycle("Quasar classifier: {}", quasar_classifier.toString())
logger.lifecycle("Building Corda version: {}", corda_release_version) logger.lifecycle("Building Corda version: {}", corda_release_version)
logger.lifecycle("User home: {}", System.getProperty('user.home'))
allprojects { allprojects {
apply plugin: 'kotlin' apply plugin: 'org.jetbrains.kotlin.jvm'
apply plugin: 'kotlin-allopen'
apply plugin: 'jacoco' apply plugin: 'jacoco'
apply plugin: 'org.owasp.dependencycheck' apply plugin: 'org.owasp.dependencycheck'
apply plugin: 'kotlin-allopen'
apply plugin: 'org.sonarqube' apply plugin: 'org.sonarqube'
allOpen { allOpen {
@ -287,19 +259,6 @@ allprojects {
) )
} }
// we do this to allow for Gradle task caching.
// below block tells Gradle to ignore specifically the dymaically generated files in the manifest when checking if a file is up to date
// this has no impact on publishing or production of jar, This only reates to Grades mechamish for verifying the Cache key
normalization {
runtimeClasspath {
ignore("**/*.EC") //signing related
ignore("**/*.SF") //signing related
ignore("**/*.MF")
ignore("**/*.kotlin_module")
ignore("**/Cordapp-Dependencies")
}
}
dependencyCheck { dependencyCheck {
suppressionFile = '.ci/dependency-checker/suppressedLibraries.xml' suppressionFile = '.ci/dependency-checker/suppressedLibraries.xml'
cveValidForHours = 1 cveValidForHours = 1
@ -314,12 +273,23 @@ allprojects {
nugetconfEnabled = false nugetconfEnabled = false
} }
} }
sourceCompatibility = VERSION_1_8
targetCompatibility = JavaVersion.current().isJava8() ? VERSION_1_8 : VERSION_11 sourceCompatibility = VERSION_17
targetCompatibility = VERSION_17
jacoco { jacoco {
// JDK11 official support (https://github.com/jacoco/jacoco/releases/tag/v0.8.3) // JDK11 official support (https://github.com/jacoco/jacoco/releases/tag/v0.8.3)
toolVersion = "0.8.3" toolVersion = "0.8.7"
}
test {
jvmArgs test_add_opens
jvmArgs test_add_exports
}
java {
withSourcesJar()
withJavadocJar()
} }
tasks.withType(JavaCompile).configureEach { tasks.withType(JavaCompile).configureEach {
@ -334,13 +304,13 @@ allprojects {
options.encoding = 'UTF-8' options.encoding = 'UTF-8'
} }
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach { tasks.withType(KotlinCompile).configureEach {
kotlinOptions { compilerOptions {
languageVersion = "1.2" languageVersion = KOTLIN_1_8
apiVersion = "1.2" apiVersion = KOTLIN_1_8
jvmTarget = VERSION_1_8 jvmTarget = JVM_17
javaParameters = true // Useful for reflection. javaParameters = true // Useful for reflection.
freeCompilerArgs = ['-Xjvm-default=compatibility'] freeCompilerArgs = ['-Xjvm-default=all-compatibility']
allWarningsAsErrors = warnings_as_errors allWarningsAsErrors = warnings_as_errors
} }
} }
@ -378,7 +348,7 @@ allprojects {
// Required to use Gradle build cache (until Gradle 5.0 is released with default value of "append" set to false) // Required to use Gradle build cache (until Gradle 5.0 is released with default value of "append" set to false)
// See https://github.com/gradle/gradle/issues/5269 and https://github.com/gradle/gradle/pull/6419 // See https://github.com/gradle/gradle/issues/5269 and https://github.com/gradle/gradle/pull/6419
extensions.configure(TypeOf.typeOf(JacocoTaskExtension)) { ex -> extensions.configure(TypeOf.typeOf(JacocoTaskExtension)) { ex ->
ex.append = false // ex.append = false
} }
maxParallelForks = (System.env.CORDA_TESTING_FORKS == null) ? 1 : "$System.env.CORDA_TESTING_FORKS".toInteger() maxParallelForks = (System.env.CORDA_TESTING_FORKS == null) ? 1 : "$System.env.CORDA_TESTING_FORKS".toInteger()
@ -392,13 +362,6 @@ allprojects {
} }
} }
if (jdkClassifier) {
jar {
// JDK11 built and published artifacts to include classifier
archiveClassifier = jdkClassifier
}
}
group 'net.corda' group 'net.corda'
version "$corda_release_version" version "$corda_release_version"
@ -437,6 +400,16 @@ allprojects {
includeGroup 'com.github.bft-smart' includeGroup 'com.github.bft-smart'
includeGroup 'com.github.detro' includeGroup 'com.github.detro'
} }
metadataSources {
mavenPom()
artifact()
}
}
maven {
url "${publicArtifactURL}/corda-dependencies-dev"
content {
includeGroup 'co.paralleluniverse'
}
} }
maven { maven {
url "${publicArtifactURL}/corda-dev" url "${publicArtifactURL}/corda-dev"
@ -467,8 +440,6 @@ allprojects {
all { all {
resolutionStrategy { resolutionStrategy {
// Force dependencies to use the same version of Kotlin as Corda. // Force dependencies to use the same version of Kotlin as Corda.
force "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
force "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
force "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" force "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
// Force dependencies to use the same version of Guava as Corda. // Force dependencies to use the same version of Guava as Corda.
@ -525,8 +496,6 @@ allprojects {
cfg.resolutionStrategy { cfg.resolutionStrategy {
dependencySubstitution { dependencySubstitution {
// Force dependencies to use the same version of Kotlin as Corda. // Force dependencies to use the same version of Kotlin as Corda.
substitute module('org.jetbrains.kotlin:kotlin-stdlib-jdk8') with module("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version")
substitute module('org.jetbrains.kotlin:kotlin-stdlib-jdk7') with module("org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version")
substitute module('org.jetbrains.kotlin:kotlin-stdlib-common') with module("org.jetbrains.kotlin:kotlin-stdlib-common:$kotlin_version") substitute module('org.jetbrains.kotlin:kotlin-stdlib-common') with module("org.jetbrains.kotlin:kotlin-stdlib-common:$kotlin_version")
substitute module('org.jetbrains.kotlin:kotlin-stdlib') with module("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version") substitute module('org.jetbrains.kotlin:kotlin-stdlib') with module("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version")
substitute module('org.jetbrains.kotlin:kotlin-reflect') with module("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version") substitute module('org.jetbrains.kotlin:kotlin-reflect') with module("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version")
@ -550,37 +519,29 @@ sonarqube {
} }
} }
// Check that we are running on a Java 8 JDK. The source/targetCompatibility values above aren't sufficient to
// guarantee this because those are properties checked by the Java plugin, but we're using Kotlin.
//
// We recommend a specific minor version (unfortunately, not checkable directly) because JavaFX adds APIs in
// minor releases, so we can't work with just any Java 8, it has to be a recent one.
if (!JavaVersion.current().java8Compatible)
throw new GradleException("Corda requires Java 8, please upgrade to at least 1.8.0_$java8_minUpdateVersion")
configurations { configurations {
detekt detekt
} }
// Required for building out the fat JAR. // Required for building out the fat JAR.
dependencies { dependencies {
compile project(':node') implementation project(':node')
compile "com.google.guava:guava:$guava_version" implementation "com.google.guava:guava:$guava_version"
// Set to corda compile to ensure it exists now deploy nodes no longer relies on build // Set to corda implementation to ensure it exists now deploy nodes no longer relies on build
compile project(path: ":node:capsule", configuration: 'runtimeArtifacts') implementation project(path: ":node:capsule", configuration: 'runtimeArtifacts')
compile project(path: ":testing:testserver:testcapsule:", configuration: 'runtimeArtifacts') implementation project(path: ":testing:testserver:testcapsule:", configuration: 'runtimeArtifacts')
// For the buildCordappDependenciesJar task // For the buildCordappDependenciesJar task
runtime project(':client:jfx') runtimeOnly project(':client:jfx')
runtime project(':client:mock') runtimeOnly project(':client:mock')
runtime project(':client:rpc') runtimeOnly project(':client:rpc')
runtime project(':core') runtimeOnly project(':core')
runtime project(':confidential-identities') runtimeOnly project(':confidential-identities')
runtime project(':finance:workflows') runtimeOnly project(':finance:workflows')
runtime project(':finance:contracts') runtimeOnly project(':finance:contracts')
runtime project(':testing:testserver') runtimeOnly project(':testing:testserver')
testCompile project(':test-utils') testImplementation project(':test-utils')
detekt 'io.gitlab.arturbosch.detekt:detekt-cli:1.0.1' detekt 'io.gitlab.arturbosch.detekt:detekt-cli:1.0.1'
} }
@ -589,12 +550,12 @@ jar {
enabled = false enabled = false
} }
task jacocoRootReport(type: org.gradle.testing.jacoco.tasks.JacocoReport) { tasks.register('jacocoRootReport', JacocoReport) {
dependsOn = subprojects.test dependsOn = subprojects.test
additionalSourceDirs = files(subprojects.sourceSets.main.allSource.srcDirs) // additionalSourceDirs = files(subprojects.sourceSets.main.allSource.srcDirs)
sourceDirectories = files(subprojects.sourceSets.main.allSource.srcDirs) // sourceDirectories = files(subprojects.sourceSets.main.allSource.srcDirs)
classDirectories = files(subprojects.sourceSets.main.output) // classDirectories = files(subprojects.sourceSets.main.output)
executionData = files(subprojects.jacocoTestReport.executionData) // executionData = files(subprojects.jacocoTestReport.executionData)
reports { reports {
html.enabled = true html.enabled = true
xml.enabled = true xml.enabled = true
@ -618,13 +579,13 @@ tasks.register('detekt', JavaExec) {
def plugins = detektPluginsJar.outputs.files.singleFile def plugins = detektPluginsJar.outputs.files.singleFile
def params = ['-i', input, '-c', config, '-b', baseline, '--plugins', plugins] def params = ['-i', input, '-c', config, '-b', baseline, '--plugins', plugins]
inputs.files(detektPluginsJar, config, baseline) inputs.files(detektPluginsJar, config, baseline)
main = "io.gitlab.arturbosch.detekt.cli.Main" mainClass = "io.gitlab.arturbosch.detekt.cli.Main"
classpath = configurations.detekt classpath = configurations.detekt
args(params) args(params)
} }
tasks.register('detektBaseline', JavaExec) { tasks.register('detektBaseline', JavaExec) {
main = "io.gitlab.arturbosch.detekt.cli.Main" mainClass = "io.gitlab.arturbosch.detekt.cli.Main"
classpath = configurations.detekt classpath = configurations.detekt
def input = "$projectDir" def input = "$projectDir"
def config = "$projectDir/detekt-config.yml, $projectDir/detekt-baseline-config.yml" def config = "$projectDir/detekt-config.yml, $projectDir/detekt-baseline-config.yml"
@ -637,100 +598,25 @@ tasks.withType(Test).configureEach {
reports.html.destination = file("${reporting.baseDir}/${name}") reports.html.destination = file("${reporting.baseDir}/${name}")
} }
task testReport(type: TestReport) { tasks.register('testReport', TestReport) {
destinationDir = file("$buildDir/reports/allTests") destinationDir = file("$buildDir/reports/allTests")
// Include the results from the `test` task in all subprojects // Include the results from the `test` task in all subprojects
reportOn subprojects*.test reportOn subprojects*.test
} }
bintrayConfig {
user = System.getenv('CORDA_BINTRAY_USER')
key = System.getenv('CORDA_BINTRAY_KEY')
repo = 'corda'
org = 'r3'
licenses = ['Apache-2.0']
vcsUrl = 'https://github.com/corda/corda'
projectUrl = 'https://github.com/corda/corda'
gpgSign = true
gpgPassphrase = System.getenv('CORDA_BINTRAY_GPG_PASSPHRASE')
publications = [
'corda-opentelemetry',
'corda-opentelemetry-driver',
'corda-jfx',
'corda-mock',
'corda-rpc',
'corda-core',
'corda',
'corda-finance-workflows',
'corda-finance-contracts',
'corda-node',
'corda-node-api',
'corda-test-common',
'corda-core-test-utils',
'corda-test-utils',
'corda-test-db',
'corda-jackson',
'corda-testserver-impl',
'corda-testserver',
'corda-node-driver',
'corda-confidential-identities',
'corda-shell',
'corda-tools-shell-cli',
'corda-serialization',
'corda-tools-blob-inspector',
'corda-tools-explorer',
'corda-tools-network-bootstrapper',
'corda-tools-cliutils',
'corda-common-configuration-parsing',
'corda-common-validation',
'corda-common-logging',
'corda-tools-network-builder',
'corda-tools-checkpoint-agent'
]
license {
name = 'Apache-2.0'
url = 'https://www.apache.org/licenses/LICENSE-2.0'
distribution = 'repo'
}
developer {
id = 'R3'
name = 'R3'
email = 'dev@corda.net'
}
}
// Build a ZIP of all JARs required to compile the Cordapp template
// Note: corda.jar is used at runtime so no runtime ZIP is necessary. // Note: corda.jar is used at runtime so no runtime ZIP is necessary.
// Resulting ZIP can be found in "build/distributions" // Resulting ZIP can be found in "build/distributions"
task buildCordappDependenciesZip(type: Zip) { tasks.register('buildCordappDependenciesZip', Zip) {
baseName 'corda-deps' baseName 'corda-deps'
from configurations.runtime from configurations.runtimeOnly
from configurations.compile from configurations.implementation
from configurations.testCompile from configurations.testImplementation
from buildscript.configurations.classpath from buildscript.configurations.classpath
from 'node/capsule/NOTICE' // CDDL notice from 'node/capsule/NOTICE' // CDDL notice
duplicatesStrategy = DuplicatesStrategy.EXCLUDE duplicatesStrategy = DuplicatesStrategy.EXCLUDE
} }
artifactory { tasks.register('generateApi', GenerateApi) {
publish {
contextUrl = artifactory_contextUrl
repository {
repoKey = 'corda-dev'
username = System.getenv('CORDA_ARTIFACTORY_USERNAME')
password = System.getenv('CORDA_ARTIFACTORY_PASSWORD')
}
defaults {
// Root project applies the plugin (for this block) but does not need to be published
if (project != rootProject) {
publications(project.extensions.publish.name())
}
}
}
}
tasks.register('generateApi', net.corda.plugins.apiscanner.GenerateApi) {
baseName = "api-corda" baseName = "api-corda"
} }

View File

@ -1,11 +1,11 @@
FROM azul/zulu-openjdk:8u392 FROM azul/zulu-openjdk:17.0.8.1
## Remove Azul Zulu repo, as it is gone by now ## Remove Azul Zulu repo, as it is gone by now
RUN rm -rf /etc/apt/sources.list.d/zulu.list RUN rm -rf /etc/apt/sources.list.d/zulu.list
## Add packages, clean cache, create dirs, create corda user and change ownership ## Add packages, clean cache, create dirs, create corda user and change ownership
RUN apt-get update && \ RUN apt-get update && \
apt-mark hold zulu8-jdk && \ apt-mark hold zulu17-jdk && \
apt-get -y upgrade && \ apt-get -y upgrade && \
apt-get -y install bash curl unzip && \ apt-get -y install bash curl unzip && \
rm -rf /var/lib/apt/lists/* && \ rm -rf /var/lib/apt/lists/* && \
@ -33,7 +33,7 @@ ENV CORDAPPS_FOLDER="/opt/corda/cordapps" \
MY_RPC_PORT=10201 \ MY_RPC_PORT=10201 \
MY_RPC_ADMIN_PORT=10202 \ MY_RPC_ADMIN_PORT=10202 \
PATH=$PATH:/opt/corda/bin \ PATH=$PATH:/opt/corda/bin \
JVM_ARGS="-XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap " \ JVM_ARGS="-XX:+UnlockExperimentalVMOptions " \
CORDA_ARGS="" CORDA_ARGS=""
##CORDAPPS FOLDER ##CORDAPPS FOLDER

View File

@ -1,8 +1,8 @@
FROM azul/zulu-openjdk:8u392 FROM azul/zulu-openjdk:17.0.8.1
## Add packages, clean cache, create dirs, create corda user and change ownership ## Add packages, clean cache, create dirs, create corda user and change ownership
RUN apt-get update && \ RUN apt-get update && \
apt-mark hold zulu8-jdk && \ apt-mark hold zulu17-jdk && \
apt-get -y upgrade && \ apt-get -y upgrade && \
apt-get -y install bash curl unzip netstat lsof telnet netcat && \ apt-get -y install bash curl unzip netstat lsof telnet netcat && \
rm -rf /var/lib/apt/lists/* && \ rm -rf /var/lib/apt/lists/* && \
@ -28,7 +28,7 @@ ENV CORDAPPS_FOLDER="/opt/corda/cordapps" \
MY_RPC_PORT=10201 \ MY_RPC_PORT=10201 \
MY_RPC_ADMIN_PORT=10202 \ MY_RPC_ADMIN_PORT=10202 \
PATH=$PATH:/opt/corda/bin \ PATH=$PATH:/opt/corda/bin \
JVM_ARGS="-XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap " \ JVM_ARGS="-XX:+UnlockExperimentalVMOptions " \
CORDA_ARGS="" CORDA_ARGS=""
##CORDAPPS FOLDER ##CORDAPPS FOLDER

View File

@ -1,4 +1,4 @@
FROM amazoncorretto:8u392-al2 FROM amazoncorretto:17.0.9
## Add packages, clean cache, create dirs, create corda user and change ownership ## Add packages, clean cache, create dirs, create corda user and change ownership
RUN yum -y install bash && \ RUN yum -y install bash && \
@ -31,7 +31,7 @@ ENV CORDAPPS_FOLDER="/opt/corda/cordapps" \
MY_RPC_PORT=10201 \ MY_RPC_PORT=10201 \
MY_RPC_ADMIN_PORT=10202 \ MY_RPC_ADMIN_PORT=10202 \
PATH=$PATH:/opt/corda/bin \ PATH=$PATH:/opt/corda/bin \
JVM_ARGS="-XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap " \ JVM_ARGS="-XX:+UnlockExperimentalVMOptions " \
CORDA_ARGS="" CORDA_ARGS=""
##CORDAPPS FOLDER ##CORDAPPS FOLDER

View File

@ -1,12 +1,10 @@
kotlin.incremental=true kotlin.incremental=true
org.gradle.jvmargs=-XX:+UseG1GC -Xmx4g -Dfile.encoding=UTF-8 org.gradle.jvmargs=-Xmx6g -Dfile.encoding=UTF-8 --add-opens 'java.base/java.time=ALL-UNNAMED' --add-opens 'java.base/java.io=ALL-UNNAMED'
org.gradle.caching=true org.gradle.caching=false
owasp.failOnError=false owasp.failOnError=false
owasp.failBuildOnCVSS=11.0 owasp.failBuildOnCVSS=11.0
compilation.allWarningsAsErrors=false compilation.allWarningsAsErrors=false
test.parallel=false test.parallel=false
kotlin_version=1.9.0
# Gradle Enterprise commons_lang3_version=3.12.0
gradleEnterpriseUrl = https://gradle.dev.r3.com json_api_version=1.1.4
gradleEnterprisePlugin = 3.8.1
customUserDataGradlePlugin = 1.6.3

View File

@ -38,12 +38,9 @@ import net.corda.node.services.persistence.AttachmentStorageInternal
import net.corda.node.services.statemachine.ExternalEvent import net.corda.node.services.statemachine.ExternalEvent
import net.corda.node.services.statemachine.FlowStateMachineImpl import net.corda.node.services.statemachine.FlowStateMachineImpl
import net.corda.nodeapi.internal.persistence.CordaPersistence import net.corda.nodeapi.internal.persistence.CordaPersistence
import java.security.PublicKey
import java.security.SignatureException import java.security.SignatureException
import java.util.ArrayList
import java.util.Collections import java.util.Collections
import java.util.HashMap
import java.util.HashSet
import java.util.LinkedHashSet
interface NetworkMapCacheInternal : NetworkMapCache, NetworkMapCacheBase { interface NetworkMapCacheInternal : NetworkMapCache, NetworkMapCacheBase {
override val nodeReady: OpenFuture<Void?> override val nodeReady: OpenFuture<Void?>