mirror of
https://github.com/corda/corda.git
synced 2025-06-19 07:38:22 +00:00
ENT-1741 Build standalone shell JAR distribution (#3409)
This commit is contained in:
committed by
Michele Sollecito
parent
2f34b16b07
commit
3af5412d40
@ -351,6 +351,7 @@ bintrayConfig {
|
|||||||
'corda-node-driver',
|
'corda-node-driver',
|
||||||
'corda-confidential-identities',
|
'corda-confidential-identities',
|
||||||
'corda-shell',
|
'corda-shell',
|
||||||
|
'corda-shell-cli',
|
||||||
'corda-serialization',
|
'corda-serialization',
|
||||||
'corda-serialization-deterministic',
|
'corda-serialization-deterministic',
|
||||||
'corda-tools-blob-inspector',
|
'corda-tools-blob-inspector',
|
||||||
|
@ -43,6 +43,7 @@ include 'tools:graphs'
|
|||||||
include 'tools:bootstrapper'
|
include 'tools:bootstrapper'
|
||||||
include 'tools:blobinspector'
|
include 'tools:blobinspector'
|
||||||
include 'tools:shell'
|
include 'tools:shell'
|
||||||
|
include 'tools:shell-cli'
|
||||||
include 'tools:network-bootstrapper'
|
include 'tools:network-bootstrapper'
|
||||||
include 'example-code'
|
include 'example-code'
|
||||||
project(':example-code').projectDir = file("$settingsDir/docs/source/example-code")
|
project(':example-code').projectDir = file("$settingsDir/docs/source/example-code")
|
||||||
|
103
tools/shell-cli/build.gradle
Normal file
103
tools/shell-cli/build.gradle
Normal file
@ -0,0 +1,103 @@
|
|||||||
|
buildscript {
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenLocal()
|
||||||
|
mavenCentral()
|
||||||
|
jcenter()
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
classpath "org.jetbrains.kotlin:kotlin-noarg:$kotlin_version"
|
||||||
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
|
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.1'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenLocal()
|
||||||
|
mavenCentral()
|
||||||
|
jcenter()
|
||||||
|
}
|
||||||
|
|
||||||
|
apply plugin: 'kotlin'
|
||||||
|
apply plugin: 'java'
|
||||||
|
apply plugin: 'application'
|
||||||
|
apply plugin: 'net.corda.plugins.publish-utils'
|
||||||
|
apply plugin: 'com.jfrog.artifactory'
|
||||||
|
apply plugin: 'com.github.johnrengelman.shadow'
|
||||||
|
apply plugin: 'maven-publish'
|
||||||
|
|
||||||
|
description 'Corda Shell CLI'
|
||||||
|
|
||||||
|
configurations {
|
||||||
|
integrationTestCompile.extendsFrom testCompile
|
||||||
|
integrationTestRuntime.extendsFrom testRuntime
|
||||||
|
}
|
||||||
|
|
||||||
|
sourceSets {
|
||||||
|
integrationTest {
|
||||||
|
kotlin {
|
||||||
|
compileClasspath += main.output + test.output
|
||||||
|
runtimeClasspath += main.output + test.output
|
||||||
|
srcDir file('src/integration-test/kotlin')
|
||||||
|
}
|
||||||
|
resources {
|
||||||
|
srcDir file('src/integration-test/resources')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
test {
|
||||||
|
resources {
|
||||||
|
srcDir file('src/test/resources')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
||||||
|
testCompile "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
|
||||||
|
|
||||||
|
compile project(':tools:shell')
|
||||||
|
|
||||||
|
// Unit testing helpers.
|
||||||
|
testCompile "junit:junit:$junit_version"
|
||||||
|
testCompile "org.assertj:assertj-core:${assertj_version}"
|
||||||
|
testCompile project(':test-utils')
|
||||||
|
testCompile project(':finance')
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
mainClassName = 'net.corda.tools.shell.StandaloneShellKt'
|
||||||
|
|
||||||
|
jar {
|
||||||
|
baseName 'corda-shell-cli'
|
||||||
|
}
|
||||||
|
|
||||||
|
processResources {
|
||||||
|
from file("$rootDir/config/dev/log4j2.xml")
|
||||||
|
}
|
||||||
|
|
||||||
|
task integrationTest(type: Test) {
|
||||||
|
testClassesDirs = sourceSets.integrationTest.output.classesDirs
|
||||||
|
classpath = sourceSets.integrationTest.runtimeClasspath
|
||||||
|
}
|
||||||
|
|
||||||
|
publishing {
|
||||||
|
publications {
|
||||||
|
shadow(MavenPublication) { publication ->
|
||||||
|
project.shadow.component(publication)
|
||||||
|
artifactId = "corda-tools-shell-cli"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
shadowJar {
|
||||||
|
//transform(de.sebastianboegl.gradle.plugins.shadow.transformers.Log4j2PluginsFileTransformer)
|
||||||
|
archiveName = "corda-shell-cli-${version}.jar"
|
||||||
|
|
||||||
|
baseName = 'corda-shell-cli'
|
||||||
|
classifier = null
|
||||||
|
mainClassName = 'net.corda.tools.shell.StandaloneShellKt'
|
||||||
|
mergeServiceFiles()
|
||||||
|
}
|
||||||
|
|
||||||
|
task buildShellCli(dependsOn: shadowJar)
|
29
tools/shell-cli/src/test/resources/config.conf
Normal file
29
tools/shell-cli/src/test/resources/config.conf
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
node {
|
||||||
|
addresses {
|
||||||
|
rpc {
|
||||||
|
host : "alocalhost"
|
||||||
|
port : 1234
|
||||||
|
}
|
||||||
|
}
|
||||||
|
user : demo
|
||||||
|
password : abcd1234
|
||||||
|
}
|
||||||
|
extensions {
|
||||||
|
cordapps {
|
||||||
|
path : "/x/y/cordapps"
|
||||||
|
}
|
||||||
|
sshd {
|
||||||
|
enabled : "true"
|
||||||
|
port : 2223
|
||||||
|
}
|
||||||
|
commands {
|
||||||
|
path : /x/y/commands
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ssl {
|
||||||
|
truststore {
|
||||||
|
path : "/x/y/truststore.jks"
|
||||||
|
type : "JKS"
|
||||||
|
password : "pass2"
|
||||||
|
}
|
||||||
|
}
|
@ -1,6 +1,5 @@
|
|||||||
apply plugin: 'kotlin'
|
apply plugin: 'kotlin'
|
||||||
apply plugin: 'java'
|
apply plugin: 'java'
|
||||||
apply plugin: 'application'
|
|
||||||
apply plugin: 'net.corda.plugins.quasar-utils'
|
apply plugin: 'net.corda.plugins.quasar-utils'
|
||||||
apply plugin: 'net.corda.plugins.publish-utils'
|
apply plugin: 'net.corda.plugins.publish-utils'
|
||||||
apply plugin: 'com.jfrog.artifactory'
|
apply plugin: 'com.jfrog.artifactory'
|
||||||
@ -80,21 +79,15 @@ dependencies {
|
|||||||
integrationTestCompile project(':node-driver')
|
integrationTestCompile project(':node-driver')
|
||||||
}
|
}
|
||||||
|
|
||||||
mainClassName = 'net.corda.tools.shell.StandaloneShellKt'
|
|
||||||
|
|
||||||
jar {
|
|
||||||
baseName 'corda-shell'
|
|
||||||
}
|
|
||||||
|
|
||||||
processResources {
|
|
||||||
from file("$rootDir/config/dev/log4j2.xml")
|
|
||||||
}
|
|
||||||
|
|
||||||
task integrationTest(type: Test) {
|
task integrationTest(type: Test) {
|
||||||
testClassesDirs = sourceSets.integrationTest.output.classesDirs
|
testClassesDirs = sourceSets.integrationTest.output.classesDirs
|
||||||
classpath = sourceSets.integrationTest.runtimeClasspath
|
classpath = sourceSets.integrationTest.runtimeClasspath
|
||||||
}
|
}
|
||||||
|
|
||||||
|
jar {
|
||||||
|
baseName 'corda-shell'
|
||||||
|
}
|
||||||
|
|
||||||
publish {
|
publish {
|
||||||
name jar.baseName
|
name jar.baseName
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user