I'm proposing to switch to gradle for building Traffic Router
Maven's been a fairly reliable build system however it's drawbacks are:
- It's build files are verbose and get large quickly, they become a headache to read
- It's output gets rather noisy and at times it can be a headache to find out what's actually wrong
- If you want to do something with your build that's not typical for Maven you have to find a plugin that hopefully does what you want
- You cannot build rpm's with maven on Mac OS X
Here's the current experience of building Traffic Router with maven on my dev laptop
Gradle addresses each of the above
- It's DSL leads to much more succinct build files
- It's output is much more reasonable to look through to find out what's wrong with a build
- It's super easy to customize the build by writing little bits of Groovy code in your build files
- You can build rpm's with gradle on Mac OS X
I tested the building of the traffic router rpm with gradle by comparing the rpm it created with the one created on a linux host running the traffic router maven file.
I used rpm2cpio and cpio to inspect and validate the contents of both rpm's
Here's the experience of building Traffic Router with gradle on my dev laptop
Notes:
- The messages like 'Running CacheLocationComparatorTest - testCompareOneLocNull' was something I added.
This way when some of the longer running end to end tests execute you do get some indication of what's happening
- I think it'd be not difficult to make gradle output a line for only
- The gradle build by default also builds the traffic router rpm
Here's the current experience of building Traffic Router with gradle on my dev laptop
I've also updated the Dockerfile in traffic_router/build
The build_rpm.sh isn't necessary anymore but I've left it in place for the moment.
The top level docker-build.sh script will need to add a few more environment variables to the docker run command for traffic router
so that integration tests will pass (allowing communications to an external traffic monitor and traffic ops).
Here's the public link to my branch that's using gradle.
Note that both of the console videocasts above were building off this same branch
Pull this branch and give it a try, lots of feedback welcome.
Cheers,
Trevor Ackerman