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

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
}