ENT-1741 Build standalone shell JAR distribution - fix (#3474)

This commit is contained in:
szymonsztuka 2018-06-29 10:32:37 +01:00 committed by Michele Sollecito
parent 62cb443892
commit 0a700fd3f0
4 changed files with 48 additions and 83 deletions

View File

@ -53,6 +53,7 @@ buildscript {
ext.crash_version = 'cadb53544fbb3c0fb901445da614998a6a419488'
ext.jsr305_version = constants.getProperty("jsr305Version")
ext.shiro_version = '1.4.0'
ext.shadow_version = '2.0.2'
ext.artifactory_plugin_version = constants.getProperty('artifactoryPluginVersion')
ext.artifactory_contextUrl = 'https://ci-artifactory.corda.r3cev.com/artifactory'
ext.snake_yaml_version = constants.getProperty('snakeYamlVersion')
@ -341,7 +342,7 @@ bintrayConfig {
'corda-node-driver',
'corda-confidential-identities',
'corda-shell',
'corda-shell-cli',
'corda-tools-shell-cli',
'corda-serialization',
'corda-serialization-deterministic',
'corda-tools-blob-inspector',

View File

@ -106,7 +106,7 @@ Linux and MacOS
.. code:: bash
./shell [--config-file PATH | --cordpass-directory PATH --commands-directory PATH --host HOST --port PORT
java -jar corda-tools-shell-cli-VERSION_NUMBER.jar [--config-file PATH | --cordpass-directory PATH --commands-directory PATH --host HOST --port PORT
--user USER --password PASSWORD --sshd-port PORT --sshd-hostkey-directory PATH --keystore-password PASSWORD
--keystore-file FILE --truststore-password PASSWORD --truststore-file FILE | --help]
@ -115,7 +115,7 @@ Windows
.. code:: bash
shell.bat [--config-file PATH | --cordpass-directory PATH --commands-directory PATH --host HOST --port PORT
java -jar corda-tools-shell-cli-VERSION_NUMBER.jar [--config-file PATH | --cordpass-directory PATH --commands-directory PATH --host HOST --port PORT
--user USER --password PASSWORD --sshd-port PORT --sshd-hostkey-directory PATH --keystore-password PASSWORD
--keystore-file FILE --truststore-password PASSWORD --truststore-file FILE | --help]

12
tools/shell-cli/README.md Normal file
View File

@ -0,0 +1,12 @@
Standalone Shell
----------------
Documentation for shell CLI can be found [here](http://docs.corda.net/website/releases/docs_head/shell.html)
To build this from the command line on Unix or MacOS:
Run ``./gradlew tools:shell-cli:buildShellCli`` to create a fat JAR in ``tools/shell-cli/build/``
To build this from the command line on Windows:
Run ``gradlew tools:shell-cli:buildShellCli`` to create a fat JAR in ``tools/shell-cli/build/``

View File

@ -1,103 +1,55 @@
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')
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
test {
resources {
srcDir file('src/test/resources')
}
dependencies {
classpath "com.github.jengelman.gradle.plugins:shadow:$shadow_version"
classpath 'de.sebastianboegl.gradle.plugins:shadow-log4j-transformer:2.1.1'
}
}
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')
}
apply plugin: 'application'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'net.corda.plugins.publish-utils'
apply plugin: 'com.jfrog.artifactory'
mainClassName = 'net.corda.tools.shell.StandaloneShellKt'
jar {
baseName 'corda-shell-cli'
dependencies {
compile project(':tools:shell')
compile group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.25'
testCompile project(':test-utils')
}
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"
archiveName = "shell-cli-${version}.jar"
baseName = 'corda-shell-cli'
classifier = null
mainClassName = 'net.corda.tools.shell.StandaloneShellKt'
mergeServiceFiles()
}
task buildShellCli(dependsOn: shadowJar)
artifacts {
publish shadowJar {
classifier ""
}
}
jar {
classifier "ignore"
}
publish {
name 'corda-tools-shell-cli'
disableDefaultJar = true
}