CORDA-1685: Remove bank-of-corda.jar from DemoBench. (#3446)

This commit is contained in:
Chris Rankin 2018-06-26 22:53:22 +01:00 committed by GitHub
parent be1aff20a6
commit 8ecf3b5e49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 20 deletions

View File

@ -127,11 +127,6 @@ distributions {
into 'cordapps'
fileMode = 0444
}
from(project(':samples:bank-of-corda-demo').jar) {
rename 'bank-of-corda-demo-(.*)', 'bank-of-corda.jar'
into 'cordapps'
fileMode = 0444
}
}
}
}

View File

@ -15,7 +15,6 @@ class CordappController : Controller() {
private val jvm by inject<JVMConfig>()
private val cordappDir: Path = jvm.applicationDir.resolve(NodeConfig.cordappDirName)
private val bankOfCorda: Path = cordappDir.resolve("bank-of-corda.jar")
private val finance: Path = cordappDir.resolve("corda-finance.jar")
/**
@ -30,11 +29,6 @@ class CordappController : Controller() {
finance.copyToDirectory(config.cordappsDir, StandardCopyOption.REPLACE_EXISTING)
log.info("Installed 'Finance' cordapp")
}
// Nodes cannot issue cash unless they contain the "Bank of Corda" cordapp.
if (config.nodeConfig.issuableCurrencies.isNotEmpty() && bankOfCorda.exists()) {
bankOfCorda.copyToDirectory(config.cordappsDir, StandardCopyOption.REPLACE_EXISTING)
log.info("Installed 'Bank of Corda' cordapp")
}
}
/**
@ -44,14 +38,12 @@ class CordappController : Controller() {
fun useCordappsFor(config: HasCordapps): List<Path> {
if (!config.cordappsDir.isDirectory()) return emptyList()
return config.cordappsDir.walk(1) { paths ->
paths
.filter(Path::isCordapp)
.filter { !bankOfCorda.endsWith(it.fileName) }
.filter { !finance.endsWith(it.fileName) }
.toList()
paths.filter(Path::isCordapp)
.filter { !finance.endsWith(it.fileName) }
.toList()
}
}
}
fun Path.isCordapp(): Boolean = this.isReadable && this.fileName.toString().endsWith(".jar")
fun Path.inCordappsDir(): Boolean = (this.parent != null) && this.parent.endsWith("cordapps/")
val Path.isCordapp: Boolean get() = this.isReadable && this.fileName.toString().endsWith(".jar")
val Path.inCordappsDir: Boolean get() = (this.parent != null) && this.parent.endsWith("cordapps/")

View File

@ -115,7 +115,7 @@ class ProfileController : Controller() {
// Now extract all of the plugins from the ZIP file,
// and copy them to a temporary location.
StreamSupport.stream(fs.rootDirectories.spliterator(), false)
.flatMap { Files.find(it, 3, BiPredicate { p, attr -> p.inCordappsDir() && p.isCordapp() && attr.isRegularFile }) }
.flatMap { Files.find(it, 3, BiPredicate { p, attr -> p.inCordappsDir && p.isCordapp && attr.isRegularFile }) }
.forEach { cordapp ->
val config = nodeIndex[cordapp.getName(0).toString()] ?: return@forEach

View File

@ -52,7 +52,7 @@ task buildExplorerJAR(type: FatCapsule, dependsOn: project(':tools:explorer').co
}
}
build.dependsOn buildExplorerJAR
assemble.dependsOn buildExplorerJAR
artifacts {
runtimeArtifacts buildExplorerJAR