How can I make IDEA generate a build number automatically for my project?

So, that's the question. I want to just throw a build number somewhere in a file which is updated automatically by IDEA. I've thought of using the "pre-process" or "post-process" tabs on the artifact but I think the ant target doesn't get that info. Actually, I think maybe it cannot be done. Some plugin perhaps?

Any idea?

3 comments
Comment actions Permalink

Hello Sergi,

It's much better to use TeamCity rather than IntelliJ IDEA for this purpose.
TeamCity does have build numbering support.

So, that's the question. I want to just throw a build number somewhere
in a file which is updated automatically by IDEA. I've thought of
using the "pre-process" or "post-process" tabs on the artifact but I
think the ant target doesn't get that info. Actually, I think maybe it
cannot be done. Some plugin perhaps?

Any idea?


--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

On Tue, 26 Apr 2011 19:44:29 MSD, Sergi Baila <no_reply@jetbrains.com>
wrote, quoted or indirectly quoted someone who said :

>So, that's the question. I want to just throw a build number somewhere in a file which is updated automatically by IDEA. I've thought of using the "pre-process" or "post-process" tabs on the artifact but I think the ant target doesn't get that info. Actually, I think maybe it cannot be done. Some plugin perhaps?

Here are two possible approaches:

1. generate ANT files with the build number one of the properties.

2. put the build number in a static class. Make sure that each class
has some method that displays that build number.  It is up to you to
rebuild everything any time you change the build number.
--
Roedy Green Canadian Mind Products
http://mindprod.com
Politicians complain that Kindles and iBooks are killing jobs by
destroying the paper book industry.  I see it that they have create a way
to produce books for less than a third the cost without destroying forests
and emitting greenhouse gases in the process.  They have created wealth. 
They are encouraging literacy and cutting the costs of education. 


0

Please sign in to leave a comment.