Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Hans Dockter on Gradle

Hans Dockter on Gradle

More Decks by Enterprise Java User Group Austria

Other Decks in Technology

Transcript

  1. 2 About Hans Dockter • Founder, Gradle • CEO, Gradle

    Inc. • Before Gradle: o Trainer, Mentor, Consultant for Enterprise Java. o Senior Developer for Krugle and Volkswagen. • Prehistoric ;): Committer to JBoss and founder of JBoss-IDE. Friday, January 14, 2011
  2. • A general purpose build system • It comes with

    a Groovy DSL and a Java core. • Provides build-in support for Java, Groovy, Scala, Web, OSGi projects. • Gradle provides exciting solutions for many of the big pain points you often have with current builds. – Maintainability – Performance – Usability 3 What is Gradle? Friday, January 14, 2011
  3. What is Gradle? Gradle is declarative You specify the WHAT

    Gradle figures out the HOW Friday, January 14, 2011
  4. SpringOne 2GX 2009. All rights reserved. Do not distribute without

    permission. Extensible Build Language instead of a Build Framework Friday, January 14, 2011
  5. • Deep Configuration API • Deep Execution API • Rich

    API • Extendable Domain Objects • Custom Tasks • Custom Plugins 6 Extending Gradle Friday, January 14, 2011
  6. Custom Declarative Elements usePlugin ʻeditionsʼ productEditions { enterprise core, plugins,

    powerAddons public core, plugins, openApi } > gradle enterpriseEditionZip > gradle publicEditionTar Friday, January 14, 2011
  7. SpringOne 2GX 2009. All rights reserved. Do not distribute without

    permission. Gradle is declarative without being rigid Friday, January 14, 2011
  8. SpringOne 2GX 2009. All rights reserved. Do not distribute without

    permission. Please no messy build scripts Friday, January 14, 2011
  9. • Separate Imperative from Declarative • Custom Tasks/Plugins • BuildSrc

    • Jar 12 Organizing Build Logic Friday, January 14, 2011
  10. 13 buildscript { repositories { mavenCentral() } dependencies { classpath

    'commons-math:commons-math:1.1' } } task math << { org.apache.commons.math.fraction.Fraction lhs = new org.apache.commons.math.fraction.Fraction(1, 3); // do something } Build Script Libraries Friday, January 14, 2011
  11. SpringOne 2GX 2009. All rights reserved. Do not distribute without

    permission. It’s the performance, stupid! Friday, January 14, 2011
  12. SpringOne 2GX 2009. All rights reserved. Do not distribute without

    permission. Should clean be required for a reliable build? (Hint: We have the 21st century) Friday, January 14, 2011
  13. • Incremental Build • Parallel Testing • Soon: Parallel Builds,

    Distributed testing/builds • Rich Model 16 Speed Improvements Friday, January 14, 2011
  14. SpringOne 2GX 2009. All rights reserved. Do not distribute without

    permission. Gradle is a Build Integration Tool Friday, January 14, 2011
  15. • Ant Tasks • Deep import of Ant builds •

    Retrieve/Deploy to Maven/Ivy repositories • Autogeneration of pom.xml/ivy.xml • Future: Deep import of Maven builds 18 Build Integration Features Friday, January 14, 2011
  16. • Mission Critical! • Very expensive if the build system

    can’t adapt to the existing project layout: – Freeze – Project automation not working for a while – Different branches (unreliable, hard to compare, ...) • Gradle’s suppleness enables baby steps. – Gradle can adapt to any project layout. – No separate branches – Comparable --> You can write tests 19 Build Migration Friday, January 14, 2011
  17. Dependency Management • Transitive Dependencies • Repository less dependencies are

    1st class citizens. • Excludes per configuration or dependency • Very flexible repository handling • Based on Apache Ivy • Powerful API • Much More ... Friday, January 14, 2011
  18. Deep Integration with Ant Builds > gradle hello Hello, from

    Gradle...Here comes Ant... [ant:echo] Hello, from Ant <project> <target name="hello" depends="intro"> <echo>Hello, from Ant</echo> </target> </project> ant.importBuild 'build.xml' hello.doFirst { println 'Here comes Ant' } task intro << { println 'Hello, from Gradle'} Friday, January 14, 2011
  19. • Supports Maven/Ant/Gradle with pom or ivy. • Supports any

    repository layout • Very advanced features • Gradle Artifactory plugin • Integrated in Gradle Hudson plugin. • Gradle Inc. has business partnership with JFrog. 22 Build Eco System Friday, January 14, 2011
  20. SpringOne 2GX 2009. All rights reserved. Do not distribute without

    permission. Process is very important. But it is all about YOUR process Friday, January 14, 2011
  21. SpringOne 2GX 2009. All rights reserved. Do not distribute without

    permission. Their is no one-size-fits-all project structure for the enterprise. Friday, January 14, 2011
  22. SpringOne 2GX 2009. All rights reserved. Do not distribute without

    permission. The physical structure of your projects should be determined by your requirements. (What, if not?) Friday, January 14, 2011
  23. SpringOne 2GX 2009. All rights reserved. Do not distribute without

    permission. Be as rigid as YOU want Friday, January 14, 2011
  24. SpringOne 2GX 2009. All rights reserved. Do not distribute without

    permission. FRAME- WORKITIS Friday, January 14, 2011
  25. SpringOne 2GX 2009. All rights reserved. Do not distribute without

    permission. Extensible Build Language instead of a Build Framework Friday, January 14, 2011
  26. • Very active community (mailing-list, patches, issues) • Apache v2

    license. • Excellent user’s guide (200+ pages) + many samples • Frequent releases, multiple commits per day • Quality is king: – 2800 unit tests, Many hundreds of integration test – Healthy codebase – low defect rate • Commiter -> Steve Appling, Hans Dockter, Tom Eyckmans, Adam Murdoch, Russel Winder 32 Project Background Friday, January 14, 2011