diff --git a/gradle-plugins/cordform-common/src/main/kotlin/net/corda/cordform/CordappDependency.kt b/gradle-plugins/cordform-common/src/main/kotlin/net/corda/cordform/CordappDependency.kt deleted file mode 100644 index f677e2278c..0000000000 --- a/gradle-plugins/cordform-common/src/main/kotlin/net/corda/cordform/CordappDependency.kt +++ /dev/null @@ -1,10 +0,0 @@ -package net.corda.cordform - -data class CordappDependency( - val mavenCoordinates: String? = null, - val projectName: String? = null -) { - init { - require((mavenCoordinates != null) != (projectName != null), { "Only one of maven coordinates or project name must be set" }) - } -} \ No newline at end of file diff --git a/gradle-plugins/cordformation/src/main/kotlin/net/corda/plugins/Cordapp.kt b/gradle-plugins/cordformation/src/main/kotlin/net/corda/plugins/Cordapp.kt deleted file mode 100644 index a4cba09969..0000000000 --- a/gradle-plugins/cordformation/src/main/kotlin/net/corda/plugins/Cordapp.kt +++ /dev/null @@ -1,26 +0,0 @@ -package net.corda.plugins - -import org.gradle.api.Project -import java.io.File - -open class Cordapp private constructor(val coordinates: String?, val project: Project?) { - constructor(coordinates: String) : this(coordinates, null) - constructor(cordappProject: Project) : this(null, cordappProject) - - // The configuration text that will be written - internal var config: String? = null - - /** - * Set the configuration text that will be written to the cordapp's configuration file - */ - fun config(config: String) { - this.config = config - } - - /** - * Reads config from the file and later writes it to the cordapp's configuration file - */ - fun config(configFile: File) { - this.config = configFile.readText() - } -} \ No newline at end of file diff --git a/gradle-plugins/cordformation/src/test/kotlin/net/corda/plugins/CordformTest.kt b/gradle-plugins/cordformation/src/test/kotlin/net/corda/plugins/CordformTest.kt deleted file mode 100644 index 3f934191be..0000000000 --- a/gradle-plugins/cordformation/src/test/kotlin/net/corda/plugins/CordformTest.kt +++ /dev/null @@ -1,77 +0,0 @@ -package net.corda.plugins - -import org.apache.commons.io.FileUtils -import org.apache.commons.io.IOUtils -import org.assertj.core.api.Assertions.* -import org.junit.Before -import org.junit.Rule -import org.junit.Test -import org.junit.rules.TemporaryFolder -import java.io.File -import java.io.IOException -import java.nio.charset.StandardCharsets -import java.nio.file.Files -import org.gradle.testkit.runner.GradleRunner -import org.gradle.testkit.runner.TaskOutcome - -class CordformTest { - @Rule - @JvmField - val testProjectDir = TemporaryFolder() - private var buildFile: File? = null - - private companion object { - val cordaFinanceJarName = "corda-finance-3.0-SNAPSHOT" - val localCordappJarName = "locally-built-cordapp" - val notaryNodeName = "Notary Service" - } - - @Before - fun setup() { - buildFile = testProjectDir.newFile("build.gradle") - } - - @Test - fun `a node with cordapp dependency`() { - val runner = getStandardGradleRunnerFor("DeploySingleNodeWithCordapp.gradle") - - val result = runner.build() - - assertThat(result.task(":deployNodes")!!.outcome).isEqualTo(TaskOutcome.SUCCESS) - assertThat(getNodeCordappJar(notaryNodeName, cordaFinanceJarName)).exists() - } - - @Test - fun `deploy a node with cordapp config`() { - val runner = getStandardGradleRunnerFor("DeploySingleNodeWithCordappConfig.gradle") - - val result = runner.build() - - assertThat(result.task(":deployNodes")!!.outcome).isEqualTo(TaskOutcome.SUCCESS) - assertThat(getNodeCordappJar(notaryNodeName, cordaFinanceJarName)).exists() - assertThat(getNodeCordappConfig(notaryNodeName, cordaFinanceJarName)).exists() - } - - @Test - fun `deploy the locally built cordapp with cordapp config`() { - val runner = getStandardGradleRunnerFor("DeploySingleNodeWithLocallyBuildCordappAndConfig.gradle") - - val result = runner.build() - - assertThat(result.task(":deployNodes")!!.outcome).isEqualTo(TaskOutcome.SUCCESS) - assertThat(getNodeCordappJar(notaryNodeName, localCordappJarName)).exists() - assertThat(getNodeCordappConfig(notaryNodeName, localCordappJarName)).exists() - } - - private fun getStandardGradleRunnerFor(buildFileResourceName: String): GradleRunner { - createBuildFile(buildFileResourceName) - return GradleRunner.create() - .withProjectDir(testProjectDir.root) - .withArguments("deployNodes", "-s") - .withPluginClasspath() - } - - private fun createBuildFile(buildFileResourceName: String) = IOUtils.copy(javaClass.getResourceAsStream(buildFileResourceName), buildFile!!.outputStream()) - private fun getNodeCordappJar(nodeName: String, cordappJarName: String) = File(testProjectDir.root, "build/nodes/$nodeName/cordapps/$cordappJarName.jar") - private fun getNodeCordappConfig(nodeName: String, cordappJarName: String) = File(testProjectDir.root, "build/nodes/$nodeName/cordapps/$cordappJarName.conf") -} \ No newline at end of file diff --git a/gradle-plugins/cordformation/src/test/resources/net/corda/plugins/DeploySingleNodeWithCordapp.gradle b/gradle-plugins/cordformation/src/test/resources/net/corda/plugins/DeploySingleNodeWithCordapp.gradle deleted file mode 100644 index 10eca84d66..0000000000 --- a/gradle-plugins/cordformation/src/test/resources/net/corda/plugins/DeploySingleNodeWithCordapp.gradle +++ /dev/null @@ -1,33 +0,0 @@ -buildscript { - ext { - corda_group = 'net.corda' - corda_release_version = '3.0-SNAPSHOT' // TODO: Set to 3.0.0 when Corda 3 is released - jolokia_version = '1.3.7' - } -} - -plugins { - id 'java' - id 'net.corda.plugins.cordformation' -} - -repositories { - mavenCentral() - maven { url 'https://ci-artifactory.corda.r3cev.com/artifactory/corda-dev' } -} - -dependencies { - runtime "$corda_group:corda:$corda_release_version" - runtime "$corda_group:corda-node-api:$corda_release_version" - cordapp "$corda_group:corda-finance:$corda_release_version" -} - -task deployNodes(type: net.corda.plugins.Cordform) { - node { - name 'O=Notary Service,L=Zurich,C=CH' - notary = [validating : true] - p2pPort 10002 - rpcPort 10003 - cordapps = ["$corda_group:corda-finance:$corda_release_version"] - } -} \ No newline at end of file diff --git a/gradle-plugins/cordformation/src/test/resources/net/corda/plugins/DeploySingleNodeWithCordappConfig.gradle b/gradle-plugins/cordformation/src/test/resources/net/corda/plugins/DeploySingleNodeWithCordappConfig.gradle deleted file mode 100644 index 4bb6642752..0000000000 --- a/gradle-plugins/cordformation/src/test/resources/net/corda/plugins/DeploySingleNodeWithCordappConfig.gradle +++ /dev/null @@ -1,35 +0,0 @@ -buildscript { - ext { - corda_group = 'net.corda' - corda_release_version = '3.0-SNAPSHOT' // TODO: Set to 3.0.0 when Corda 3 is released - jolokia_version = '1.3.7' - } -} - -plugins { - id 'java' - id 'net.corda.plugins.cordformation' -} - -repositories { - mavenCentral() - maven { url 'https://ci-artifactory.corda.r3cev.com/artifactory/corda-dev' } -} - -dependencies { - runtime "$corda_group:corda:$corda_release_version" - runtime "$corda_group:corda-node-api:$corda_release_version" - cordapp "$corda_group:corda-finance:$corda_release_version" -} - -task deployNodes(type: net.corda.plugins.Cordform) { - node { - name 'O=Notary Service,L=Zurich,C=CH' - notary = [validating : true] - p2pPort 10002 - rpcPort 10003 - cordapp "$corda_group:corda-finance:$corda_release_version", { - config "a=b" - } - } -} \ No newline at end of file diff --git a/gradle-plugins/cordformation/src/test/resources/net/corda/plugins/DeploySingleNodeWithLocallyBuildCordappAndConfig.gradle b/gradle-plugins/cordformation/src/test/resources/net/corda/plugins/DeploySingleNodeWithLocallyBuildCordappAndConfig.gradle deleted file mode 100644 index 6e0447764f..0000000000 --- a/gradle-plugins/cordformation/src/test/resources/net/corda/plugins/DeploySingleNodeWithLocallyBuildCordappAndConfig.gradle +++ /dev/null @@ -1,39 +0,0 @@ -buildscript { - ext { - corda_group = 'net.corda' - corda_release_version = '3.0-SNAPSHOT' // TODO: Set to 3.0.0 when Corda 3 is released - jolokia_version = '1.3.7' - } -} - -plugins { - id 'java' - id 'net.corda.plugins.cordformation' -} - -repositories { - mavenCentral() - maven { url 'https://ci-artifactory.corda.r3cev.com/artifactory/corda-dev' } -} - -dependencies { - runtime "$corda_group:corda:$corda_release_version" - runtime "$corda_group:corda-node-api:$corda_release_version" - cordapp "$corda_group:corda-finance:$corda_release_version" -} - -jar { - baseName 'locally-built-cordapp' -} - -task deployNodes(type: net.corda.plugins.Cordform, dependsOn: [jar]) { - node { - name 'O=Notary Service,L=Zurich,C=CH' - notary = [validating : true] - p2pPort 10002 - rpcPort 10003 - cordapp { - config "a=b" - } - } -} \ No newline at end of file