SHL-43 - Update gradle build of sample application to use application plugin

This commit is contained in:
Mark Pollack
2012-07-14 08:11:55 -04:00
parent 9ceb0e8618
commit 137a0dee78
2 changed files with 7 additions and 24 deletions

View File

@@ -2,6 +2,7 @@ description = 'Spring Shell Example'
apply plugin: 'base'
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'application'
repositories {
mavenCentral()
@@ -15,24 +16,6 @@ dependencies {
compile "org.springframework.shell:spring-shell:$springShellVersion"
testCompile "junit:junit:$junitVersion"
}
mainClassName = "org.springframework.shell.Bootstrap"
task copyDependency(type: Copy) {
into "$buildDir/libs/dependency"
from configurations.runtime
}
project.ext.springShellJar = configurations.runtime.find { file -> file.name.contains("spring-shell")}
//println("spring shell name is:" + project.ext.springShellJar.name)
project.ext.manifestClasspath = "dependency/" + springShellJar.name + " "
project.ext.manifestClasspath = project.ext.manifestClasspath + configurations.runtime.collect{ File file -> "dependency/"+file.name}.join(' ')
jar {
baseName "helloworld"
manifest {
attributes 'Main-Class' : 'org.springframework.shell.Bootstrap', "Class-Path" : project.ext.manifestClasspath
}
}
defaultTasks 'clean', 'build', 'copyDependency'
defaultTasks 'clean', 'build'

View File

@@ -8,12 +8,12 @@ Maven:
Gradle (not supported yet):
Gradle
1.Build the project
$>../../gradlew build
1.Build and install the project
$>../../gradlew installApp
2.run spring shell
$>java -jar build/libs/helloworld-1.0.0.BUILD-SNAPSHOT.jar
$>.\build\install\helloworld\bin\helloworld.bat