pastebin - collaborative debugging

pastebin is a collaborative debugging tool allowing you to share and modify code snippets while chatting on IRC, IM or a message board.

This site is developed to XHTML and CSS2 W3C standards. If you see this paragraph, your browser does not support those standards and you need to upgrade. Visit WaSP for a variety of options.

groovy private pastebin - collaborative debugging tool What's a private pastebin?


Posted by Robert on Tue 18 Nov 11:36
report abuse | View followups from Robert | download | new post

  1.  
  2. includeTargets << gant.targets.Clean
  3.  
  4. def buildDir = 'gant'
  5. def classesDir = "${buildDir}/classes"
  6.  
  7. def sourceDir = "src"
  8. def testSourceDir = "test"
  9. def reportsDir = "reports"
  10.  
  11. def jarsDir = "lib"
  12. def testJarsDir = "${jarsDir}/test"
  13.  
  14. def distributables = "dist"
  15. def distributedJarName = "simple.jar"
  16. def distributedJarPath = "${distributables}/${distributedJarName}"
  17.  
  18. cleanDirectory << ["${buildDir}/**/*", "${distributables}/*"]
  19.  
  20. def jars = Ant.path(id: 'jars') {
  21.         fileset(dir: jarsDir) {
  22.                 include(name: '*.jar')
  23.         }
  24. }
  25.  
  26.  
  27. def source = Ant.path(id: 'source') {
  28.         dirset(dir: classesDir)
  29. }
  30.  
  31. target(initDirs: 'Create all the required directories') {
  32.         def dirs = [buildDir, classesDir, distributables]
  33.         dirs.each() { Ant.mkdir(dir: it) }
  34. }
  35.  
  36. target(compile: 'Build all the binary class files') {
  37.         depends(initDirs)
  38.        
  39.         Ant.javac(srcdir: sourceDir, destdir: classesDir)
  40.         Ant.javac(srcdir: testSourceDir, destdir: classesDir) {
  41.                 classpath() {
  42.                         path(refid: 'jars')
  43.                 }
  44.         }
  45. }
  46.  
  47. target(jar: 'Jar up the code') {
  48.         Ant.jar(basedir: classesDir,
  49.                         destfile: distributedJarPath,
  50.                         excludes: '**/*Test*') {
  51.                 manifest() {
  52.                         attribute(name: 'Main-Class',
  53.                                         value: 'example.Hello')
  54.                 }
  55.         }
  56. }
  57.  
  58. target(test: 'Run the test suite for the code') {
  59.         depends(compile)
  60.        
  61.         Ant.junit(haltonfailure: 'yes') {
  62.                 formatter(type: 'plain')
  63.                
  64.                 classpath() {
  65.                         path(refid: 'jars')
  66.                         path(refid: 'source')
  67.                 }
  68.                
  69.                 batchtest(todir: reportsDir) {
  70.                         fileset(dir: "${classesDir}") {
  71.                                 include(name: "**/*Test*")
  72.                         }
  73.                 }
  74.         }
  75. }
  76.  
  77. target(dist: 'Create release artefacts') {
  78.         depends(test)
  79.         depends(jar)
  80. }
  81.  
  82. target(run: 'Run the distributed jar') {
  83.         depends(dist)
  84.        
  85.         Ant.java(jar: distributedJarPath, fork: 'true')
  86. }
  87.  
  88. target(hello: 'Hello World') {
  89.         println("Hello World")
  90. }
  91.  
  92. setDefaultTarget(dist)

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with @@


Remember me so that I can delete my post