diff --git a/node/build.gradle b/node/build.gradle index 99eb8f5e23..506d71a0dc 100644 --- a/node/build.gradle +++ b/node/build.gradle @@ -96,9 +96,6 @@ dependencies { // For async logging compile "com.lmax:disruptor:$disruptor_version" - // JOpt: for command line flags. - compile "net.sf.jopt-simple:jopt-simple:$jopt_simple_version" - // Artemis: for reliable p2p message queues. // TODO: remove the forced update of commons-collections and beanutils when artemis updates them compile "org.apache.commons:commons-collections4:${commons_collections_version}" diff --git a/node/src/main/kotlin/net/corda/node/utilities/AbstractArgsParser.kt b/node/src/main/kotlin/net/corda/node/utilities/AbstractArgsParser.kt deleted file mode 100644 index eeba175842..0000000000 --- a/node/src/main/kotlin/net/corda/node/utilities/AbstractArgsParser.kt +++ /dev/null @@ -1,39 +0,0 @@ -package net.corda.node.utilities - -import joptsimple.OptionException -import joptsimple.OptionParser -import joptsimple.OptionSet -import kotlin.system.exitProcess - -abstract class AbstractArgsParser { - protected val optionParser = OptionParser() - private val helpOption = optionParser.acceptsAll(listOf("h", "help"), "show help").forHelp() - - /** - * Parses the given [args] or exits the process if unable to, printing the help output to stderr. - * If the help option is specified then the process is also shutdown after printing the help output to stdout. - */ - fun parseOrExit(vararg args: String): T { - try { - val optionSet = optionParser.parse(*args) - if (optionSet.has(helpOption)) { - optionParser.printHelpOn(System.out) - exitProcess(0) - } - return doParse(optionSet) - } catch (e: Exception) { - when (e) { - is OptionException, is IllegalArgumentException -> { - System.err.println(e.message ?: "Unable to parse arguments.") - optionParser.printHelpOn(System.err) - exitProcess(1) - } - else -> throw e - } - } - } - - fun parse(vararg args: String): T = doParse(optionParser.parse(*args)) - - protected abstract fun doParse(optionSet: OptionSet): T -} \ No newline at end of file diff --git a/samples/irs-demo/web/build.gradle b/samples/irs-demo/web/build.gradle index 9f92026c58..d79abbbc92 100644 --- a/samples/irs-demo/web/build.gradle +++ b/samples/irs-demo/web/build.gradle @@ -71,6 +71,10 @@ dependencies { compile project(":client:jackson") compile project(":test-utils") compile project(path: ":samples:irs-demo:cordapp", configuration: "demoArtifacts") + + // JOpt: for command line flags. + compile "net.sf.jopt-simple:jopt-simple:$jopt_simple_version" + testCompile('org.springframework.boot:spring-boot-starter-test') { exclude module: "spring-boot-starter-logging" exclude module: "logback-classic" diff --git a/tools/explorer/build.gradle b/tools/explorer/build.gradle index e16e786058..d489eac55e 100644 --- a/tools/explorer/build.gradle +++ b/tools/explorer/build.gradle @@ -48,6 +48,9 @@ dependencies { compile 'org.controlsfx:controlsfx:8.40.12' // This provide com.apple.eawt stub for non-mac system. compile 'com.yuvimasory:orange-extensions:1.3.0' + + // JOpt: for command line flags. + compile "net.sf.jopt-simple:jopt-simple:$jopt_simple_version" } tasks.withType(JavaCompile) { diff --git a/tools/explorer/src/main/kotlin/net/corda/explorer/Main.kt b/tools/explorer/src/main/kotlin/net/corda/explorer/Main.kt index 98503fa1d4..9fbc3199fc 100644 --- a/tools/explorer/src/main/kotlin/net/corda/explorer/Main.kt +++ b/tools/explorer/src/main/kotlin/net/corda/explorer/Main.kt @@ -124,10 +124,10 @@ class Main : App(MainView::class) { } /** - * This main method will starts 5 nodes (Notary, USA Bank, UK Bank, Bob and Alice) locally for UI testing, - * they will be on localhost ports 20005, 20008, 20011, 20014 and 20017 respectively. + * This main method will start 5 nodes (Notary, USA Bank, UK Bank, Bob and Alice) locally for UI testing, + * which will bind to ports 20005, 20008, 20011, 20014 and 20017 locally. * - * The simulation start with pre-allocating chunks of cash to each of the party in 2 currencies (USD, GBP), then it enter a loop to generate random events. + * The simulation starts by pre-allocating chunks of cash to each of the parties in 2 currencies (USD, GBP), then it enters a loop which generates random events. * On each iteration, the issuers will execute a Cash Issue or Cash Exit flow (at a 9:1 ratio) and a random party will execute a move of cash to another random party. */ fun main(args: Array) { diff --git a/tools/shell/build.gradle b/tools/shell/build.gradle index 13338150fc..1887bdb5fe 100644 --- a/tools/shell/build.gradle +++ b/tools/shell/build.gradle @@ -39,10 +39,6 @@ dependencies { // Jackson support: serialisation to/from JSON, YAML, etc. compile project(':client:jackson') - - // JOpt: for command line flags. - compile "net.sf.jopt-simple:jopt-simple:$jopt_simple_version" - // CRaSH: An embeddable monitoring and admin shell with support for adding new commands written in Groovy. compile("com.github.corda.crash:crash.shell:$crash_version") { exclude group: "org.slf4j", module: "slf4j-jdk14"