@jeanneboyarsky “Java is Still Free” • Free for non-production use • For Prod use 20 minute version: https://medium.com/@javachampions/java- is-still-free-2-0-0-6b9aa8d6d244 7
@jeanneboyarsky Find the build tool? 10 Saw? Band Saw? CNC Machine? x Not automated x Automation != Electricity ✔Programming x But doesn’t create executable
@jeanneboyarsky Quick Comparison 13 Ant Maven Gradle Released 2000 2004 2007 Build file build.xml pom.xml build.gradle Language XML XML Groovy Dependency mgmt? Not native Yes Yes
@jeanneboyarsky Phases 19 Initialization Counts gradle projects (1 Robot) Configuration Parses the build script Execution Determines which tasks to execute and does so
@jeanneboyarsky Key Gradle Files 23 File Description build.gradle The build script gradlew Gradle wrapper so can run without installing Gradle on Mac/Linux gradlew Same for Windows settings.gradle Sets projects specific config before build runs
@jeanneboyarsky Multi Line String def name = 'Jeanne' def text = """ Name ______ $name """ println text 46 Coming soon to Java with new syntax Name ______ Jeanne
@jeanneboyarsky ArrayList++ 53 def list = ['cookie', 'chocolate’] list << 'candy' println list.getClass() class java.util.ArrayList println list[1] chocolate ArrayList does what now?
@jeanneboyarsky Named Params def config = new SelectorConfiguration( name: ‘selector', description: ‘packages', ) 57 Only the default constructor exists!
@jeanneboyarsky Alfred vs Edwin File file = new File("src/main/java/frc/robot/RobotMap.java") System.out.println("=========================") if(file.text.contains('ROBOT_NAME = "Alfred"')) { System.out.println("Built to ALFRED!!!") } else if(file.text.contains('ROBOT_NAME = "Edwin"')) { System.out.println("Built to EDWIN!!!") } else { System.out.println("[ATTENTION] Look at RobotMap and make sure you have robot name set!") throw new IllegalStateException("Robot Name Not Found"); } System.out.println("=========================") 58