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

Build Lifecycle Craftsmanship for the Transylvania JUG

Build Lifecycle Craftsmanship for the Transylvania JUG

Bededa744012c87721d68f69342f81b0?s=128

Matthew McCullough

October 20, 2011
Tweet

Transcript

  1. Build Lifecycle Craftsmanship at the Transylvania JUG by Matthew McCullough

  2. Matthew McCullough @matthewmccull

  3. None
  4. ➡Gradle ➡Jenkins ➡Sonar ➡Maven 3 ➡VisualVM ➡BTrace

  5. ➡Gradle ➡Jenkins ➡Sonar ➡Maven 3 ➡VisualVM ➡BTrace

  6. Probably the most important technical book of 2010 -Martin Fowler,

    ThoughtWorks
  7. ➡Gradle ➡Jenkins ➡Sonar ➡Maven 3 ➡VisualVM ➡BTrace

  8. ➡Maven 3

  9. http://maven.apache.org/

  10. None
  11. ➡Why not stay with it? ➡What’s new? Maven 2.x?

  12. ➡Performance ➡Memory footprint ➡Parallelism Maven 3.x

  13. None
  14. ➡Gradle ➡Jenkins ➡Sonar ➡Maven 3 ➡VisualVM ➡BTrace

  15. ➡Gradle

  16. http://gradle.org/

  17. XY\kk\inXpkfYl`c[

  18. ➡Groovy DSL ➡Customizable lifecycle ➡Suitable for build masters and users

    Better Build Tool
  19. None
  20. ➡Gradle ➡Jenkins ➡Sonar ➡Maven 3 ➡VisualVM ➡BTrace

  21. ➡Jenkins

  22. http://jenkins-ci.org/

  23. None
  24. it all started with...

  25. None
  26. None
  27. None
  28. None
  29. and now the space is crowded...

  30. Software tools for continuous integration include: ▪AnthillPro — continuous integration

    server by Urbancode ▪Apache Continuum — continuous integration server supporting Apache Maven and Apache Ant. Supports CVS, Subversion, Ant, Maven, and shell scripts ▪Apache Gump — continuous integration tool by Apache ▪Automated Build Studio — proprietary automated build, continuous integration and release management system by AutomatedQA ▪Bamboo — proprietary continuous integration server by Atlassian Software Systems ▪BuildBot — Python/Twisted-based continuous build system ▪BuildMaster — proprietary application lifecycle management and continuous integration tool by Inedo
  31. NAnt, Maven, and shell scripts ▪Software Configuration and Library Manager

    — software configuration management system for z/OS by IBM Rational Software ▪QuickBuild - proprietary continuous integration server with free community edition featuring build life cycle management and pre-commit verification. ▪TeamCity — proprietary continuous-integration server by JetBrains with free professional edition ▪Team Foundation Server — proprietary continuous integration server and source code repository by Microsoft ▪Tinderbox — Mozilla-based product written in Perl ▪Rational Team Concert — proprietary software development collaboration platform with built-in build engine by IBM including Rational Build Forge
  32. ➡Humans should do the intelligent work ➡Integrate with source code,

    metrics Continuous Integration
  33. 473 plugins

  34. None
  35. None
  36. ➡Gradle ➡Jenkins ➡Sonar ➡Maven 3 ➡VisualVM ➡BTrace

  37. ➡Sonar

  38. http://sonarsource.org/

  39. None
  40. None
  41. ➡For managers? Metrics

  42. ★Checkstyle ★PMD ★ Findbugs ★ Cobertura ★ Emma ★ Clirr

    ★ JaCoCo ★ Useless Code ★ SQALE ★ 20+ others...
  43. None
  44. None
  45. #Maven 2 or 3 mvn sonar:sonar

  46. None
  47. None
  48. None
  49. ➡Gradle ➡Jenkins ➡Sonar ➡Maven 3 ➡VisualVM ➡BTrace

  50. ➡BTrace

  51. http://kenai.com/projects/btrace

  52. None
  53. ➡Bytecode, class manipulation ➡Aspect-like adjustment at runtime Runtime Inspection

  54. import com.sun.btrace.annotations.*; import static com.sun.btrace.BTraceUtils.*; import com.sun.btrace.AnyType; import java.lang.management.MemoryUsage; import

    java.util.concurrent.atomic.AtomicInteger; import java.util.Map; @BTrace public class TraceAllMethodCalls { /** * METHOD CALL TRACEPOINT. */ @OnMethod( clazz="com.ambientideas.HelloWorldJava", method="print", location=@Location(value=Kind.CALL, clazz="/.*/", method="/.*/") ) public static void m(AnyType[] args) { //System.out.println("Hello"); println(strcat("****** WE'VE ENTERED A METHOD ON CLASS: ", name(probeClass()))); println(strcat("****** WE'VE ENTERED METHOD: ", probeMethod())); } @OnMethod(
  55. import java.util.concurrent.atomic.AtomicInteger; import java.util.Map; @BTrace public class TraceAllMethodCalls { /**

    * METHOD CALL TRACEPOINT. */ @OnMethod( clazz="com.ambientideas.HelloWorldJava", method="print", location=@Location(value=Kind.CALL, clazz="/.*/", method="/.*/") ) public static void m(AnyType[] args) { //System.out.println("Hello"); println(strcat("****** WE'VE ENTERED A METHOD ON CLASS: ", name(probeClass()))); println(strcat("****** WE'VE ENTERED METHOD: ", probeMethod())); } @OnMethod( clazz="/.*/", method="println" ) public static void m2(AnyType[] args) { println(strcat("****** WE'VE ENTERED A METHOD ON CLASS: ", name(probeClass()))); println(strcat("****** WE'VE ENTERED METHOD: ", probeMethod())); } /**
  56. public static void m(AnyType[] args) { //System.out.println("Hello"); println(strcat("****** WE'VE ENTERED

    A METHOD ON CLASS: ", name(probeClass()))); println(strcat("****** WE'VE ENTERED METHOD: ", probeMethod())); } @OnMethod( clazz="/.*/", method="println" ) public static void m2(AnyType[] args) { println(strcat("****** WE'VE ENTERED A METHOD ON CLASS: ", name(probeClass()))); println(strcat("****** WE'VE ENTERED METHOD: ", probeMethod())); } /** * ONEXIT TRACEPOINT. CALLED WHEN A BTRACE METHOD CALLS EXIT(INT). */ @OnExit public static void onexit(int code) { println("****** THE BTRACE PROGRAM IS EXITING."); } /** * LOW MEMORY TRACE POINT. */ @OnLowMemory( pool = "Tenured Gen",
  57. println(strcat("****** WE'VE ENTERED A METHOD ON CLASS: ", name(probeClass()))); println(strcat("******

    WE'VE ENTERED METHOD: ", probeMethod())); } /** * ONEXIT TRACEPOINT. CALLED WHEN A BTRACE METHOD CALLS EXIT(INT). */ @OnExit public static void onexit(int code) { println("****** THE BTRACE PROGRAM IS EXITING."); } /** * LOW MEMORY TRACE POINT. */ @OnLowMemory( pool = "Tenured Gen", threshold=58720250 ) public static void onLowMem(MemoryUsage mu) { println("******"); println(mu); } /** * MEMORY HISTOGRAM TRACE POINT. */ private static Map<String, AtomicInteger> histo = newHashMap();
  58. * ONEXIT TRACEPOINT. CALLED WHEN A BTRACE METHOD CALLS EXIT(INT).

    */ @OnExit public static void onexit(int code) { println("****** THE BTRACE PROGRAM IS EXITING."); } /** * LOW MEMORY TRACE POINT. */ @OnLowMemory( pool = "Tenured Gen", threshold=58720250 ) public static void onLowMem(MemoryUsage mu) { println("******"); println(mu); } /** * MEMORY HISTOGRAM TRACE POINT. */ private static Map<String, AtomicInteger> histo = newHashMap(); @OnTimer(4000) public static void print() { if (size(histo) != 0) { printNumberMap(strcat("******", "Component Histogram"), histo); } } }
  59. */ @OnLowMemory( pool = "Tenured Gen", threshold=58720250 ) public static

    void onLowMem(MemoryUsage mu) { println("******"); println(mu); } /** * MEMORY HISTOGRAM TRACE POINT. */ private static Map<String, AtomicInteger> histo = newHashMap(); @OnTimer(4000) public static void print() { if (size(histo) != 0) { printNumberMap(strcat("******", "Component Histogram"), histo); } } }
  60. None
  61. None
  62. None
  63. ➡Gradle ➡Jenkins ➡Sonar ➡Maven 3 ➡VisualVM ➡BTrace

  64. ➡VisualVM

  65. http://visualvm.java.net/

  66. None
  67. None
  68. ➡Java 1.4 through Java 7 support ➡Included in JDK 6u7

    > Virtual Machine Metrics
  69. None
  70. None
  71. Build Lifecycle Craftsmanship at the Transylvania JUG by Matthew McCullough