From 137a0dee7868e79cef18ea4db918a11199fd34f4 Mon Sep 17 00:00:00 2001 From: Mark Pollack Date: Sat, 14 Jul 2012 08:11:55 -0400 Subject: [PATCH] SHL-43 - Update gradle build of sample application to use application plugin --- samples/helloworld/build.gradle | 23 +++-------------------- samples/helloworld/readme.txt | 8 ++++---- 2 files changed, 7 insertions(+), 24 deletions(-) diff --git a/samples/helloworld/build.gradle b/samples/helloworld/build.gradle index 9ecfa2c5..b32f6a13 100644 --- a/samples/helloworld/build.gradle +++ b/samples/helloworld/build.gradle @@ -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' diff --git a/samples/helloworld/readme.txt b/samples/helloworld/readme.txt index 9af5484f..f6d44705 100644 --- a/samples/helloworld/readme.txt +++ b/samples/helloworld/readme.txt @@ -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