Kathy Lee Simunich Bldg 203 D120 https bluejeanscom 927663739 Brought to you by Argonne Java Users Group Blogsanlgov java membershipform From Make to Gradle GNU Make Originally for building CC Fortran compiled and linked languages ID: 638981
Download Presentation The PPT/PDF document "Build Systems Presentation December 14,..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
Slide1
Build Systems
Presentation December 14, 2015 Noon-1pmKathy Lee SimunichBldg. 203/ D120https://bluejeans.com/927663739
Brought to you by:
Argonne Java Users Group
Blogs.anl.gov
/java/
membershipformSlide2
From Make to Gradle
GNU MakeOriginally for building C/C++, Fortran (compiled and linked languages)Platform specific builds (need Autoconf)Apache AntOriginated to build Tomcat in early 2000’sApache Maven
Originated from Jakarta Alexandria project 2001Gradle (gradle.org)
Build automation from command line to IDE to Continuous IntegrationSlide3
Apache Ant
Implemented in Java, best suited for building java projectsBuilt into IDEs for running build scriptsUses XML to describe the build processPlatform-independent tool (unlike Make)Integrates JUnit testing in the build processAnt is not good with complex programming
constructs: need to write extension tasks in Java for more more complex build logic or GUIsMust build in explicit target dependencies – including all jarfiles and their dependencies
Apache Ivy addition to provide jar dependency management in 2007Slide4
Dependency Management with
Whereas Ant makes developers to specify every target/task, Maven was designed to standardized common project/build life-cyclesMavenCentral is a code repository for almost all open source jar files.Instead of having copies of say, Xerces, in every one of your Java projects, Maven will automatically download your dependent jar file PLUS any jars that jar is dependent upon –
saving space in your SVN/Git repository, as it is stored in a common dir that your IDE points to so that the jar is shared across projects (~/.m2)
This also helps with version management, as the dependency tree specifies version as part of the process (artifacts)Slide5
Maven Control of the Life Cycle
Based on the Project Object Model (pom.xml) and guidelines for “best practices”Shared plugin repositoryDependencies are defined: groupId (organization), artifactId (name of the jar/project), version.Goals are defined (instead of targets)
Unified directory structure:src/main/java, src
/main/resourcessrc/test/java, src/test/resources
Build artifacts in target directorySlide6
Using Maven
Included in Eclipse IDE (m2): POM editor, Maven project nature, m2 Run ConfigurationCan specify plugins for compilers, reporting, and code generation.Limitations include rather strict project setup, difficult to extend/write plugins, still uses XML as the build “language”Slide7
Joins the Scene
Created in 2009, built upon the good parts of ant and mavenDefaults to Maven’s file structure, but easily modifiedAccesses Maven repositories for jar dependencies (or any public or local maven repository). Jars are downloaded in ~/.gradle and sharable across projects
Downloads the source jar (if included) for debuggingNo mo’ XML: gradle.build file is a Groovy-based Domain Specific Language (DSL)
Plugins for JVM-based languages (Java, Groovy, Scala)Slide8
Using
Eclipse gradle plugin needs to be installed – may or may not need command line.Gradle plugins for java, eclipse and wtp set up the eclipse environment or eclipse web tool project files (.project, .classpath,
web.xml)Introduces “scope” to the dependencies (jar needed for testing vs compile vs
runtime)Can call any ant task (integrated into gradle) and reuse any ant build file. Most common tasks are built-in.Build tool of choice for Android projects
Can extend tasks with inline groovy code, so no need for external task coding
Integrates build life cycle tools (
e.g
Jenkins,
JBoss, github
, amazon web services, hadoop)