CORDA-2510 - Added missing confidential-identities CorDapp to DemoBench (#4636) (#4646)

This commit is contained in:
Katelyn Baker 2019-01-27 15:41:46 +00:00 committed by GitHub
parent dd002ee38a
commit f733f963d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 3 deletions

View File

@ -137,6 +137,11 @@ distributions {
into 'cordapps'
fileMode = 0444
}
from(project(':confidential-identities').tasks.jar) {
rename 'corda-confidential-identities(.*)', 'corda-confidential-identities.jar'
into 'cordapps'
fileMode = 0444
}
}
}
}

View File

@ -11,6 +11,7 @@ import java.nio.file.Path
import java.nio.file.StandardCopyOption
import kotlin.streams.toList
// TODO This class needs to be revisted. It seems to operate on outdated concepts.
class CordappController : Controller() {
companion object {
const val FINANCE_CONTRACTS_CORDAPP_FILENAME = "corda-finance-contracts"
@ -19,7 +20,11 @@ class CordappController : Controller() {
private val jvm by inject<JVMConfig>()
private val cordappDir: Path = jvm.applicationDir / NodeConfig.CORDAPP_DIR_NAME
private val financeCordappJars = setOf(cordappDir / "$FINANCE_CONTRACTS_CORDAPP_FILENAME.jar", cordappDir / "$FINANCE_WORKFLOWS_CORDAPP_FILENAME.jar")
private val cordappJars = setOf(
cordappDir / "$FINANCE_CONTRACTS_CORDAPP_FILENAME.jar",
cordappDir / "$FINANCE_WORKFLOWS_CORDAPP_FILENAME.jar",
cordappDir / "corda-confidential-identities.jar"
)
/**
* Install any built-in cordapps that this node requires.
@ -29,7 +34,7 @@ class CordappController : Controller() {
if (!config.cordappsDir.exists()) {
config.cordappsDir.createDirectories()
}
financeCordappJars.forEach {financeCordappJar ->
cordappJars.forEach { financeCordappJar ->
if (financeCordappJar.exists()) {
financeCordappJar.copyToDirectory(config.cordappsDir, StandardCopyOption.REPLACE_EXISTING)
log.info("Installed 'Finance' cordapp: $financeCordappJar")
@ -45,7 +50,7 @@ class CordappController : Controller() {
if (!config.cordappsDir.isDirectory()) return emptyList()
return config.cordappsDir.walk(1) { paths ->
paths.filter(Path::isCordapp)
.filter { financeCordappJars.any { !it.endsWith(it.fileName) } }
.filter { cordappJars.any { !it.endsWith(it.fileName) } }
.toList()
}
}