SlideShare ist ein Scribd-Unternehmen logo
1 von 25
Gant – the lightweight and Groovy
                   scripting framework


                                 Dr Russel Winder


                                       Partner, Concertant LLP
                                       russel.winder@concertant.com



Copyright © 2009 Russel Winder                                        1
Aims and Objectives of the Session

                       ●    Look at Gant as a way of:
                                 –   Defining a set of targets.
                                 –   Scripting Ant tasks.
                                 –   Using AntBuilder.
                                 –   Using the Groovy meta-object protocol.




                                                            Have a structured “chin wag”
                                                            that is (hopefully) both
                                                            illuminating and enlightening.
Copyright © 2009 Russel Winder                                                               2
Structure of the Session

                       ●    Do stuff.
                       ●    Exit stage (left|right).




                                                       There is significant dynamic binding
                                                       to the session so the above is just a
                                                       set of place holders.

Copyright © 2009 Russel Winder                                                                 3
Protocol for the Session

                       ●    A sequence of slides, interrupted by various bits of
                            code.
                       ●    Example executions of code – with the illuminating
                            presence of a system monitor.
                       ●    Questions (and, indeed, answers) from the audience
                            as and when they crop up.


                                                  If an interaction looks like it is
                                                  getting too involved, we reserve
                                                  the right to stack it for handling
                                                  after the session.
Copyright © 2009 Russel Winder                                                         4
Blatant Advertising

                       Python for Rookies
                       Sarah Mount, James Shuttleworth and
                       Russel Winder
                       Thomson Learning Now called Cengage Learning.


                                          Developing Java Software Third Edition
                                          Russel Winder and Graham Roberts
                                          Wiley




                                                          Buy these books!
Copyright © 2009 Russel Winder                                                     5
XML

                       ●    Does anyone like programming using XML?
                                 –   Ant has always claimed Ant scripts are declarative
                                     programs – at least that is better than trying to write
                                     imperative programs using XML.
                                 –   Most Ant scripts exhibit significant control flow
                                     tendencies.




Copyright © 2009 Russel Winder                                                                 6
gs/XML/Groovy/g

                       ●    Gant started as an Ant-   ●   Gradle (and SCons)
                            style build tool using        shows that build is
                            Groovy instead of XML         better handled using a
                            to specify the build.         system that works using
                                                          a directed acyclic graph
                       ●    Ant <-> Maven warfare,
                                                          of all dependencies.
                            configuration vs.
                            convention.



                 Real Programmers use ed.


Copyright © 2009 Russel Winder                                                       7
If Gradle, why Gant?

                       ●    Gant is a lightweight target-oriented scripting system
                            built on Groovy and its AntBuilder.
                       ●    Gradle is a build framework.


                                      Gant is lightweight, Gradle
                                      is a little more serious.


                                                Lightweight means embeddable,
                                                hence it being used in Grails.


Copyright © 2009 Russel Winder                                                       8
Gant Scripts . . .

                       ●    Are Groovy scripts.
                       ●    Have targets as well as other code.
                       ●    Are executed directly – no data structure building
                            phase as with Gradle and SCons.




                                           Use functions, closures, etc. to structure
                                           the code and make the targets the
                                           multiple entries into the codebase.

Copyright © 2009 Russel Winder                                                          9
Targets are . . .
                                                        Think Fortran entry statement
                       ●    The entry points.
                       ●    Callable -- targets are closures and hence callable
                            from other targets and indeed any other code, but
                            this is a bad coding strategy.
                       ●    Independent – there is no way of specifying
                            dependencies of one target on another except by
                            executing code. Cf. depends function.

                                            Although targets become closures, treat
                                            them as entry points, not callables.


Copyright © 2009 Russel Winder                                                          10
Hello World

                     def helloWorld ( ) {
                       println ( 'Hello World.' )                     Parameter is a Map
                     }
                     target ( 'default' : 'The default target.' ) {
                       helloWorld ( )
                     }



                                                           |> gant -p -f helloWorld.gant

                                                           default The default target.

                                                           Default target is default.

                                                           |>
Copyright © 2009 Russel Winder                                                             11
Hello World – 2

                def helloWorld ( ) {
                  println ( 'Hello World.' )
                }
                target ( printHelloWorld : 'Print Hello World.' ) {
                  helloWorld ( )
                }
                setDefaultTarget ( printHelloWorld )


                                                 |> gant -p -f helloWorld_2.gant

                                                  printHelloWorld Print Hello World.

                                                 Default target is printHelloWorld.

                                                 |>
Copyright © 2009 Russel Winder                                                         12
HelloWorld – 3


         def helloWorld ( ) {
           println ( 'Hello World.' )
         }
         target ( doHelloWorldPrint : 'Print Hello World.' ) {
           helloWorld ( )
         }
         target ( printHelloWorld : 'Force doHelloWorldPrint to be achieved.' ) {
           depends ( doHelloWorldPrint )
         }
         setDefaultTarget ( printHelloWorld )




Copyright © 2009 Russel Winder                                                      13
Hello World – 4


           def helloWorld ( ) {
             println ( 'Hello World.' )
           }
           target ( printHelloWorld : 'Force doHelloWorldPrint to be achieved.' ) {
             depends ( helloWorld )
           }
           setDefaultTarget ( printHelloWorld )




                                                        This does not work :-(

Copyright © 2009 Russel Winder                                                        14
Hello World – 5 & 6
    def helloWorld = {
      println ( 'Hello World.' )                             These work, but is it
    }                                                        better to make the
    target ( printHelloWorld : 'Print Hell World.' ) {       variable local or use
      depends ( helloWorld )                                 the global binding?
    }
    setDefaultTarget ( printHelloWorld )


                                 helloWorld = {
                                   println ( 'Hello World.' )
                                 }
                                 target ( printHelloWorld : 'Print Hell World.' ) {
                                   depends ( helloWorld )
                                 }
                                 setDefaultTarget ( printHelloWorld )
Copyright © 2009 Russel Winder                                                        15
Hello World – 7 & 8

  def helloWorld = {                                           The global hooks are
    println ( 'Hello World.' )                                 just variables in the
  }                                                            binding – callable or
  globalPreHook = helloWorld                                   list of callables
  target ( printHelloWorld : 'Print Hello World.' ) { }        assumed.
  setDefaultTarget ( printHelloWorld )



                                 def helloWorld = {
                                   println ( 'Hello World.' )
                                 }
                                 globalPostHook = [ helloWorld ]
                                 target ( printHelloWorld : 'Print Hello World.' ) { }
                                 setDefaultTarget ( printHelloWorld )

Copyright © 2009 Russel Winder                                                           16
Hello World – 9 & 10

    def helloWorld = {
      println ( 'Hello World.' )
    }
    target ( name : 'printHelloWorld' , description : 'Print Hello World.' ,
    addprehook : helloWorld ) { }
    setDefaultTarget ( printHelloWorld )



                  def helloWorld = {
                    println ( 'Hello World.' )
                  }
                  target ( name : 'printHelloWorld' , description : 'Print Hello World.' ,
                  addposthook : helloWorld ) { }
                  setDefaultTarget ( printHelloWorld )
Copyright © 2009 Russel Winder                                                               17
Hello World – 11 & 12

        def helloWorld = {
          println ( 'Hello World.' )
        }
        target ( name : 'printHelloWorld' , description : 'Print Hello World.' ,
        prehook : helloWorld ) { }
        setDefaultTarget ( printHelloWorld )



               def helloWorld = {
                 println ( 'Hello World.' )
               }
               target ( name : 'printHelloWorld' , description : 'Print Hello World.' ,
               posthook : helloWorld ) { }
               setDefaultTarget ( printHelloWorld )

Copyright © 2009 Russel Winder                                                            18
Hello World – 13 & 14



         target ( 'Hello World.' : 'Print Hello World.' ) { println ( it.name ) }
         setDefaultTarget ( 'Hello World.' )




        target ( printHelloWorld : 'Hello World.' ) { println ( it.description ) }
        setDefaultTarget ( printHelloWorld )



Copyright © 2009 Russel Winder                                                       19
Doing More Than One Thing At Once

                       ●    The world is a parallel place – multicore is now the
                            norm.
                       ●    Workstations have 2, 3, 4, 6, 8, . . . cores.
                       ●    Sequential, uniprocessor thinking is now archaic.




Copyright © 2009 Russel Winder                                                     20
GPars is Groovy Parallelism

                       ●    Was GParallelizer is now GPars.
                       ●    http://gpars.codehaus.org
                       ●    Will have a selection of tools:
                                 –   Actors
                                 –   Active objects
                                 –   Dataflow
                                 –   CSP



                                                CSP – Communicating Sequential Processes
Copyright © 2009 Russel Winder                                                             21
Actors and Data Parallelism

                       ●    Some examples of using GPars in Groovy.
                       ●    Some examples of using GPars in Gant.




Copyright © 2009 Russel Winder                                        22
Summary

                       ●    Interesting things were said.
                       ●    People enjoyed the session.




Copyright © 2009 Russel Winder                              23
Unabashed Advertising




                                 You know you want to buy them!
Copyright © 2008 Russel Winder                                    24
GPars Logo Contest

                       ●    GPars project is having a logo contest: See
                            http://docs.codehaus.org/display/GPARS/Logo+Contest
                       ●    Closing date for entries was 2009-11-30.
                       ●    Voting is now happening.




                                               Late entries are not
                                               accepted, though if
                                               significant bribes to the
                                               organizer are involved . . .
Copyright © 2008 Russel Winder                                                    25

Weitere ähnliche Inhalte

Ähnlich wie Gant, the lightweight and Groovy targeted scripting framework

Just Keep Sending The Messages
Just Keep Sending The MessagesJust Keep Sending The Messages
Just Keep Sending The MessagesRussel Winder
 
Java is dead, long live Scala, Kotlin, Ceylon, etc.
Java is dead, long live Scala, Kotlin, Ceylon, etc.Java is dead, long live Scala, Kotlin, Ceylon, etc.
Java is dead, long live Scala, Kotlin, Ceylon, etc.Russel Winder
 
Java is Dead, Long Live Ceylon, Kotlin, etc
Java is Dead,  Long Live Ceylon, Kotlin, etcJava is Dead,  Long Live Ceylon, Kotlin, etc
Java is Dead, Long Live Ceylon, Kotlin, etcRussel Winder
 
Vagrant & CFEngine - LOPSA East 2013
Vagrant & CFEngine - LOPSA East 2013Vagrant & CFEngine - LOPSA East 2013
Vagrant & CFEngine - LOPSA East 2013Nick Anderson
 
Venkat Subramaniam Building DSLs In Groovy
Venkat Subramaniam Building DSLs In GroovyVenkat Subramaniam Building DSLs In Groovy
Venkat Subramaniam Building DSLs In Groovydeimos
 
Gradle: Harder, Stronger, Better, Faster
Gradle: Harder, Stronger, Better, FasterGradle: Harder, Stronger, Better, Faster
Gradle: Harder, Stronger, Better, FasterAndres Almiray
 
TechEvent Graal(VM) Performance Interoperability
TechEvent Graal(VM) Performance InteroperabilityTechEvent Graal(VM) Performance Interoperability
TechEvent Graal(VM) Performance InteroperabilityTrivadis
 
Agile Project Management - coClarity
Agile Project Management - coClarityAgile Project Management - coClarity
Agile Project Management - coClarityGerard Hartnett
 
Java is dead, long live Scala Kotlin Ceylon etc.
Java is dead, long live Scala Kotlin Ceylon etc.Java is dead, long live Scala Kotlin Ceylon etc.
Java is dead, long live Scala Kotlin Ceylon etc.Russel Winder
 
Improving Engineering Processes using Hudson - Spark IT 2010
Improving Engineering Processes using Hudson - Spark IT 2010Improving Engineering Processes using Hudson - Spark IT 2010
Improving Engineering Processes using Hudson - Spark IT 2010Arun Gupta
 
“Startup - it’s not just an IT project” - a random sampling of problems we’ve...
“Startup - it’s not just an IT project” - a random sampling of problems we’ve...“Startup - it’s not just an IT project” - a random sampling of problems we’ve...
“Startup - it’s not just an IT project” - a random sampling of problems we’ve...MobileMonday Estonia
 
Tungsten University: Geographically Distributed Multi-Master MySQL Clusters
Tungsten University: Geographically Distributed Multi-Master MySQL ClustersTungsten University: Geographically Distributed Multi-Master MySQL Clusters
Tungsten University: Geographically Distributed Multi-Master MySQL ClustersContinuent
 
Just Keep Passing The Messages
Just Keep Passing The MessagesJust Keep Passing The Messages
Just Keep Passing The MessagesRussel Winder
 
Java Tech & Tools | Just Keep Passing the Message | Russel Winder
Java Tech & Tools | Just Keep Passing the Message | Russel WinderJava Tech & Tools | Just Keep Passing the Message | Russel Winder
Java Tech & Tools | Just Keep Passing the Message | Russel WinderJAX London
 
Create first android app with MVVM Architecture
Create first android app with MVVM ArchitectureCreate first android app with MVVM Architecture
Create first android app with MVVM Architecturekhushbu thakker
 
Apache Drill (ver. 0.1, check ver. 0.2)
Apache Drill (ver. 0.1, check ver. 0.2)Apache Drill (ver. 0.1, check ver. 0.2)
Apache Drill (ver. 0.1, check ver. 0.2)Camuel Gilyadov
 

Ähnlich wie Gant, the lightweight and Groovy targeted scripting framework (20)

Just Keep Sending The Messages
Just Keep Sending The MessagesJust Keep Sending The Messages
Just Keep Sending The Messages
 
GPars Workshop
GPars WorkshopGPars Workshop
GPars Workshop
 
Node.js Test
Node.js TestNode.js Test
Node.js Test
 
Java is dead, long live Scala, Kotlin, Ceylon, etc.
Java is dead, long live Scala, Kotlin, Ceylon, etc.Java is dead, long live Scala, Kotlin, Ceylon, etc.
Java is dead, long live Scala, Kotlin, Ceylon, etc.
 
Java is Dead, Long Live Ceylon, Kotlin, etc
Java is Dead,  Long Live Ceylon, Kotlin, etcJava is Dead,  Long Live Ceylon, Kotlin, etc
Java is Dead, Long Live Ceylon, Kotlin, etc
 
Vagrant & CFEngine - LOPSA East 2013
Vagrant & CFEngine - LOPSA East 2013Vagrant & CFEngine - LOPSA East 2013
Vagrant & CFEngine - LOPSA East 2013
 
Venkat Subramaniam Building DSLs In Groovy
Venkat Subramaniam Building DSLs In GroovyVenkat Subramaniam Building DSLs In Groovy
Venkat Subramaniam Building DSLs In Groovy
 
Gradle: Harder, Stronger, Better, Faster
Gradle: Harder, Stronger, Better, FasterGradle: Harder, Stronger, Better, Faster
Gradle: Harder, Stronger, Better, Faster
 
TechEvent Graal(VM) Performance Interoperability
TechEvent Graal(VM) Performance InteroperabilityTechEvent Graal(VM) Performance Interoperability
TechEvent Graal(VM) Performance Interoperability
 
Android Development Tutorial V3
Android Development Tutorial   V3Android Development Tutorial   V3
Android Development Tutorial V3
 
Agile Project Management - coClarity
Agile Project Management - coClarityAgile Project Management - coClarity
Agile Project Management - coClarity
 
Java is dead, long live Scala Kotlin Ceylon etc.
Java is dead, long live Scala Kotlin Ceylon etc.Java is dead, long live Scala Kotlin Ceylon etc.
Java is dead, long live Scala Kotlin Ceylon etc.
 
Improving Engineering Processes using Hudson - Spark IT 2010
Improving Engineering Processes using Hudson - Spark IT 2010Improving Engineering Processes using Hudson - Spark IT 2010
Improving Engineering Processes using Hudson - Spark IT 2010
 
M6d cassandra summit
M6d cassandra summitM6d cassandra summit
M6d cassandra summit
 
“Startup - it’s not just an IT project” - a random sampling of problems we’ve...
“Startup - it’s not just an IT project” - a random sampling of problems we’ve...“Startup - it’s not just an IT project” - a random sampling of problems we’ve...
“Startup - it’s not just an IT project” - a random sampling of problems we’ve...
 
Tungsten University: Geographically Distributed Multi-Master MySQL Clusters
Tungsten University: Geographically Distributed Multi-Master MySQL ClustersTungsten University: Geographically Distributed Multi-Master MySQL Clusters
Tungsten University: Geographically Distributed Multi-Master MySQL Clusters
 
Just Keep Passing The Messages
Just Keep Passing The MessagesJust Keep Passing The Messages
Just Keep Passing The Messages
 
Java Tech & Tools | Just Keep Passing the Message | Russel Winder
Java Tech & Tools | Just Keep Passing the Message | Russel WinderJava Tech & Tools | Just Keep Passing the Message | Russel Winder
Java Tech & Tools | Just Keep Passing the Message | Russel Winder
 
Create first android app with MVVM Architecture
Create first android app with MVVM ArchitectureCreate first android app with MVVM Architecture
Create first android app with MVVM Architecture
 
Apache Drill (ver. 0.1, check ver. 0.2)
Apache Drill (ver. 0.1, check ver. 0.2)Apache Drill (ver. 0.1, check ver. 0.2)
Apache Drill (ver. 0.1, check ver. 0.2)
 

Mehr von Skills Matter

5 things cucumber is bad at by Richard Lawrence
5 things cucumber is bad at by Richard Lawrence5 things cucumber is bad at by Richard Lawrence
5 things cucumber is bad at by Richard LawrenceSkills Matter
 
Patterns for slick database applications
Patterns for slick database applicationsPatterns for slick database applications
Patterns for slick database applicationsSkills Matter
 
Scala e xchange 2013 haoyi li on metascala a tiny diy jvm
Scala e xchange 2013 haoyi li on metascala a tiny diy jvmScala e xchange 2013 haoyi li on metascala a tiny diy jvm
Scala e xchange 2013 haoyi li on metascala a tiny diy jvmSkills Matter
 
Oscar reiken jr on our success at manheim
Oscar reiken jr on our success at manheimOscar reiken jr on our success at manheim
Oscar reiken jr on our success at manheimSkills Matter
 
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...Skills Matter
 
Cukeup nyc ian dees on elixir, erlang, and cucumberl
Cukeup nyc ian dees on elixir, erlang, and cucumberlCukeup nyc ian dees on elixir, erlang, and cucumberl
Cukeup nyc ian dees on elixir, erlang, and cucumberlSkills Matter
 
Cukeup nyc peter bell on getting started with cucumber.js
Cukeup nyc peter bell on getting started with cucumber.jsCukeup nyc peter bell on getting started with cucumber.js
Cukeup nyc peter bell on getting started with cucumber.jsSkills Matter
 
Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...
Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...
Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...Skills Matter
 
Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...
Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...
Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...Skills Matter
 
Progressive f# tutorials nyc don syme on keynote f# in the open source world
Progressive f# tutorials nyc don syme on keynote f# in the open source worldProgressive f# tutorials nyc don syme on keynote f# in the open source world
Progressive f# tutorials nyc don syme on keynote f# in the open source worldSkills Matter
 
Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...
Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...
Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...Skills Matter
 
Dmitry mozorov on code quotations code as-data for f#
Dmitry mozorov on code quotations code as-data for f#Dmitry mozorov on code quotations code as-data for f#
Dmitry mozorov on code quotations code as-data for f#Skills Matter
 
A poet's guide_to_acceptance_testing
A poet's guide_to_acceptance_testingA poet's guide_to_acceptance_testing
A poet's guide_to_acceptance_testingSkills Matter
 
Russ miles-cloudfoundry-deep-dive
Russ miles-cloudfoundry-deep-diveRuss miles-cloudfoundry-deep-dive
Russ miles-cloudfoundry-deep-diveSkills Matter
 
Simon Peyton Jones: Managing parallelism
Simon Peyton Jones: Managing parallelismSimon Peyton Jones: Managing parallelism
Simon Peyton Jones: Managing parallelismSkills Matter
 
I went to_a_communications_workshop_and_they_t
I went to_a_communications_workshop_and_they_tI went to_a_communications_workshop_and_they_t
I went to_a_communications_workshop_and_they_tSkills Matter
 

Mehr von Skills Matter (20)

5 things cucumber is bad at by Richard Lawrence
5 things cucumber is bad at by Richard Lawrence5 things cucumber is bad at by Richard Lawrence
5 things cucumber is bad at by Richard Lawrence
 
Patterns for slick database applications
Patterns for slick database applicationsPatterns for slick database applications
Patterns for slick database applications
 
Scala e xchange 2013 haoyi li on metascala a tiny diy jvm
Scala e xchange 2013 haoyi li on metascala a tiny diy jvmScala e xchange 2013 haoyi li on metascala a tiny diy jvm
Scala e xchange 2013 haoyi li on metascala a tiny diy jvm
 
Oscar reiken jr on our success at manheim
Oscar reiken jr on our success at manheimOscar reiken jr on our success at manheim
Oscar reiken jr on our success at manheim
 
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...
 
Cukeup nyc ian dees on elixir, erlang, and cucumberl
Cukeup nyc ian dees on elixir, erlang, and cucumberlCukeup nyc ian dees on elixir, erlang, and cucumberl
Cukeup nyc ian dees on elixir, erlang, and cucumberl
 
Cukeup nyc peter bell on getting started with cucumber.js
Cukeup nyc peter bell on getting started with cucumber.jsCukeup nyc peter bell on getting started with cucumber.js
Cukeup nyc peter bell on getting started with cucumber.js
 
Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...
Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...
Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...
 
Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...
Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...
Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...
 
Progressive f# tutorials nyc don syme on keynote f# in the open source world
Progressive f# tutorials nyc don syme on keynote f# in the open source worldProgressive f# tutorials nyc don syme on keynote f# in the open source world
Progressive f# tutorials nyc don syme on keynote f# in the open source world
 
Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...
Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...
Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...
 
Dmitry mozorov on code quotations code as-data for f#
Dmitry mozorov on code quotations code as-data for f#Dmitry mozorov on code quotations code as-data for f#
Dmitry mozorov on code quotations code as-data for f#
 
A poet's guide_to_acceptance_testing
A poet's guide_to_acceptance_testingA poet's guide_to_acceptance_testing
A poet's guide_to_acceptance_testing
 
Russ miles-cloudfoundry-deep-dive
Russ miles-cloudfoundry-deep-diveRuss miles-cloudfoundry-deep-dive
Russ miles-cloudfoundry-deep-dive
 
Serendipity-neo4j
Serendipity-neo4jSerendipity-neo4j
Serendipity-neo4j
 
Simon Peyton Jones: Managing parallelism
Simon Peyton Jones: Managing parallelismSimon Peyton Jones: Managing parallelism
Simon Peyton Jones: Managing parallelism
 
Plug 20110217
Plug   20110217Plug   20110217
Plug 20110217
 
Lug presentation
Lug presentationLug presentation
Lug presentation
 
I went to_a_communications_workshop_and_they_t
I went to_a_communications_workshop_and_they_tI went to_a_communications_workshop_and_they_t
I went to_a_communications_workshop_and_they_t
 
Plug saiku
Plug   saikuPlug   saiku
Plug saiku
 

Kürzlich hochgeladen

How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 

Kürzlich hochgeladen (20)

How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 

Gant, the lightweight and Groovy targeted scripting framework

  • 1. Gant – the lightweight and Groovy scripting framework Dr Russel Winder Partner, Concertant LLP russel.winder@concertant.com Copyright © 2009 Russel Winder 1
  • 2. Aims and Objectives of the Session ● Look at Gant as a way of: – Defining a set of targets. – Scripting Ant tasks. – Using AntBuilder. – Using the Groovy meta-object protocol. Have a structured “chin wag” that is (hopefully) both illuminating and enlightening. Copyright © 2009 Russel Winder 2
  • 3. Structure of the Session ● Do stuff. ● Exit stage (left|right). There is significant dynamic binding to the session so the above is just a set of place holders. Copyright © 2009 Russel Winder 3
  • 4. Protocol for the Session ● A sequence of slides, interrupted by various bits of code. ● Example executions of code – with the illuminating presence of a system monitor. ● Questions (and, indeed, answers) from the audience as and when they crop up. If an interaction looks like it is getting too involved, we reserve the right to stack it for handling after the session. Copyright © 2009 Russel Winder 4
  • 5. Blatant Advertising Python for Rookies Sarah Mount, James Shuttleworth and Russel Winder Thomson Learning Now called Cengage Learning. Developing Java Software Third Edition Russel Winder and Graham Roberts Wiley Buy these books! Copyright © 2009 Russel Winder 5
  • 6. XML ● Does anyone like programming using XML? – Ant has always claimed Ant scripts are declarative programs – at least that is better than trying to write imperative programs using XML. – Most Ant scripts exhibit significant control flow tendencies. Copyright © 2009 Russel Winder 6
  • 7. gs/XML/Groovy/g ● Gant started as an Ant- ● Gradle (and SCons) style build tool using shows that build is Groovy instead of XML better handled using a to specify the build. system that works using a directed acyclic graph ● Ant <-> Maven warfare, of all dependencies. configuration vs. convention. Real Programmers use ed. Copyright © 2009 Russel Winder 7
  • 8. If Gradle, why Gant? ● Gant is a lightweight target-oriented scripting system built on Groovy and its AntBuilder. ● Gradle is a build framework. Gant is lightweight, Gradle is a little more serious. Lightweight means embeddable, hence it being used in Grails. Copyright © 2009 Russel Winder 8
  • 9. Gant Scripts . . . ● Are Groovy scripts. ● Have targets as well as other code. ● Are executed directly – no data structure building phase as with Gradle and SCons. Use functions, closures, etc. to structure the code and make the targets the multiple entries into the codebase. Copyright © 2009 Russel Winder 9
  • 10. Targets are . . . Think Fortran entry statement ● The entry points. ● Callable -- targets are closures and hence callable from other targets and indeed any other code, but this is a bad coding strategy. ● Independent – there is no way of specifying dependencies of one target on another except by executing code. Cf. depends function. Although targets become closures, treat them as entry points, not callables. Copyright © 2009 Russel Winder 10
  • 11. Hello World def helloWorld ( ) { println ( 'Hello World.' ) Parameter is a Map } target ( 'default' : 'The default target.' ) { helloWorld ( ) } |> gant -p -f helloWorld.gant default The default target. Default target is default. |> Copyright © 2009 Russel Winder 11
  • 12. Hello World – 2 def helloWorld ( ) { println ( 'Hello World.' ) } target ( printHelloWorld : 'Print Hello World.' ) { helloWorld ( ) } setDefaultTarget ( printHelloWorld ) |> gant -p -f helloWorld_2.gant printHelloWorld Print Hello World. Default target is printHelloWorld. |> Copyright © 2009 Russel Winder 12
  • 13. HelloWorld – 3 def helloWorld ( ) { println ( 'Hello World.' ) } target ( doHelloWorldPrint : 'Print Hello World.' ) { helloWorld ( ) } target ( printHelloWorld : 'Force doHelloWorldPrint to be achieved.' ) { depends ( doHelloWorldPrint ) } setDefaultTarget ( printHelloWorld ) Copyright © 2009 Russel Winder 13
  • 14. Hello World – 4 def helloWorld ( ) { println ( 'Hello World.' ) } target ( printHelloWorld : 'Force doHelloWorldPrint to be achieved.' ) { depends ( helloWorld ) } setDefaultTarget ( printHelloWorld ) This does not work :-( Copyright © 2009 Russel Winder 14
  • 15. Hello World – 5 & 6 def helloWorld = { println ( 'Hello World.' ) These work, but is it } better to make the target ( printHelloWorld : 'Print Hell World.' ) { variable local or use depends ( helloWorld ) the global binding? } setDefaultTarget ( printHelloWorld ) helloWorld = { println ( 'Hello World.' ) } target ( printHelloWorld : 'Print Hell World.' ) { depends ( helloWorld ) } setDefaultTarget ( printHelloWorld ) Copyright © 2009 Russel Winder 15
  • 16. Hello World – 7 & 8 def helloWorld = { The global hooks are println ( 'Hello World.' ) just variables in the } binding – callable or globalPreHook = helloWorld list of callables target ( printHelloWorld : 'Print Hello World.' ) { } assumed. setDefaultTarget ( printHelloWorld ) def helloWorld = { println ( 'Hello World.' ) } globalPostHook = [ helloWorld ] target ( printHelloWorld : 'Print Hello World.' ) { } setDefaultTarget ( printHelloWorld ) Copyright © 2009 Russel Winder 16
  • 17. Hello World – 9 & 10 def helloWorld = { println ( 'Hello World.' ) } target ( name : 'printHelloWorld' , description : 'Print Hello World.' , addprehook : helloWorld ) { } setDefaultTarget ( printHelloWorld ) def helloWorld = { println ( 'Hello World.' ) } target ( name : 'printHelloWorld' , description : 'Print Hello World.' , addposthook : helloWorld ) { } setDefaultTarget ( printHelloWorld ) Copyright © 2009 Russel Winder 17
  • 18. Hello World – 11 & 12 def helloWorld = { println ( 'Hello World.' ) } target ( name : 'printHelloWorld' , description : 'Print Hello World.' , prehook : helloWorld ) { } setDefaultTarget ( printHelloWorld ) def helloWorld = { println ( 'Hello World.' ) } target ( name : 'printHelloWorld' , description : 'Print Hello World.' , posthook : helloWorld ) { } setDefaultTarget ( printHelloWorld ) Copyright © 2009 Russel Winder 18
  • 19. Hello World – 13 & 14 target ( 'Hello World.' : 'Print Hello World.' ) { println ( it.name ) } setDefaultTarget ( 'Hello World.' ) target ( printHelloWorld : 'Hello World.' ) { println ( it.description ) } setDefaultTarget ( printHelloWorld ) Copyright © 2009 Russel Winder 19
  • 20. Doing More Than One Thing At Once ● The world is a parallel place – multicore is now the norm. ● Workstations have 2, 3, 4, 6, 8, . . . cores. ● Sequential, uniprocessor thinking is now archaic. Copyright © 2009 Russel Winder 20
  • 21. GPars is Groovy Parallelism ● Was GParallelizer is now GPars. ● http://gpars.codehaus.org ● Will have a selection of tools: – Actors – Active objects – Dataflow – CSP CSP – Communicating Sequential Processes Copyright © 2009 Russel Winder 21
  • 22. Actors and Data Parallelism ● Some examples of using GPars in Groovy. ● Some examples of using GPars in Gant. Copyright © 2009 Russel Winder 22
  • 23. Summary ● Interesting things were said. ● People enjoyed the session. Copyright © 2009 Russel Winder 23
  • 24. Unabashed Advertising You know you want to buy them! Copyright © 2008 Russel Winder 24
  • 25. GPars Logo Contest ● GPars project is having a logo contest: See http://docs.codehaus.org/display/GPARS/Logo+Contest ● Closing date for entries was 2009-11-30. ● Voting is now happening. Late entries are not accepted, though if significant bribes to the organizer are involved . . . Copyright © 2008 Russel Winder 25