1 of 23

Java Build Tools

Jeanne Boyarsky

Stuy Splash – 12/16/17

slideshare.net/boyarsky

Twitter @jeanneboyarsky

Blog: http://www.selikoff.net

2 of 23

Ant

  • What the robot uses
  • An older build tool, but still updated
  • No internet access required

@jeanneboyarsky

3 of 23

Hello World

@jeanneboyarsky

4 of 23

More Targets

@jeanneboyarsky

5 of 23

Ant Contrib

@jeanneboyarsky

6 of 23

Your Robot

@jeanneboyarsky

7 of 23

WPI Lib’s Ant File

In <home>/wpilibj/java/current

@jeanneboyarsky

8 of 23

build.properties

@jeanneboyarsky

9 of 23

build.xml

@jeanneboyarsky

10 of 23

Examples

  • Written from scratch
    • https://github.com/Team694/java-education/blob/master/build.xml
    • https://github.com/Team694/cv-edu-2017/blob/master/build.xml
    • https://github.com/Team694/stuyvision-lib/blob/master/build.xml

@jeanneboyarsky

11 of 23

Maven

  • Needs internet first time to download
    • Itself
    • Dependencies
  • Convention over configuration
  • Standard lifecycle vs flexibility
  • Build at command line or with built in Eclipse plugin m2e

@jeanneboyarsky

12 of 23

Maven

  • Used by WPI in 2015 (now using gradle)
  • pom.xml specifies what want done

@jeanneboyarsky

13 of 23

An Eclipse plugin

https://github.com/wpilibsuite/EclipsePlugins/blob/master/edu.wpi.first.wpilib.plugins.java/pom.xml

@jeanneboyarsky

14 of 23

Gradle

  • Same internet/repository model as Maven
  • Uses Groovy as language instead of XML
  • Shorter ☺
  • Build at command line or with Eclipse plugin Buildship - https://projects.eclipse.org/projects/tools.buildship

@jeanneboyarsky

15 of 23

Smart Dashboard

https://github.com/wpilibsuite/SmartDashboard

@jeanneboyarsky

16 of 23

Plugins

@jeanneboyarsky

17 of 23

Dependencies

<home>/.m2 has the repository

@jeanneboyarsky

18 of 23

What should the build do?

@jeanneboyarsky

19 of 23

Publishing

@jeanneboyarsky

20 of 23

The End

@jeanneboyarsky

21 of 23

Downloading the Internet

@jeanneboyarsky

22 of 23

And the useful work

@jeanneboyarsky

23 of 23

Questions

?

Twitter: @jeanneboyarsky