From 380a942954f0b632bad4aa20e933cf468f56f6e5 Mon Sep 17 00:00:00 2001 From: Chris Rankin Date: Mon, 15 Oct 2018 13:44:02 +0100 Subject: [PATCH 1/4] CORDA-2030: Prevent kotlin-stdlib-jre8 from becoming an accidental transitive dependency. (#4073) --- node/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/build.gradle b/node/build.gradle index b100797903..c0a64db26b 100644 --- a/node/build.gradle +++ b/node/build.gradle @@ -79,7 +79,7 @@ dependencies { compile "org.slf4j:jul-to-slf4j:$slf4j_version" compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" - runtime "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version" + runtimeOnly "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version" compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" testCompile "org.jetbrains.kotlin:kotlin-test:$kotlin_version" From 1f835a349619408cd4f237a53511501bee5b1679 Mon Sep 17 00:00:00 2001 From: Mike Hearn Date: Mon, 15 Oct 2018 15:01:51 +0100 Subject: [PATCH 2/4] Add package namespace ownership design doc to toc tree --- docs/source/index.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/source/index.rst b/docs/source/index.rst index 9aaaeaaf73..8e191c699e 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -83,6 +83,7 @@ We look forward to seeing what you can do with Corda! design/sgx-infrastructure/design.md design/threat-model/corda-threat-model.md design/data-model-upgrades/signature-constraints.md + design/data-model-upgrades/package-namespace-ownership.md .. conditional-toctree:: :caption: Participate From 2248f54f9f94b0bd29f03b1a16c7544b78cafeaf Mon Sep 17 00:00:00 2001 From: Chris Rankin Date: Mon, 15 Oct 2018 19:51:28 +0100 Subject: [PATCH 3/4] CORDA-2096: Migrate finance test classes into .test sub-packages. (#4079) --- .../finance/compat/CashExceptionSerialisationTest.kt | 10 +--------- .../flows/{ => test}/CashConfigDataFlowTest.kt | 7 +++++-- .../asset/{ => test}/DummyFungibleContract.kt | 11 ++++++----- .../finance/flows/test/CashExceptionThrowingFlow.kt | 12 ++++++++++++ .../finance/schemas/{ => test}/SampleCashSchemaV1.kt | 2 +- .../finance/schemas/{ => test}/SampleCashSchemaV2.kt | 2 +- .../finance/schemas/{ => test}/SampleCashSchemaV3.kt | 2 +- .../{ => test}/SampleCommercialPaperSchemaV1.kt | 2 +- .../{ => test}/SampleCommercialPaperSchemaV2.kt | 2 +- .../node/services/vault/VaultQueryJavaTests.java | 2 +- .../persistence/HibernateConfigurationTest.kt | 8 ++++---- .../node/services/vault/VaultQueryExceptionsTests.kt | 3 +-- .../net/corda/node/services/vault/VaultQueryTests.kt | 4 ++-- 13 files changed, 37 insertions(+), 30 deletions(-) rename finance/src/integration-test/kotlin/net/corda/finance/flows/{ => test}/CashConfigDataFlowTest.kt (74%) rename finance/src/test/kotlin/net/corda/finance/contracts/asset/{ => test}/DummyFungibleContract.kt (95%) create mode 100644 finance/src/test/kotlin/net/corda/finance/flows/test/CashExceptionThrowingFlow.kt rename finance/src/test/kotlin/net/corda/finance/schemas/{ => test}/SampleCashSchemaV1.kt (97%) rename finance/src/test/kotlin/net/corda/finance/schemas/{ => test}/SampleCashSchemaV2.kt (97%) rename finance/src/test/kotlin/net/corda/finance/schemas/{ => test}/SampleCashSchemaV3.kt (97%) rename finance/src/test/kotlin/net/corda/finance/schemas/{ => test}/SampleCommercialPaperSchemaV1.kt (98%) rename finance/src/test/kotlin/net/corda/finance/schemas/{ => test}/SampleCommercialPaperSchemaV2.kt (98%) diff --git a/finance/src/integration-test/kotlin/net/corda/finance/compat/CashExceptionSerialisationTest.kt b/finance/src/integration-test/kotlin/net/corda/finance/compat/CashExceptionSerialisationTest.kt index ad7ac19fc8..cd6efc7f2d 100644 --- a/finance/src/integration-test/kotlin/net/corda/finance/compat/CashExceptionSerialisationTest.kt +++ b/finance/src/integration-test/kotlin/net/corda/finance/compat/CashExceptionSerialisationTest.kt @@ -1,10 +1,9 @@ package net.corda.finance.compat -import net.corda.core.flows.FlowLogic -import net.corda.core.flows.StartableByRPC import net.corda.core.messaging.startFlow import net.corda.core.utilities.getOrThrow import net.corda.finance.flows.CashException +import net.corda.finance.flows.test.CashExceptionThrowingFlow import net.corda.node.services.Permissions.Companion.all import net.corda.testing.driver.DriverParameters import net.corda.testing.driver.driver @@ -26,10 +25,3 @@ class CashExceptionSerialisationTest { } } } - -@StartableByRPC -class CashExceptionThrowingFlow : FlowLogic() { - override fun call() { - throw CashException("BOOM!", IllegalStateException("Nope dude!")) - } -} \ No newline at end of file diff --git a/finance/src/integration-test/kotlin/net/corda/finance/flows/CashConfigDataFlowTest.kt b/finance/src/integration-test/kotlin/net/corda/finance/flows/test/CashConfigDataFlowTest.kt similarity index 74% rename from finance/src/integration-test/kotlin/net/corda/finance/flows/CashConfigDataFlowTest.kt rename to finance/src/integration-test/kotlin/net/corda/finance/flows/test/CashConfigDataFlowTest.kt index 4c9374075c..77316c148e 100644 --- a/finance/src/integration-test/kotlin/net/corda/finance/flows/CashConfigDataFlowTest.kt +++ b/finance/src/integration-test/kotlin/net/corda/finance/flows/test/CashConfigDataFlowTest.kt @@ -1,9 +1,10 @@ -package net.corda.finance.flows +package net.corda.finance.flows.test import net.corda.core.messaging.startFlow import net.corda.core.utilities.getOrThrow import net.corda.finance.EUR import net.corda.finance.USD +import net.corda.finance.flows.CashConfigDataFlow import net.corda.testing.driver.DriverParameters import net.corda.testing.driver.driver import org.assertj.core.api.Assertions.assertThat @@ -12,7 +13,9 @@ import org.junit.Test class CashConfigDataFlowTest { @Test fun `issuable currencies are read in from node config`() { - driver(DriverParameters(notarySpecs = emptyList())) { + driver(DriverParameters( + extraCordappPackagesToScan = listOf("net.corda.finance.flows"), + notarySpecs = emptyList())) { val node = startNode(customOverrides = mapOf("custom" to mapOf("issuableCurrencies" to listOf("EUR", "USD")))).getOrThrow() val config = node.rpc.startFlow(::CashConfigDataFlow).returnValue.getOrThrow() assertThat(config.issuableCurrencies).containsExactly(EUR, USD) diff --git a/finance/src/test/kotlin/net/corda/finance/contracts/asset/DummyFungibleContract.kt b/finance/src/test/kotlin/net/corda/finance/contracts/asset/test/DummyFungibleContract.kt similarity index 95% rename from finance/src/test/kotlin/net/corda/finance/contracts/asset/DummyFungibleContract.kt rename to finance/src/test/kotlin/net/corda/finance/contracts/asset/test/DummyFungibleContract.kt index 2b6b79d9a6..aec5b1f088 100644 --- a/finance/src/test/kotlin/net/corda/finance/contracts/asset/DummyFungibleContract.kt +++ b/finance/src/test/kotlin/net/corda/finance/contracts/asset/test/DummyFungibleContract.kt @@ -1,4 +1,4 @@ -package net.corda.finance.contracts.asset +package net.corda.finance.contracts.asset.test import net.corda.core.contracts.* import net.corda.core.crypto.toStringShort @@ -8,9 +8,10 @@ import net.corda.core.schemas.MappedSchema import net.corda.core.schemas.PersistentState import net.corda.core.schemas.QueryableState import net.corda.core.transactions.LedgerTransaction -import net.corda.finance.schemas.SampleCashSchemaV1 -import net.corda.finance.schemas.SampleCashSchemaV2 -import net.corda.finance.schemas.SampleCashSchemaV3 +import net.corda.finance.contracts.asset.OnLedgerAsset +import net.corda.finance.schemas.test.SampleCashSchemaV1 +import net.corda.finance.schemas.test.SampleCashSchemaV2 +import net.corda.finance.schemas.test.SampleCashSchemaV3 import net.corda.finance.utils.sumCash import net.corda.finance.utils.sumCashOrNull import net.corda.finance.utils.sumCashOrZero @@ -18,7 +19,7 @@ import java.security.PublicKey import java.util.* class DummyFungibleContract : OnLedgerAsset() { - override fun extractCommands(commands: Collection>): List> + override fun extractCommands(commands: Collection>): List> = commands.select() data class State( diff --git a/finance/src/test/kotlin/net/corda/finance/flows/test/CashExceptionThrowingFlow.kt b/finance/src/test/kotlin/net/corda/finance/flows/test/CashExceptionThrowingFlow.kt new file mode 100644 index 0000000000..a8e03cd67f --- /dev/null +++ b/finance/src/test/kotlin/net/corda/finance/flows/test/CashExceptionThrowingFlow.kt @@ -0,0 +1,12 @@ +package net.corda.finance.flows.test + +import net.corda.core.flows.FlowLogic +import net.corda.core.flows.StartableByRPC +import net.corda.finance.flows.CashException + +@StartableByRPC +class CashExceptionThrowingFlow : FlowLogic() { + override fun call() { + throw CashException("BOOM!", IllegalStateException("Nope dude!")) + } +} diff --git a/finance/src/test/kotlin/net/corda/finance/schemas/SampleCashSchemaV1.kt b/finance/src/test/kotlin/net/corda/finance/schemas/test/SampleCashSchemaV1.kt similarity index 97% rename from finance/src/test/kotlin/net/corda/finance/schemas/SampleCashSchemaV1.kt rename to finance/src/test/kotlin/net/corda/finance/schemas/test/SampleCashSchemaV1.kt index 86efb2c5c5..b3b1262803 100644 --- a/finance/src/test/kotlin/net/corda/finance/schemas/SampleCashSchemaV1.kt +++ b/finance/src/test/kotlin/net/corda/finance/schemas/test/SampleCashSchemaV1.kt @@ -1,4 +1,4 @@ -package net.corda.finance.schemas +package net.corda.finance.schemas.test import net.corda.core.contracts.MAX_ISSUER_REF_SIZE import net.corda.core.schemas.MappedSchema diff --git a/finance/src/test/kotlin/net/corda/finance/schemas/SampleCashSchemaV2.kt b/finance/src/test/kotlin/net/corda/finance/schemas/test/SampleCashSchemaV2.kt similarity index 97% rename from finance/src/test/kotlin/net/corda/finance/schemas/SampleCashSchemaV2.kt rename to finance/src/test/kotlin/net/corda/finance/schemas/test/SampleCashSchemaV2.kt index a17f863841..ba6473f4b8 100644 --- a/finance/src/test/kotlin/net/corda/finance/schemas/SampleCashSchemaV2.kt +++ b/finance/src/test/kotlin/net/corda/finance/schemas/test/SampleCashSchemaV2.kt @@ -1,4 +1,4 @@ -package net.corda.finance.schemas +package net.corda.finance.schemas.test import net.corda.core.identity.AbstractParty import net.corda.core.schemas.CommonSchemaV1 diff --git a/finance/src/test/kotlin/net/corda/finance/schemas/SampleCashSchemaV3.kt b/finance/src/test/kotlin/net/corda/finance/schemas/test/SampleCashSchemaV3.kt similarity index 97% rename from finance/src/test/kotlin/net/corda/finance/schemas/SampleCashSchemaV3.kt rename to finance/src/test/kotlin/net/corda/finance/schemas/test/SampleCashSchemaV3.kt index 987210cd84..eded7dfbdf 100644 --- a/finance/src/test/kotlin/net/corda/finance/schemas/SampleCashSchemaV3.kt +++ b/finance/src/test/kotlin/net/corda/finance/schemas/test/SampleCashSchemaV3.kt @@ -1,4 +1,4 @@ -package net.corda.finance.schemas +package net.corda.finance.schemas.test import net.corda.core.contracts.MAX_ISSUER_REF_SIZE import net.corda.core.identity.AbstractParty diff --git a/finance/src/test/kotlin/net/corda/finance/schemas/SampleCommercialPaperSchemaV1.kt b/finance/src/test/kotlin/net/corda/finance/schemas/test/SampleCommercialPaperSchemaV1.kt similarity index 98% rename from finance/src/test/kotlin/net/corda/finance/schemas/SampleCommercialPaperSchemaV1.kt rename to finance/src/test/kotlin/net/corda/finance/schemas/test/SampleCommercialPaperSchemaV1.kt index 236d96fdd5..e7f5fa0def 100644 --- a/finance/src/test/kotlin/net/corda/finance/schemas/SampleCommercialPaperSchemaV1.kt +++ b/finance/src/test/kotlin/net/corda/finance/schemas/test/SampleCommercialPaperSchemaV1.kt @@ -1,4 +1,4 @@ -package net.corda.finance.schemas +package net.corda.finance.schemas.test import net.corda.core.contracts.MAX_ISSUER_REF_SIZE import net.corda.core.schemas.MappedSchema diff --git a/finance/src/test/kotlin/net/corda/finance/schemas/SampleCommercialPaperSchemaV2.kt b/finance/src/test/kotlin/net/corda/finance/schemas/test/SampleCommercialPaperSchemaV2.kt similarity index 98% rename from finance/src/test/kotlin/net/corda/finance/schemas/SampleCommercialPaperSchemaV2.kt rename to finance/src/test/kotlin/net/corda/finance/schemas/test/SampleCommercialPaperSchemaV2.kt index 9eeac47cc0..eacd846df5 100644 --- a/finance/src/test/kotlin/net/corda/finance/schemas/SampleCommercialPaperSchemaV2.kt +++ b/finance/src/test/kotlin/net/corda/finance/schemas/test/SampleCommercialPaperSchemaV2.kt @@ -1,4 +1,4 @@ -package net.corda.finance.schemas +package net.corda.finance.schemas.test import net.corda.core.contracts.MAX_ISSUER_REF_SIZE import net.corda.core.identity.AbstractParty diff --git a/node/src/test/java/net/corda/node/services/vault/VaultQueryJavaTests.java b/node/src/test/java/net/corda/node/services/vault/VaultQueryJavaTests.java index 6ccb168d58..9472c5b330 100644 --- a/node/src/test/java/net/corda/node/services/vault/VaultQueryJavaTests.java +++ b/node/src/test/java/net/corda/node/services/vault/VaultQueryJavaTests.java @@ -19,7 +19,7 @@ import net.corda.core.node.services.vault.QueryCriteria.VaultQueryCriteria; import net.corda.finance.contracts.DealState; import net.corda.finance.contracts.asset.Cash; import net.corda.finance.schemas.CashSchemaV1; -import net.corda.finance.schemas.SampleCashSchemaV2; +import net.corda.finance.schemas.test.SampleCashSchemaV2; import net.corda.node.services.api.IdentityServiceInternal; import net.corda.nodeapi.internal.persistence.CordaPersistence; import net.corda.nodeapi.internal.persistence.DatabaseTransaction; diff --git a/node/src/test/kotlin/net/corda/node/services/persistence/HibernateConfigurationTest.kt b/node/src/test/kotlin/net/corda/node/services/persistence/HibernateConfigurationTest.kt index dc1867bf19..72071192cd 100644 --- a/node/src/test/kotlin/net/corda/node/services/persistence/HibernateConfigurationTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/persistence/HibernateConfigurationTest.kt @@ -23,11 +23,11 @@ import net.corda.finance.DOLLARS import net.corda.finance.POUNDS import net.corda.finance.SWISS_FRANCS import net.corda.finance.contracts.asset.Cash -import net.corda.finance.contracts.asset.DummyFungibleContract +import net.corda.finance.contracts.asset.test.DummyFungibleContract import net.corda.finance.schemas.CashSchemaV1 -import net.corda.finance.schemas.SampleCashSchemaV1 -import net.corda.finance.schemas.SampleCashSchemaV2 -import net.corda.finance.schemas.SampleCashSchemaV3 +import net.corda.finance.schemas.test.SampleCashSchemaV1 +import net.corda.finance.schemas.test.SampleCashSchemaV2 +import net.corda.finance.schemas.test.SampleCashSchemaV3 import net.corda.finance.utils.sumCash import net.corda.node.internal.configureDatabase import net.corda.node.services.api.IdentityServiceInternal diff --git a/node/src/test/kotlin/net/corda/node/services/vault/VaultQueryExceptionsTests.kt b/node/src/test/kotlin/net/corda/node/services/vault/VaultQueryExceptionsTests.kt index 9d3cb8a5f8..137de148c0 100644 --- a/node/src/test/kotlin/net/corda/node/services/vault/VaultQueryExceptionsTests.kt +++ b/node/src/test/kotlin/net/corda/node/services/vault/VaultQueryExceptionsTests.kt @@ -6,8 +6,7 @@ import net.corda.core.node.services.vault.* import net.corda.core.node.services.vault.QueryCriteria.* import net.corda.finance.* import net.corda.finance.contracts.asset.Cash -import net.corda.finance.schemas.SampleCashSchemaV3 -import net.corda.finance.schemas.CashSchemaV1 +import net.corda.finance.schemas.test.SampleCashSchemaV3 import net.corda.testing.core.* import net.corda.testing.internal.vault.DummyLinearStateSchemaV1 import org.assertj.core.api.Assertions.assertThatThrownBy diff --git a/node/src/test/kotlin/net/corda/node/services/vault/VaultQueryTests.kt b/node/src/test/kotlin/net/corda/node/services/vault/VaultQueryTests.kt index 99010acca7..d7f890a7ab 100644 --- a/node/src/test/kotlin/net/corda/node/services/vault/VaultQueryTests.kt +++ b/node/src/test/kotlin/net/corda/node/services/vault/VaultQueryTests.kt @@ -22,8 +22,8 @@ import net.corda.finance.contracts.asset.cash.selection.AbstractCashSelection import net.corda.finance.schemas.CashSchemaV1 import net.corda.finance.schemas.CashSchemaV1.PersistentCashState import net.corda.finance.schemas.CommercialPaperSchemaV1 -import net.corda.finance.schemas.SampleCashSchemaV2 -import net.corda.finance.schemas.SampleCashSchemaV3 +import net.corda.finance.schemas.test.SampleCashSchemaV2 +import net.corda.finance.schemas.test.SampleCashSchemaV3 import net.corda.node.internal.configureDatabase import net.corda.nodeapi.internal.persistence.CordaPersistence import net.corda.nodeapi.internal.persistence.DatabaseConfig From 47068e6b7ad0afb3ed8df61a429470f19331b7b5 Mon Sep 17 00:00:00 2001 From: Florian Friemel Date: Mon, 15 Oct 2018 21:11:52 +0100 Subject: [PATCH 4/4] [CORDA-2077] Use latest gradle plugin version (4.0.32), set target version in core and sample CorDapps (#4038) * Upgrade gradle plugin; add target version attribute to finance and sample cordapps. * Remove '-SNAPSHOT' from gradlePluginsVersion. * Fix naming. * Update docs. * Respond to feedback. * Fix irs demo * Fix more samples * Fix more samples * Fix deployNodes * Fix deployNodes * more fixes * fix simm valuation * more fixes * more fixes * more fixes * more fixes * Publication should have *nothing* to do with cordformation and deployNodes. Remove it! And if this exposes a bug then "so be it". * Disable CorDapp signing for Cordapp Configuration and Network Verifier. * Disable CorDapp signing for SIMM Valuation Demo. * Remove remaining publishing nonsense from samples. * Workarounds fpr cordapp-configuration, network-verifier and simm-valuation-demo: JarSigner rejects jars with duplicates inside, so remove them. * Upgrade to Gradle plugin 4.0.32 and reenable CorDapp signing for samples. --- constants.properties | 2 +- docs/source/cordapp-build-systems.rst | 18 ++++++++-- experimental/notary-bft-smart/build.gradle | 10 ++++++ experimental/notary-raft/build.gradle | 9 +++++ finance/build.gradle | 2 ++ samples/attachment-demo/build.gradle | 32 ++++++++--------- samples/bank-of-corda-demo/build.gradle | 31 ++++++++--------- samples/cordapp-configuration/build.gradle | 27 ++++++++++----- .../corda/configsample/GetStringConfigFlow.kt | 25 ++++++++++++++ samples/irs-demo/build.gradle | 1 - samples/irs-demo/cordapp/build.gradle | 24 ++++++++----- samples/network-verifier/build.gradle | 23 +++++++++---- samples/notary-demo/build.gradle | 24 +++++++++---- samples/simm-valuation-demo/build.gradle | 17 ++++++++-- .../contracts-states/build.gradle | 6 ++++ .../simm-valuation-demo/flows/build.gradle | 4 +++ samples/trader-demo/build.gradle | 34 ++++++++----------- 17 files changed, 199 insertions(+), 90 deletions(-) diff --git a/constants.properties b/constants.properties index d472994d01..5bc1a09cd5 100644 --- a/constants.properties +++ b/constants.properties @@ -1,4 +1,4 @@ -gradlePluginsVersion=4.0.29 +gradlePluginsVersion=4.0.32 kotlinVersion=1.2.51 # ***************************************************************# # When incrementing platformVersion make sure to update # diff --git a/docs/source/cordapp-build-systems.rst b/docs/source/cordapp-build-systems.rst index af785ae777..7ca31b2b1a 100644 --- a/docs/source/cordapp-build-systems.rst +++ b/docs/source/cordapp-build-systems.rst @@ -198,11 +198,23 @@ CorDapps can advertise their minimum and target platform version. The minimum pl .. sourcecode:: groovy - 'Min-Platform-Version': 3 + 'Min-Platform-Version': 4 'Target-Platform-Version': 4 +Using the `cordapp` Gradle plugin, this can be achieved by putting this in your CorDapp's `build.gradle`: -In gradle, this can be achieved by modifying the jar task as shown in this example: +.. container:: codeset + + .. sourcecode:: groovy + + cordapp { + info { + targetPlatformVersion 4 + minimumPlatformVersion 4 + } + } + +Without using the `cordapp` plugin, you can achieve the same by modifying the jar task as shown in this example: .. container:: codeset @@ -211,7 +223,7 @@ In gradle, this can be achieved by modifying the jar task as shown in this examp jar { manifest { attributes( - 'Min-Platform-Version': 3 + 'Min-Platform-Version': 4 'Target-Platform-Version': 4 ) } diff --git a/experimental/notary-bft-smart/build.gradle b/experimental/notary-bft-smart/build.gradle index b4ff48b444..bcd0614686 100644 --- a/experimental/notary-bft-smart/build.gradle +++ b/experimental/notary-bft-smart/build.gradle @@ -33,3 +33,13 @@ idea { publish { name 'corda-notary-bft-smart' } + + +cordapp { + info { + name "net/corda/experimental/notary-bft-smart" + vendor "Corda Open Source" + targetPlatformVersion corda_platform_version.toInteger() + minimumPlatformVersion 1 + } +} diff --git a/experimental/notary-raft/build.gradle b/experimental/notary-raft/build.gradle index b07659ef2f..fc6a1894da 100644 --- a/experimental/notary-raft/build.gradle +++ b/experimental/notary-raft/build.gradle @@ -33,3 +33,12 @@ idea { publish { name 'corda-notary-raft' } + +cordapp { + info { + name "net/corda/experimental/notary-raft" + vendor "Corda Open Source" + targetPlatformVersion corda_platform_version.toInteger() + minimumPlatformVersion 1 + } +} diff --git a/finance/build.gradle b/finance/build.gradle index b55819f201..be028830eb 100644 --- a/finance/build.gradle +++ b/finance/build.gradle @@ -87,6 +87,8 @@ cordapp { info { name "net/corda/finance" vendor "Corda Open Source" + targetPlatformVersion corda_platform_version.toInteger() + minimumPlatformVersion 1 } } diff --git a/samples/attachment-demo/build.gradle b/samples/attachment-demo/build.gradle index 71fbfe48d7..7629c833fa 100644 --- a/samples/attachment-demo/build.gradle +++ b/samples/attachment-demo/build.gradle @@ -1,11 +1,8 @@ -apply plugin: 'java' apply plugin: 'kotlin' apply plugin: 'idea' apply plugin: 'net.corda.plugins.quasar-utils' -apply plugin: 'net.corda.plugins.publish-utils' apply plugin: 'net.corda.plugins.cordapp' apply plugin: 'net.corda.plugins.cordformation' -apply plugin: 'maven-publish' sourceSets { integrationTest { @@ -27,14 +24,16 @@ dependencies { testCompile "junit:junit:$junit_version" // Corda integration dependencies - cordaCompile project(path: ":node:capsule", configuration: 'runtimeArtifacts') - cordaCompile project(path: ":webserver:webcapsule", configuration: 'runtimeArtifacts') + cordaRuntime project(path: ":node:capsule", configuration: 'runtimeArtifacts') + cordaRuntime project(path: ":webserver:webcapsule", configuration: 'runtimeArtifacts') cordaCompile project(':core') cordaCompile project(':webserver') cordaCompile project(':node-driver') } -task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar']) { +def nodeTask = tasks.getByPath(':node:capsule:assemble') +def webTask = tasks.getByPath(':webserver:webcapsule:assemble') +task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar', nodeTask, webTask]) { ext.rpcUsers = [['username': "demo", 'password': "demo", 'permissions': ["StartFlow.net.corda.attachmentdemo.AttachmentDemoFlow", "InvokeRpc.wellKnownPartyFromX500Name", "InvokeRpc.attachmentExists", @@ -92,18 +91,6 @@ idea { } } -publishing { - publications { - jarAndSources(MavenPublication) { - from components.java - artifactId 'attachmentdemo' - - artifact sourceJar - artifact javadocJar - } - } -} - task runSender(type: JavaExec) { classpath = sourceSets.main.runtimeClasspath main = 'net.corda.attachmentdemo.AttachmentDemoKt' @@ -125,3 +112,12 @@ jar { ) } } + +cordapp { + info { + name "net/corda/samples/attachment-demo" + vendor "Corda Open Source" + targetPlatformVersion corda_platform_version.toInteger() + minimumPlatformVersion 1 + } +} diff --git a/samples/bank-of-corda-demo/build.gradle b/samples/bank-of-corda-demo/build.gradle index c05f0172e3..0990cc5987 100644 --- a/samples/bank-of-corda-demo/build.gradle +++ b/samples/bank-of-corda-demo/build.gradle @@ -2,10 +2,8 @@ apply plugin: 'java' apply plugin: 'kotlin' apply plugin: 'idea' apply plugin: 'net.corda.plugins.quasar-utils' -apply plugin: 'net.corda.plugins.publish-utils' apply plugin: 'net.corda.plugins.cordapp' apply plugin: 'net.corda.plugins.cordformation' -apply plugin: 'maven-publish' dependencies { compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" @@ -14,8 +12,8 @@ dependencies { cordapp project(':finance') // Corda integration dependencies - cordaCompile project(path: ":node:capsule", configuration: 'runtimeArtifacts') - cordaCompile project(path: ":webserver:webcapsule", configuration: 'runtimeArtifacts') + cordaRuntime project(path: ":node:capsule", configuration: 'runtimeArtifacts') + cordaRuntime project(path: ":webserver:webcapsule", configuration: 'runtimeArtifacts') cordaCompile project(':core') cordaCompile project(':client:jfx') cordaCompile project(':client:rpc') @@ -32,7 +30,9 @@ dependencies { testCompile "junit:junit:$junit_version" } -task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar']) { +def nodeTask = tasks.getByPath(':node:capsule:assemble') +def webTask = tasks.getByPath(':webserver:webcapsule:assemble') +task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar', nodeTask, webTask]) { nodeDefaults { cordapp project(':finance') } @@ -82,18 +82,6 @@ idea { } } -publishing { - publications { - jarAndSources(MavenPublication) { - from components.java - artifactId 'bankofcorda' - - artifact sourceJar - artifact javadocJar - } - } -} - task runRPCCashIssue(type: JavaExec) { classpath = sourceSets.main.runtimeClasspath main = 'net.corda.bank.IssueCash' @@ -123,3 +111,12 @@ jar { ) } } + +cordapp { + info { + name "net/corda/samples/bank-of-corda-demo" + vendor "Corda Open Source" + targetPlatformVersion corda_platform_version.toInteger() + minimumPlatformVersion 1 + } +} diff --git a/samples/cordapp-configuration/build.gradle b/samples/cordapp-configuration/build.gradle index b1f121b9d1..2203482080 100644 --- a/samples/cordapp-configuration/build.gradle +++ b/samples/cordapp-configuration/build.gradle @@ -1,17 +1,20 @@ apply plugin: 'kotlin' -apply plugin: 'java' +apply plugin: 'idea' apply plugin: 'net.corda.plugins.cordapp' apply plugin: 'net.corda.plugins.cordformation' dependencies { - cordaCompile project(":core") - cordaCompile project(":node-api") - cordaRuntime project(path: ":node:capsule", configuration: 'runtimeArtifacts') - cordaRuntime project(path: ":webserver:webcapsule", configuration: 'runtimeArtifacts') + cordaCompile project(':core') + cordaCompile project(':node-api') runtimeOnly "org.apache.logging.log4j:log4j-slf4j-impl:$log4j_version" + + // Corda integration dependencies + cordaRuntime project(path: ":node:capsule", configuration: 'runtimeArtifacts') } -task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar']) { +def nodeTask = tasks.getByPath(':node:capsule:assemble') +def webTask = tasks.getByPath(':webserver:webcapsule:assemble') +task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar', nodeTask, webTask]) { directory file("$buildDir/nodes") nodeDefaults { cordapps = [] @@ -25,7 +28,6 @@ task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar']) { port 10003 adminPort 10004 } - rpcUsers = [] extraConfig = ['h2Settings.address' : 'localhost:10005'] } node { @@ -54,4 +56,13 @@ task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar']) { } extraConfig = ['h2Settings.address' : 'localhost:10013'] } -} \ No newline at end of file +} + +cordapp { + info { + name "net/corda/samples/cordapp-configuration" + vendor "Corda Open Source" + targetPlatformVersion corda_platform_version.toInteger() + minimumPlatformVersion 1 + } +} diff --git a/samples/cordapp-configuration/src/main/kotlin/net/corda/configsample/GetStringConfigFlow.kt b/samples/cordapp-configuration/src/main/kotlin/net/corda/configsample/GetStringConfigFlow.kt index 7fbbaeff77..87cafce820 100644 --- a/samples/cordapp-configuration/src/main/kotlin/net/corda/configsample/GetStringConfigFlow.kt +++ b/samples/cordapp-configuration/src/main/kotlin/net/corda/configsample/GetStringConfigFlow.kt @@ -1,8 +1,14 @@ package net.corda.configsample import co.paralleluniverse.fibers.Suspendable +import net.corda.core.contracts.CommandData +import net.corda.core.contracts.Contract +import net.corda.core.contracts.ContractState import net.corda.core.flows.FlowLogic import net.corda.core.flows.StartableByRPC +import net.corda.core.identity.AbstractParty +import net.corda.core.serialization.CordaSerializable +import net.corda.core.transactions.LedgerTransaction import net.corda.core.utilities.ProgressTracker @StartableByRPC @@ -17,3 +23,22 @@ class GetStringConfigFlow(private val configKey: String) : FlowLogic() { return config.getString(configKey) } } + + + +@CordaSerializable +data class GetStringTestState(val responses: List, val issuer: AbstractParty) : ContractState { + override val participants: List + get() = listOf(issuer) + +} + + +@CordaSerializable +object GetStringTestCommand : CommandData + + +class GetStringTestContract : Contract { + override fun verify(tx: LedgerTransaction) { + } +} \ No newline at end of file diff --git a/samples/irs-demo/build.gradle b/samples/irs-demo/build.gradle index f1fb1ef397..74bb3241a3 100644 --- a/samples/irs-demo/build.gradle +++ b/samples/irs-demo/build.gradle @@ -21,7 +21,6 @@ ext['jackson.version'] = "$jackson_version" ext['dropwizard-metrics.version'] = "$metrics_version" ext['mockito.version'] = "$mockito_version" -apply plugin: 'java' apply plugin: 'kotlin' apply plugin: 'idea' apply plugin: 'org.springframework.boot' diff --git a/samples/irs-demo/cordapp/build.gradle b/samples/irs-demo/cordapp/build.gradle index fba2b8f523..0359cc52d1 100644 --- a/samples/irs-demo/cordapp/build.gradle +++ b/samples/irs-demo/cordapp/build.gradle @@ -1,11 +1,8 @@ -apply plugin: 'java' apply plugin: 'kotlin' apply plugin: 'idea' apply plugin: 'net.corda.plugins.quasar-utils' -apply plugin: 'net.corda.plugins.publish-utils' apply plugin: 'net.corda.plugins.cordformation' apply plugin: 'net.corda.plugins.cordapp' -apply plugin: 'maven-publish' apply plugin: 'application' mainClassName = 'net.corda.irs.IRSDemo' @@ -31,7 +28,7 @@ dependencies { cordapp project(':finance') // Corda integration dependencies - cordaCompile project(path: ":node:capsule", configuration: 'runtimeArtifacts') + cordaRuntime project(path: ":node:capsule", configuration: 'runtimeArtifacts') cordaCompile project(':core') // Cordapp dependencies @@ -57,7 +54,8 @@ def rpcUsersList = [ ]] ] -task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar']) { +def nodeTask = tasks.getByPath(':node:capsule:assemble') +task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar', nodeTask]) { node { name "O=Notary Service,L=Zurich,C=CH" @@ -112,7 +110,7 @@ task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar']) { } -task prepareDockerNodes(type: net.corda.plugins.Dockerform, dependsOn: ['jar']) { +task prepareDockerNodes(type: net.corda.plugins.Dockerform, dependsOn: ['jar', nodeTask]) { node { name "O=Notary Service,L=Zurich,C=CH" @@ -159,15 +157,25 @@ tasks.withType(CreateStartScripts).each { task -> idea { module { - downloadJavadoc = true // defaults to false + downloadJavadoc = true downloadSources = true } } jar { from sourceSets.test.output + duplicatesStrategy = DuplicatesStrategy.EXCLUDE } artifacts { demoArtifacts jar -} \ No newline at end of file +} + +cordapp { + info { + name "net/corda/irs-demo" + vendor "Corda Open Source" + targetPlatformVersion corda_platform_version.toInteger() + minimumPlatformVersion 1 + } +} diff --git a/samples/network-verifier/build.gradle b/samples/network-verifier/build.gradle index 0245d6027f..eea17b8ae2 100644 --- a/samples/network-verifier/build.gradle +++ b/samples/network-verifier/build.gradle @@ -1,18 +1,20 @@ apply plugin: 'kotlin' -apply plugin: 'java' apply plugin: 'net.corda.plugins.cordapp' apply plugin: 'net.corda.plugins.cordformation' dependencies { - cordaCompile project(":core") - cordaCompile project(":node-api") - cordaCompile project(path: ":node:capsule", configuration: 'runtimeArtifacts') + cordaCompile project(':core') + cordaCompile project(':node-api') testCompile project(":test-utils") testCompile "junit:junit:$junit_version" + + // Corda integration dependencies + cordaRuntime project(path: ":node:capsule", configuration: 'runtimeArtifacts') } -task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar']) { +def nodeTask = tasks.getByPath(':node:capsule:assemble') +task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar', nodeTask]) { ext.rpcUsers = [['username': "default", 'password': "default", 'permissions': [ 'ALL' ]]] directory "./build/nodes" @@ -48,4 +50,13 @@ task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar']) { } extraConfig = ['h2Settings.address' : 'localhost:0'] } -} \ No newline at end of file +} + +cordapp { + info { + name "net/corda/samples/network-verifier" + vendor "Corda Open Source" + targetPlatformVersion corda_platform_version.toInteger() + minimumPlatformVersion 1 + } +} diff --git a/samples/notary-demo/build.gradle b/samples/notary-demo/build.gradle index acf513708c..ad7f9110e1 100644 --- a/samples/notary-demo/build.gradle +++ b/samples/notary-demo/build.gradle @@ -16,8 +16,8 @@ dependencies { compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" // Corda integration dependencies - cordaCompile project(path: ":node:capsule", configuration: 'runtimeArtifacts') - cordaCompile project(path: ":webserver:webcapsule", configuration: 'runtimeArtifacts') + cordaRuntime project(path: ":node:capsule", configuration: 'runtimeArtifacts') + cordaRuntime project(path: ":webserver:webcapsule", configuration: 'runtimeArtifacts') cordaCompile project(':core') cordaCompile project(':client:jfx') cordaCompile project(':client:rpc') @@ -28,9 +28,12 @@ dependencies { cordapp project(':experimental:notary-bft-smart') } +def nodeTask = tasks.getByPath(':node:capsule:assemble') +def webTask = tasks.getByPath(':webserver:webcapsule:assemble') + task deployNodes(dependsOn: ['deployNodesSingle', 'deployNodesRaft', 'deployNodesBFT', 'deployNodesCustom']) -task deployNodesSingle(type: Cordform, dependsOn: 'jar') { +task deployNodesSingle(type: Cordform, dependsOn: ['jar', nodeTask, webTask]) { directory file("$buildDir/nodes/nodesSingle") nodeDefaults { extraConfig = [h2Settings: [address: "localhost:0"]] @@ -55,7 +58,7 @@ task deployNodesSingle(type: Cordform, dependsOn: 'jar') { } } -task deployNodesCustom(type: Cordform, dependsOn: 'jar') { +task deployNodesCustom(type: Cordform, dependsOn: ['jar', nodeTask, webTask]) { directory file("$buildDir/nodes/nodesCustom") nodeDefaults { extraConfig = [h2Settings: [address: "localhost:0"]] @@ -83,7 +86,7 @@ task deployNodesCustom(type: Cordform, dependsOn: 'jar') { } } -task deployNodesRaft(type: Cordform, dependsOn: 'jar') { +task deployNodesRaft(type: Cordform, dependsOn: ['jar', nodeTask, webTask]) { def className = "net.corda.notary.raft.RaftNotaryService" directory file("$buildDir/nodes/nodesRaft") nodeDefaults { @@ -151,7 +154,7 @@ task deployNodesRaft(type: Cordform, dependsOn: 'jar') { } } -task deployNodesBFT(type: Cordform, dependsOn: 'jar') { +task deployNodesBFT(type: Cordform, dependsOn: ['jar', nodeTask, webTask]) { def clusterAddresses = ["localhost:11000", "localhost:11010", "localhost:11020", "localhost:11030"] def className = "net.corda.notary.bftsmart.BftSmartNotaryService" directory file("$buildDir/nodes/nodesBFT") @@ -250,3 +253,12 @@ jar { ) } } + +cordapp { + info { + name "net/corda/samples/notary-demo" + vendor "Corda Open Source" + targetPlatformVersion corda_platform_version.toInteger() + minimumPlatformVersion 1 + } +} diff --git a/samples/simm-valuation-demo/build.gradle b/samples/simm-valuation-demo/build.gradle index 8fc1e65c05..27a7b83e1b 100644 --- a/samples/simm-valuation-demo/build.gradle +++ b/samples/simm-valuation-demo/build.gradle @@ -4,7 +4,6 @@ allprojects { } } -apply plugin: 'java' apply plugin: 'kotlin' apply plugin: 'idea' apply plugin: 'net.corda.plugins.quasar-utils' @@ -27,7 +26,7 @@ configurations { } dependencies { - compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" + cordaCompile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" // The SIMM demo CorDapp depends upon Cash CorDapp features cordapp project(':finance') @@ -62,7 +61,9 @@ dependencies { testCompile "org.assertj:assertj-core:$assertj_version" } -task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar']) { +def nodeTask = tasks.getByPath(':node:capsule:assemble') +def webTask = tasks.getByPath(':webserver:webcapsule:assemble') +task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar', nodeTask, webTask]) { directory file("$buildDir/nodes") nodeDefaults { cordapp project(':finance') @@ -70,6 +71,9 @@ task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar']) { cordapp project(':samples:simm-valuation-demo:flows') rpcUsers = [['username': "default", 'password': "default", 'permissions': [ 'ALL' ]]] } + signing { + enabled false + } node { name "O=Notary Service,L=Zurich,C=CH" notary = [validating : true] @@ -137,3 +141,10 @@ task integrationTest(type: Test, dependsOn: []) { testClassesDirs = sourceSets.integrationTest.output.classesDirs classpath = sourceSets.integrationTest.runtimeClasspath } + +cordapp { + info { + vendor = 'R3' + targetPlatformVersion = corda_platform_version.toInteger() + } +} diff --git a/samples/simm-valuation-demo/contracts-states/build.gradle b/samples/simm-valuation-demo/contracts-states/build.gradle index 146966bbee..2849ad30ff 100644 --- a/samples/simm-valuation-demo/contracts-states/build.gradle +++ b/samples/simm-valuation-demo/contracts-states/build.gradle @@ -6,6 +6,12 @@ def shrinkJar = file("$buildDir/libs/${project.name}-${project.version}-tiny.jar cordapp { info { vendor = 'R3' + targetPlatformVersion = corda_platform_version.toInteger() + } + signing { + // We need to sign the output of the "shrink" task, + // but the jar signer doesn't support that yet. + enabled false } } diff --git a/samples/simm-valuation-demo/flows/build.gradle b/samples/simm-valuation-demo/flows/build.gradle index fd3b512fab..4520f321dd 100644 --- a/samples/simm-valuation-demo/flows/build.gradle +++ b/samples/simm-valuation-demo/flows/build.gradle @@ -4,6 +4,10 @@ apply plugin: 'net.corda.plugins.cordapp' cordapp { info { vendor = 'R3' + targetPlatformVersion = corda_platform_version.toInteger() + } + signing { + enabled false } } diff --git a/samples/trader-demo/build.gradle b/samples/trader-demo/build.gradle index afd027fdbc..f8ffd4edf3 100644 --- a/samples/trader-demo/build.gradle +++ b/samples/trader-demo/build.gradle @@ -1,11 +1,8 @@ -apply plugin: 'java' apply plugin: 'kotlin' apply plugin: 'idea' apply plugin: 'net.corda.plugins.quasar-utils' -apply plugin: 'net.corda.plugins.publish-utils' apply plugin: 'net.corda.plugins.cordapp' apply plugin: 'net.corda.plugins.cordformation' -apply plugin: 'maven-publish' sourceSets { integrationTest { @@ -29,8 +26,8 @@ dependencies { cordapp project(':finance') // Corda integration dependencies - cordaCompile project(path: ":node:capsule", configuration: 'runtimeArtifacts') - cordaCompile project(path: ":webserver:webcapsule", configuration: 'runtimeArtifacts') + cordaRuntime project(path: ":node:capsule", configuration: 'runtimeArtifacts') + cordaRuntime project(path: ":webserver:webcapsule", configuration: 'runtimeArtifacts') cordaCompile project(':core') // Corda Plugins: dependent flows and services @@ -41,7 +38,9 @@ dependencies { testCompile "org.assertj:assertj-core:${assertj_version}" } -task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar']) { +def nodeTask = tasks.getByPath(':node:capsule:assemble') +def webTask = tasks.getByPath(':webserver:webcapsule:assemble') +task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar', nodeTask, webTask]) { ext.rpcUsers = [['username': "demo", 'password': "demo", 'permissions': ["ALL"]]] directory "./build/nodes" @@ -104,18 +103,6 @@ idea { } } -publishing { - publications { - jarAndSources(MavenPublication) { - from components.java - artifactId 'traderdemo' - - artifact sourceJar - artifact javadocJar - } - } -} - task runBank(type: JavaExec) { classpath = sourceSets.main.runtimeClasspath main = 'net.corda.traderdemo.TraderDemoKt' @@ -136,4 +123,13 @@ jar { 'Automatic-Module-Name': 'net.corda.samples.demos.trader' ) } -} \ No newline at end of file +} + +cordapp { + info { + name "net/corda/samples/trader-demo" + vendor "Corda Open Source" + targetPlatformVersion corda_platform_version.toInteger() + minimumPlatformVersion 1 + } +}