ant, maven and gradle (and may be cmake)

Development environment specific, Arduino, Eclipse, VS2013, Em::Blocks etc
Post Reply
ag123
Posts: 1653
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

ant, maven and gradle (and may be cmake)

Post by ag123 »

i know this screams of 'java'.

ant has for the longest time been used to build java apps
https://ant.apache.org/
for one there is cpptasks, and few more
http://ant-contrib.sourceforge.net/cpptasks/
http://axis.apache.org/axis/cpp/antbuild-guide.html
http://codemesh.com/products/junction/doc/ant_cpp.html

then there is maven, again java centric
https://maven.apache.org/
maven is patterned after a default set of build steps called the life-cycle
https://maven.apache.org/guides/introdu ... cycle.html
and those things that run in a particular step are actually the *plugins*, it is confusing when i started learning it but basically this is the gist
the good thing about maven is it is designed to pull dependencies from a repository in a standard format
https://search.maven.org/
i'd guess that's why a lot of large java frameworks such as spring are build around maven and gradle
for maven the c++ stuff are in the 'nar' extensions
https://stackoverflow.com/questions/154 ... c-projects
http://maven-nar.github.io/index.html

then there is gradle
https://gradle.org/
i've not used gradle but that apparently it is intended to be 'superior' vs maven
https://gradle.org/maven-vs-gradle/
and accordingly there are plugins for c++
https://docs.gradle.org/current/usergui ... jects.html
https://discuss.gradle.org/t/c-c-cross- ... -gcc/13688

an 'honorable' mention is CMake. unfortunately, CMake is more of a 'makefile generator'.
while the above java replacements are 'make' replacements.

has anyone ventured with these?
the context of using these is due to that makefiles tend to be 'unix' (or 'linux') specific. and Windows seemed to be left in the cold with makefiles.
ant, maven, gradle are 'cross-platform' kind of.
gradle seem to have some 'enterprise' extension that seemed to be licensed differently. i'm not too sure if the lack of adoption is due to licensing issues.
BennehBoy
Posts: 135
Joined: Sat Jan 04, 2020 2:38 am
Answers: 1

Re: ant, maven and gradle (and may be cmake)

Post by BennehBoy »

Makefiles work just fine on windows. There've been many ways over the years to build a 'nix' like subsystem to allow make (and standard unix tools that make might call, ls, rm, etc etc), cygwin, msys, msys2, and even WSL. I uses MSYS2 without any issue.
feluga
Posts: 64
Joined: Wed Mar 18, 2020 2:50 am

Re: ant, maven and gradle (and may be cmake)

Post by feluga »

For Win10, I use CMake + NMake.
Both work very well for generating Makefile and building embedded applications (AVR, ARM and now with RP2040).

I used ANT with linux a long time ago for J2ME applications.
I used Maven and currenlty use Gradle for building Android applications in Linux and Windows.
Never used any of those for embedded software.
ag123
Posts: 1653
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: ant, maven and gradle (and may be cmake)

Post by ag123 »

i think nmake is a well known defacto make tool on WIndows.
just that nmake is normally bundled with visual studio suite of applications. I'm not sure if microsoft provides a download for it.

it is good to hear that make works on windows. i'd guess it is part of the mingw32 suite of tools/utilities
https://sourceforge.net/projects/mingw/ ... ke-3.80-3/

a main annoyances are the small differences between unix (linux) and windows. e.g. in linux paths are separated by forwarded slashes, while in windows back slashes. and that in windows a new line is normally carriage return + line feed, while unix (linux) use just a line feed.
i think there are some other differences such as that the windows path seemed to have a 256 char limit (arduino ide 2.0 development seemed to be struggling with some major bummers related to that). these annoyances can be problematic as makefiles usually use pattern globing to match specific patterns for the match and does substitutions. i'd guess the mingw32 makes did some 'translations' to handle the os differences between '/' forward slash handling in unix/linux vs wndows '\' backslash handling.

another poor thing about make is that directory recursion requires a lot of pattern substitution hacks and i used those with my makefiles
viewtopic.php?f=41&t=183

accordingly those tools such as ant if you review the overview are developed to overcome the shortcomings of make, that would include the directory recursion and cross-platform(ness) of the features.

cmake is good but that it has a dependency on make as it is a makefile generator

that 'maven repository' thing has some real use due to its well known structure and supported tools
https://gist.github.com/fernandezpablo8 ... e7d8527063
the use cases are quite a lot as for instance required dependencies can be pulled from remote repositories
this could for instance allow packaging of the core dependencies say by the soc family stm32f3 vs stm32f4 so that only that particular required set of dependencies is downloaded for a particular project.
in the same way maven has not caught on in the 'arduino industry'. i'd guess it is due to initiatives by arduino.cc to build arduino-cli and the related ide's.
BennehBoy
Posts: 135
Joined: Sat Jan 04, 2020 2:38 am
Answers: 1

Re: ant, maven and gradle (and may be cmake)

Post by BennehBoy »

Post Reply

Return to “IDE's”