From 69f367a2905c81a6b6cf0ae9238d240748729631 Mon Sep 17 00:00:00 2001 From: Jarred Li Date: Mon, 9 Apr 2012 16:58:01 +0800 Subject: [PATCH] build with gradle --- .gitignore | 2 + .../1.0-milestone-3/taskArtifacts/.gitignore | 2 - gradle.properties | 2 +- gradlew | 0 samples/helloworld/build.gradle | 36 ++++++++++++ samples/helloworld/gradle.properties | 1 + samples/helloworld/pom.xml | 58 +------------------ samples/helloworld/readme.txt | 16 +++++ 8 files changed, 59 insertions(+), 58 deletions(-) delete mode 100644 .gradle/1.0-milestone-3/taskArtifacts/.gitignore mode change 100644 => 100755 gradlew create mode 100644 samples/helloworld/build.gradle create mode 100644 samples/helloworld/gradle.properties create mode 100644 samples/helloworld/readme.txt diff --git a/.gitignore b/.gitignore index 9a33f906..4f8f9924 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ /.classpath /.project .settings/ +.gradle +build target/ /log.roo diff --git a/.gradle/1.0-milestone-3/taskArtifacts/.gitignore b/.gradle/1.0-milestone-3/taskArtifacts/.gitignore deleted file mode 100644 index b34d8944..00000000 --- a/.gradle/1.0-milestone-3/taskArtifacts/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/cache.bin -/cache.properties diff --git a/gradle.properties b/gradle.properties index b8149d16..cdf3bc6d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -30,4 +30,4 @@ thrift.range = "[0.7, 0.8)" # -------------------- # Project wide version # -------------------- -springShellVersion=1.0.0.BUILD-SNAPSHOT \ No newline at end of file +springShellVersion=1.0.0-SNAPSHOT \ No newline at end of file diff --git a/gradlew b/gradlew old mode 100644 new mode 100755 diff --git a/samples/helloworld/build.gradle b/samples/helloworld/build.gradle new file mode 100644 index 00000000..ac180071 --- /dev/null +++ b/samples/helloworld/build.gradle @@ -0,0 +1,36 @@ +description = 'Hello World - Spring Shell' + +apply plugin: 'base' +apply plugin: 'java' +apply plugin: 'idea' +apply plugin: 'eclipse' + +repositories { + mavenLocal() + mavenCentral() + // Public Spring artifacts + mavenRepo name: "spring-release", urls: "http://repo.springsource.org/release" + mavenRepo name: "spring-milestone", urls: "http://repo.springsource.org/milestone" + mavenRepo name: "spring-snapshot", urls: "http://repo.springsource.org/snapshot" +} + +dependencies { + compile "org.springframework.shell:core:$springShellVersion" +} + + +jar { + dependsOn configurations.runtime + from { + configurations.runtime.collect { + it.isDirectory() ? it : zipTree(it) + } + } + + manifest { + attributes("Main-Class": "org.springframework.shell.Bootstrap") + } + +} + +defaultTasks 'build' \ No newline at end of file diff --git a/samples/helloworld/gradle.properties b/samples/helloworld/gradle.properties new file mode 100644 index 00000000..5f6a31db --- /dev/null +++ b/samples/helloworld/gradle.properties @@ -0,0 +1 @@ +springShellVersion=1.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/helloworld/pom.xml b/samples/helloworld/pom.xml index fa89c14c..c8e0a346 100644 --- a/samples/helloworld/pom.xml +++ b/samples/helloworld/pom.xml @@ -18,65 +18,13 @@ - - junit - junit - 4.7 - test - - - org.springframework - spring-test - ${spring.framework.version} - test - - - org.springframework - spring-context - ${spring.framework.version} - - + org.springframework.shell core ${spring.shell.version} - - - - - cglib - cglib - 2.2.2 - - - log4j - log4j - 1.2.14 - - - - commons-io - commons-io - 1.4 - - - - - net.sourceforge.jline - jline - 1.0.S2-B - - - org.fusesource.jansi - jansi - 1.6 - - - org.mockito - mockito-all - 1.8.5 - test - + + diff --git a/samples/helloworld/readme.txt b/samples/helloworld/readme.txt new file mode 100644 index 00000000..16c9e77c --- /dev/null +++ b/samples/helloworld/readme.txt @@ -0,0 +1,16 @@ +Maven: + +1.Build the project + $>mvn package + +2.run spring shell + $>java -jar target/helloworld-1.0.0-SNAPSHOT.jar + + +Gradle: + +1.Build the project + $>../../gradlew build + +2.run spring shell + $>java -jar build/libs/helloworld.jar \ No newline at end of file