Is there anyway to get Eclipse CDT to automatically increment your build version number every time you build your project? I can find solutions for ANT, but I understand that is only for Java projects.
No, ANT isn't only for java projects. It is mainly used for them, but you are confusing ANT for maven. Ant can be used with GCC and such, but then you can't use the eclipse build system.
Actually, there are a few commands that you can use with ant (use this inside a target):
<delete file="buildnumber.h"/>
<buildnumber file="ant-build-number.n"/>
<echo file="buildnumber.h">
#ifndef BUILDNUMBER_H_
#define BUILDNUMBER_H_
#define BUILD_NUMBER ${build.number}
#endif
</echo>
This will create a file named buildnumber.h and ant-build-number.n. Don't touch ant-build-number.n (it includes the build number for future builds). Then you may include buildnumber.h.
You can also use the exec task to execute gcc (see http://ant.apache.org/manual/Tasks/exec.html)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With