Removed remaining gradle plugins

This commit is contained in:
Clinton Alexander 2018-02-14 17:58:14 +00:00
parent 1cd028ebbe
commit d25ab7d897
6 changed files with 0 additions and 220 deletions

View File

@ -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" })
}
}

View File

@ -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()
}
}

View File

@ -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")
}

View File

@ -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"]
}
}

View File

@ -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"
}
}
}

View File

@ -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"
}
}
}