ENT-1741 Build standalone shell JAR distribution (#3409)

This commit is contained in:
szymonsztuka 2018-06-21 10:32:36 +01:00 committed by Michele Sollecito
parent 2f34b16b07
commit 3af5412d40
8 changed files with 138 additions and 11 deletions

View File

@ -351,6 +351,7 @@ bintrayConfig {
'corda-node-driver',
'corda-confidential-identities',
'corda-shell',
'corda-shell-cli',
'corda-serialization',
'corda-serialization-deterministic',
'corda-tools-blob-inspector',

View File

@ -43,6 +43,7 @@ include 'tools:graphs'
include 'tools:bootstrapper'
include 'tools:blobinspector'
include 'tools:shell'
include 'tools:shell-cli'
include 'tools:network-bootstrapper'
include 'example-code'
project(':example-code').projectDir = file("$settingsDir/docs/source/example-code")

View 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)

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

View File

@ -1,6 +1,5 @@
apply plugin: 'kotlin'
apply plugin: 'java'
apply plugin: 'application'
apply plugin: 'net.corda.plugins.quasar-utils'
apply plugin: 'net.corda.plugins.publish-utils'
apply plugin: 'com.jfrog.artifactory'
@ -80,21 +79,15 @@ dependencies {
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) {
testClassesDirs = sourceSets.integrationTest.output.classesDirs
classpath = sourceSets.integrationTest.runtimeClasspath
}
jar {
baseName 'corda-shell'
}
publish {
name jar.baseName
}