From bf75f8fa550ac7c235fe473312b96b47805701fe Mon Sep 17 00:00:00 2001 From: Chris Barratt Date: Fri, 14 Oct 2022 13:20:24 +0100 Subject: [PATCH 1/6] Bulid changes to allow testing of simulator SNAPSHOT build --- build.gradle | 47 ++++++++++++++++++- gradle.properties | 9 +++- settings.gradle | 29 ++++++++++++ .../r3/developers/csdetemplate/Message.java | 4 +- .../csdetemplate/MyFirstFlowStartArgs.java | 3 +- 5 files changed, 84 insertions(+), 8 deletions(-) diff --git a/build.gradle b/build.gradle index bd29e7b..d5715b5 100644 --- a/build.gradle +++ b/build.gradle @@ -87,8 +87,51 @@ tasks.withType(JavaCompile) { repositories { + mavenLocal() // All dependencies are held in Maven Central mavenCentral() + + // R3 Internal repositories + // Repository the provides kotlin-stdlib-jdk8-osgi created by R3. + // Final location to be decided. + maven { + url = "$artifactoryContextUrl/corda-dependencies" + } + // Repository provides Corda 5 binaries that implement Corda-API. + // These will be made publicly available. + // Final location to be decided. + // Repository subject to change + maven { + url = "$artifactoryContextUrl/corda-os-maven" + credentials { + username = findProperty('cordaArtifactoryUsername') ?: System.getenv('CORDA_ARTIFACTORY_USERNAME') + password = findProperty('cordaArtifactoryPassword') ?: System.getenv('CORDA_ARTIFACTORY_PASSWORD') + } + } + // Provides the combined-worker Jars + // These will be made publicly available. + // Final location to be decided. + maven { + url = "$artifactoryContextUrl/corda-ent-maven-unstable-local" + credentials { + username = findProperty('cordaArtifactoryUsername') ?: System.getenv('CORDA_ARTIFACTORY_USERNAME') + password = findProperty('cordaArtifactoryPassword') ?: System.getenv('CORDA_ARTIFACTORY_PASSWORD') + } + } + maven { + url = "$artifactoryContextUrl/corda-ent-maven" + credentials { + username = findProperty('cordaArtifactoryUsername') ?: System.getenv('CORDA_ARTIFACTORY_USERNAME') + password = findProperty('cordaArtifactoryPassword') ?: System.getenv('CORDA_ARTIFACTORY_PASSWORD') + } + } + maven { + url = "$artifactoryContextUrl/engineering-tools-maven-unstable" + credentials { + username = findProperty('cordaArtifactoryUsername') ?: System.getenv('CORDA_ARTIFACTORY_USERNAME') + password = findProperty('cordaArtifactoryPassword') ?: System.getenv('CORDA_ARTIFACTORY_PASSWORD') + } + } } // Declare dependencies for the modules we will use. @@ -124,8 +167,8 @@ dependencies { cordaProvided 'org.slf4j:slf4j-api' // Dependencies Required By Test Tooling - testImplementation "net.corda:corda-simulator-api:$combinedWorkerVersion" - testRuntimeOnly "net.corda:corda-simulator-runtime:$combinedWorkerVersion" + testImplementation "net.corda:corda-simulator-api:$simulatorVersion" + testRuntimeOnly "net.corda:corda-simulator-runtime:$simulatorVersion" // 3rd party libraries // Required diff --git a/gradle.properties b/gradle.properties index c6aac50..1581641 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,8 @@ kotlin.code.style=official # Specify the version of the Corda-API to use. # This needs to match the version supported by the Corda Cluster the CorDapp will run on. -cordaApiVersion=5.0.0.190-DevPreview-2 +# cordaApiVersion=5.0.0.190-DevPreview-2 +cordaApiVersion=5.0.0.414-beta+ # Specify the version of the cordapp-cpb and cordapp-cpk plugins cordaPluginsVersion=7.0.0-DevPreview-2 @@ -25,7 +26,8 @@ hamcrestVersion=2.2 # Settings For Development Utilities testUtilsVersion=5.0.0.0-DevPreview-2 -combinedWorkerVersion=5.0.0.0-DevPreview-2 +#combinedWorkerVersion=5.0.0.0-DevPreview-2 +combinedWorkerVersion=5.0.0.0-beta+ cordaClusterURL=https://localhost:8888 cordaRpcUser=admin @@ -33,3 +35,6 @@ cordaRpcPasswd=admin devEnvWorkspace=workspace dbContainerName=CSDEpostgresql +# R3 internal repository +artifactoryContextUrl=https://software.r3.com/artifactory +simulatorVersion=5.0.0.0-SNAPSHOT \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index 3a9ccef..8fb0cb1 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,12 +1,41 @@ pluginManagement { // Declare the repositories where plugins are stored. repositories { + mavenLocal() gradlePluginPortal() mavenCentral { content { includeGroupByRegex 'net\\.corda(\\..*)?' } } + // R3 internal repositories + maven { + url "${artifactoryContextUrl}/corda-dev" + content { + includeGroupByRegex 'net\\.corda\\.plugins(\\..*)?' + } + } + maven { + url = "$artifactoryContextUrl/corda-os-maven-unstable" + credentials { + username = settings.ext.find('cordaArtifactoryUsername') ?: System.getenv('CORDA_ARTIFACTORY_USERNAME') + password = settings.ext.find('cordaArtifactoryPassword') ?: System.getenv('CORDA_ARTIFACTORY_PASSWORD') + } + } + maven { + url = "$artifactoryContextUrl/corda-os-maven-unstable-local" + credentials { + username = settings.ext.find('cordaArtifactoryUsername') ?: System.getenv('CORDA_ARTIFACTORY_USERNAME') + password = settings.ext.find('cordaArtifactoryPassword') ?: System.getenv('CORDA_ARTIFACTORY_PASSWORD') + } + } + maven { + url = "$artifactoryContextUrl/corda-dev" + credentials { + username = settings.ext.find('cordaArtifactoryUsername') ?: System.getenv('CORDA_ARTIFACTORY_USERNAME') + password = settings.ext.find('cordaArtifactoryPassword') ?: System.getenv('CORDA_ARTIFACTORY_PASSWORD') + } + } } // The plugin dependencies with versions of the plugins congruent with the specified CorDapp plugin version, diff --git a/src/main/java/com/r3/developers/csdetemplate/Message.java b/src/main/java/com/r3/developers/csdetemplate/Message.java index a7109ef..36e718c 100644 --- a/src/main/java/com/r3/developers/csdetemplate/Message.java +++ b/src/main/java/com/r3/developers/csdetemplate/Message.java @@ -3,8 +3,8 @@ package com.r3.developers.csdetemplate; import net.corda.v5.base.annotations.CordaSerializable; import net.corda.v5.base.types.MemberX500Name; -// // A class which will contain a message, It must be marked with @CordaSerializable for Corda -//// to be able to send from one virtual node to another. +// A class which will contain a message, It must be marked with @CordaSerializable for Corda +// to be able to send from one virtual node to another. @CordaSerializable public class Message { // public Message() {} diff --git a/src/main/java/com/r3/developers/csdetemplate/MyFirstFlowStartArgs.java b/src/main/java/com/r3/developers/csdetemplate/MyFirstFlowStartArgs.java index 1867875..99f7f22 100644 --- a/src/main/java/com/r3/developers/csdetemplate/MyFirstFlowStartArgs.java +++ b/src/main/java/com/r3/developers/csdetemplate/MyFirstFlowStartArgs.java @@ -2,8 +2,7 @@ package com.r3.developers.csdetemplate; import net.corda.v5.base.types.MemberX500Name; -// // A class to hold the arguments required to start the flow -//class MyFirstFlowStartArgs(val otherMember: MemberX500Name) +// A class to hold the arguments required to start the flow public class MyFirstFlowStartArgs { public MemberX500Name otherMember; From fc34e1bd5f45e101b8d0f9acb07a18a6f60cbae8 Mon Sep 17 00:00:00 2001 From: Khoi Nguyen Date: Mon, 17 Oct 2022 13:16:02 +0100 Subject: [PATCH 2/6] CORE-7135: Setup Jenkins pipeline * Added new .ci folder which contains Jenkins file for multibranch pipeline project --- .ci/Jenkinsfile | 8 ++++++++ .ci/nightly/JenkinsfileSnykScan | 6 ++++++ 2 files changed, 14 insertions(+) create mode 100644 .ci/Jenkinsfile create mode 100644 .ci/nightly/JenkinsfileSnykScan diff --git a/.ci/Jenkinsfile b/.ci/Jenkinsfile new file mode 100644 index 0000000..8e0651c --- /dev/null +++ b/.ci/Jenkinsfile @@ -0,0 +1,8 @@ +@Library('corda-shared-build-pipeline-steps@5.0') _ + +cordaPipeline( + publishRepoPrefix: '', + slimBuild: true, + runUnitTests: false, + dedicatedJobForSnykDelta: false + ) diff --git a/.ci/nightly/JenkinsfileSnykScan b/.ci/nightly/JenkinsfileSnykScan new file mode 100644 index 0000000..c07efb7 --- /dev/null +++ b/.ci/nightly/JenkinsfileSnykScan @@ -0,0 +1,6 @@ +@Library('corda-shared-build-pipeline-steps@5.0') _ + +cordaSnykScanPipeline ( + snykTokenId: 'r3-snyk-corda5', + snykAdditionalCommands: "--all-sub-projects -d" +) From 0428adac4cca4545523ec958fb6c3f58ac76d83c Mon Sep 17 00:00:00 2001 From: Ronan Browne Date: Fri, 21 Oct 2022 09:04:09 +0100 Subject: [PATCH 3/6] CORE-7135: send notifications to correct slack channel --- .ci/Jenkinsfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.ci/Jenkinsfile b/.ci/Jenkinsfile index 8e0651c..330a1e5 100644 --- a/.ci/Jenkinsfile +++ b/.ci/Jenkinsfile @@ -4,5 +4,6 @@ cordaPipeline( publishRepoPrefix: '', slimBuild: true, runUnitTests: false, - dedicatedJobForSnykDelta: false + dedicatedJobForSnykDelta: false, + slackChannel: '#corda-corda5-dev-ex-build-notifications' ) From bbdb1b41cae4c83af5f61b4e8565f168a6798315 Mon Sep 17 00:00:00 2001 From: Chris Barratt Date: Wed, 26 Oct 2022 15:55:50 +0100 Subject: [PATCH 4/6] Use published artifacts --- build.gradle | 47 ++--------------------------------------------- gradle.properties | 9 ++------- settings.gradle | 31 ++----------------------------- 3 files changed, 6 insertions(+), 81 deletions(-) diff --git a/build.gradle b/build.gradle index 733d3bf..ff011d9 100644 --- a/build.gradle +++ b/build.gradle @@ -55,51 +55,8 @@ tasks.withType(JavaCompile) { } repositories { - mavenLocal() // All dependencies are held in Maven Central mavenCentral() - - // R3 Internal repositories - // Repository the provides kotlin-stdlib-jdk8-osgi created by R3. - // Final location to be decided. - maven { - url = "$artifactoryContextUrl/corda-dependencies" - } - // Repository provides Corda 5 binaries that implement Corda-API. - // These will be made publicly available. - // Final location to be decided. - // Repository subject to change - maven { - url = "$artifactoryContextUrl/corda-os-maven" - credentials { - username = findProperty('cordaArtifactoryUsername') ?: System.getenv('CORDA_ARTIFACTORY_USERNAME') - password = findProperty('cordaArtifactoryPassword') ?: System.getenv('CORDA_ARTIFACTORY_PASSWORD') - } - } - // Provides the combined-worker Jars - // These will be made publicly available. - // Final location to be decided. - maven { - url = "$artifactoryContextUrl/corda-ent-maven-unstable-local" - credentials { - username = findProperty('cordaArtifactoryUsername') ?: System.getenv('CORDA_ARTIFACTORY_USERNAME') - password = findProperty('cordaArtifactoryPassword') ?: System.getenv('CORDA_ARTIFACTORY_PASSWORD') - } - } - maven { - url = "$artifactoryContextUrl/corda-ent-maven" - credentials { - username = findProperty('cordaArtifactoryUsername') ?: System.getenv('CORDA_ARTIFACTORY_USERNAME') - password = findProperty('cordaArtifactoryPassword') ?: System.getenv('CORDA_ARTIFACTORY_PASSWORD') - } - } - maven { - url = "$artifactoryContextUrl/engineering-tools-maven-unstable" - credentials { - username = findProperty('cordaArtifactoryUsername') ?: System.getenv('CORDA_ARTIFACTORY_USERNAME') - password = findProperty('cordaArtifactoryPassword') ?: System.getenv('CORDA_ARTIFACTORY_PASSWORD') - } - } } // Declare dependencies for the modules we will use. @@ -128,8 +85,8 @@ dependencies { cordaProvided 'org.slf4j:slf4j-api' // Dependencies Required By Test Tooling - testImplementation "net.corda:corda-simulator-api:$simulatorVersion" - testRuntimeOnly "net.corda:corda-simulator-runtime:$simulatorVersion" + testImplementation "net.corda:corda-simulator-api:$combinedWorkerVersion" + testRuntimeOnly "net.corda:corda-simulator-runtime:$combinedWorkerVersion" // 3rd party libraries // Required diff --git a/gradle.properties b/gradle.properties index 1581641..c6aac50 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,8 +2,7 @@ kotlin.code.style=official # Specify the version of the Corda-API to use. # This needs to match the version supported by the Corda Cluster the CorDapp will run on. -# cordaApiVersion=5.0.0.190-DevPreview-2 -cordaApiVersion=5.0.0.414-beta+ +cordaApiVersion=5.0.0.190-DevPreview-2 # Specify the version of the cordapp-cpb and cordapp-cpk plugins cordaPluginsVersion=7.0.0-DevPreview-2 @@ -26,8 +25,7 @@ hamcrestVersion=2.2 # Settings For Development Utilities testUtilsVersion=5.0.0.0-DevPreview-2 -#combinedWorkerVersion=5.0.0.0-DevPreview-2 -combinedWorkerVersion=5.0.0.0-beta+ +combinedWorkerVersion=5.0.0.0-DevPreview-2 cordaClusterURL=https://localhost:8888 cordaRpcUser=admin @@ -35,6 +33,3 @@ cordaRpcPasswd=admin devEnvWorkspace=workspace dbContainerName=CSDEpostgresql -# R3 internal repository -artifactoryContextUrl=https://software.r3.com/artifactory -simulatorVersion=5.0.0.0-SNAPSHOT \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index 8fb0cb1..655a3be 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,41 +1,12 @@ pluginManagement { // Declare the repositories where plugins are stored. repositories { - mavenLocal() gradlePluginPortal() mavenCentral { content { includeGroupByRegex 'net\\.corda(\\..*)?' } } - // R3 internal repositories - maven { - url "${artifactoryContextUrl}/corda-dev" - content { - includeGroupByRegex 'net\\.corda\\.plugins(\\..*)?' - } - } - maven { - url = "$artifactoryContextUrl/corda-os-maven-unstable" - credentials { - username = settings.ext.find('cordaArtifactoryUsername') ?: System.getenv('CORDA_ARTIFACTORY_USERNAME') - password = settings.ext.find('cordaArtifactoryPassword') ?: System.getenv('CORDA_ARTIFACTORY_PASSWORD') - } - } - maven { - url = "$artifactoryContextUrl/corda-os-maven-unstable-local" - credentials { - username = settings.ext.find('cordaArtifactoryUsername') ?: System.getenv('CORDA_ARTIFACTORY_USERNAME') - password = settings.ext.find('cordaArtifactoryPassword') ?: System.getenv('CORDA_ARTIFACTORY_PASSWORD') - } - } - maven { - url = "$artifactoryContextUrl/corda-dev" - credentials { - username = settings.ext.find('cordaArtifactoryUsername') ?: System.getenv('CORDA_ARTIFACTORY_USERNAME') - password = settings.ext.find('cordaArtifactoryPassword') ?: System.getenv('CORDA_ARTIFACTORY_PASSWORD') - } - } } // The plugin dependencies with versions of the plugins congruent with the specified CorDapp plugin version, @@ -54,3 +25,5 @@ pluginManagement { rootProject.name = 'csde-cordapp-template-java' + + From 39c21c38a67b820ca8d87c26a0796261a68ad493 Mon Sep 17 00:00:00 2001 From: Chris Barratt Date: Wed, 26 Oct 2022 16:30:17 +0100 Subject: [PATCH 5/6] Fix Jenkinsfile bug --- .ci/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/Jenkinsfile b/.ci/Jenkinsfile index 1e80e28..4e8e34a 100644 --- a/.ci/Jenkinsfile +++ b/.ci/Jenkinsfile @@ -5,6 +5,6 @@ cordaPipeline( slimBuild: true, runUnitTests: false, dedicatedJobForSnykDelta: false, - slackChannel: '#corda-corda5-dev-ex-build-notifications' + slackChannel: '#corda-corda5-dev-ex-build-notifications', dedicatedJobForSnykDelta: false ) From 805fb0d9ad853fcb3efd9d598c8f4be48165b930 Mon Sep 17 00:00:00 2001 From: Chris Barratt Date: Wed, 26 Oct 2022 16:31:16 +0100 Subject: [PATCH 6/6] Fix Jenkinsfile bug --- .ci/Jenkinsfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.ci/Jenkinsfile b/.ci/Jenkinsfile index 4e8e34a..330a1e5 100644 --- a/.ci/Jenkinsfile +++ b/.ci/Jenkinsfile @@ -5,6 +5,5 @@ cordaPipeline( slimBuild: true, runUnitTests: false, dedicatedJobForSnykDelta: false, - slackChannel: '#corda-corda5-dev-ex-build-notifications', - dedicatedJobForSnykDelta: false + slackChannel: '#corda-corda5-dev-ex-build-notifications' )