File: overview.html

package info (click to toggle)
gant 1.9.11-8
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 904 kB
  • sloc: java: 767; sh: 177; xml: 148; makefile: 14
file content (60 lines) | stat: -rw-r--r-- 2,359 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>Gant</title>
  </head>

  <body>
    <p>
      Gant is a Groovy-based framework for scripting Ant tasks.
    </p>
    <p>
      Gant is a lightweight wrapper around Groovy's <code>AntBuilder</code> that allows Ant tasks to be
      scripted using Groovy.  This means it can be used as a replacement for Ant:  instead of specifying
      things using XML, they are specified with Groovy.
    </p>
    <p>
      A Gant file is a specification of a set of targets plus other bits and pieces of Groovy code.  Thus a
      Gant specification is of a set of targets just as an Ant specification is.  Each target creates a
      closure in the binding so that it can be called as a function from other targets.  This means that
      dependencies between targets are programmed as function calls.
    </p>
    <p>
      Gant has a number of predefined objects, for example <code>ant</code>, <code>includeTargets</code>
      and <code>includeTool</code>. <code>ant</code> refers to a pre-constructed <code>GantBuilder</code>
      object. <code>includeTargets</code> is the object that controls the inclusion of ready-made targets,
      for example <code>gant.targets.Clean</code>.  <code>includeTool</code> is the object that controls the
      inclusion of ready-made tools, for example <code>gant.tools.Execute</code>.
    </p>
    <p>
      Here is an example Gant script:
    </p>
    <blockquote>
      <pre>
includeTargets << gant.targets.Clean
cleanPattern << [ '**/*~' ,  '**/*.bak' ]
cleanDirectory << 'build'

target ( 'default' : 'The default target.' ) {
  println ( 'Default' )
  depends ( clean )
  echo ( message : 'A default message from Ant.' )
  otherStuff ( )
}

target ( otherStuff : 'Other stuff' ) {
  println ( 'OtherStuff' )
  echo ( message : 'Another message from Ant.' )
  clean ( )
}
      </pre>
    </blockquote>
    <p>
      The function <code>depends</code> takes a list of targets and 'executes' them if and only if they have
      not previously been executed.  This means that dependencies can be handled far more flexibly than they
      can in Ant, leading to simpler target structures.
    <hr>
    <address><a href="mailto:russel@winder.org.uk">Russel Winder</a></address>
    Last modified: 2010-04-05T08:30+01:00
  </body>
</html>