Gradle, Maven, Ant, other build tools and History

Introduction

While the components of a python program are installed with pip install or similar, the components of any compiled program (such as kotlin) need to be combined together or ‘built’ using a build tool. This page gives an overview of build tools, while other pages in the build section of this site explain how to actually build Kotlin programs using the recommended build tool: Gradle.

Make

One of the oldest build tools was ‘make’, from unix.

Overview:
The make utility is a software engineering tool for managing and maintaining computer programs. Make provides most help when the program consists of many component files. As the number of files in the program increases so to does the compile time, complexity of compilation command and the likelihood of human error when entering command lines, i.e. typos and missing file names.

https://edoras.sdsu.edu/doc/make.html

Make is available in Windows, MacOS, and Linux or most operating systems where a developer might develop code, and would be considered the standard build tool for the c language.

Make uses makefiles to describe how to build or ‘make’ a program, and decalres rules, and the rules themselves are largely procedural. This means that for each file type, the commands to be run are specified as a sequence of steps.

Ant (Apache Ant)

Created around the year 2000, the Ant build tool was written in Java and is most often associated with building Java projects although it can be used to build programs in any language. Ant was built to improve on make, and add cross platform support together with being designed to support unit tests being run in the make process. Ant uses XML to describe the project being built, and was the first open source built tool.

Maven (Apache Maven)

Released in 2004, Apache Maven added the concept of an online repository of ‘artifacts’ (components needed by to build a project) and the Maven central repository. Another change was the use of build conventions, allowing simplifying the build process, and allows only describing the exceptions to convention. Given there are many conventions in Java builds, this reduced the XML file complexity.

Gradle

Released in 2007, the biggest step forward made by gradle was describing replacing XML to describe the ptroject with using a DSL built with the Groovy language. The groovy DSL allows both more descriptive builds, and being a DSL built within a programming language, also allows the felxibility and power of procedural code and object definitions within the project files. Gralde keeps the main step forward of Maven: support for maven repositories.

The designer of gradle was disapointed with the tooling support possble with a DSL built on a dynamic language, and shortcoming now addressed with support for a Kotlin based DSL, which reached version 1.0 in 2018.

Gradle provides combines the best of Maven with support for multiplatform, and a far more flexible, expressive and powerful syntax for describing projects with the move from XML to a DSL. Now, with the move to Kotlin DSL Gradle and improved tooling support, Gradle offers a solution from the smallest to the largest project, and from Intellij 19.1, becomes the default for all projects, replacing the solution of a custom to Intellij build system for simple projects, and the need to change the build process as projects grew.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s