Home » Newcomers » Newcomers » Build numbers
Build numbers [message #199761] |
Thu, 15 March 2007 15:59  |
Eclipse User |
|
|
|
Originally posted by: ns_dkerber.ns_WarrenRogersAssociates.com
Is there a way of getting eclipse to generate auto-incrementing version
or build numbers, as many IDE's do? The build number should increment
either every time I make a change and run, or at least every time I use
the "export" command to generate a .jar or .war file.
Ideally, they would somehow be written into the .war and .jar files I'm
exporting, but even if that can't be done, it would be nice to have them
stored and available somewhere in the eclipse UI so I can help track
versions and modifications without going to a full-blown source code
control system.
If this is something that can be scripted within eclipse, that would be
ok too, but I have no intention of learning to use ant to do my builds,
just to get this functionality.
--
Remove the ns_ from if replying by e-mail (but keep posts in the
newsgroups if possible).
|
|
|
Re: Build numbers [message #199789 is a reply to message #199761] |
Thu, 15 March 2007 17:31   |
Eclipse User |
|
|
|
Originally posted by: jacek.pospychala.pl.ibm.com
David,
it's not directly available as an option, but is easy to do:
Please add a custom ANT builder, and create a build.xml file that will
call BuildNumber task. This task will store build number in a properties
file and update it every time it's called. If you want the build number
to be increased every time, Eclipse performs build (eg. every file
save), you also have to indicate this in builder options.
Finally properties file can be included in your .jar file or anywhere
you want and accessed like any other properties.
In your project properties, on Builders tab add new builder, choose Ant
Build, and choose your Build file.
build.xml might look like:
<?xml version="1.0"?>
<project name="project" default="default">
<target name="default">
<buildnumber file="file.with.buildnumber.properies"/>
</target>
</project>
Please let me know if you have any further questions.
David Kerber wrote:
> Is there a way of getting eclipse to generate auto-incrementing version
> or build numbers, as many IDE's do? The build number should increment
> either every time I make a change and run, or at least every time I use
> the "export" command to generate a .jar or .war file.
>
> Ideally, they would somehow be written into the .war and .jar files I'm
> exporting, but even if that can't be done, it would be nice to have them
> stored and available somewhere in the eclipse UI so I can help track
> versions and modifications without going to a full-blown source code
> control system.
>
> If this is something that can be scripted within eclipse, that would be
> ok too, but I have no intention of learning to use ant to do my builds,
> just to get this functionality.
>
|
|
|
Re: Build numbers [message #199823 is a reply to message #199789] |
Thu, 15 March 2007 19:59   |
Eclipse User |
|
|
|
Originally posted by: ns_dkerber.ns_WarrenRogersAssociates.com
I'll give that a shot and post back if I have any trouble; thanks!!
In article <etcdvh$1p6$1@utils.eclipse.org>, jacek.pospychala@pl.ibm.com
says...
> David,
> it's not directly available as an option, but is easy to do:
> Please add a custom ANT builder, and create a build.xml file that will
> call BuildNumber task. This task will store build number in a properties
> file and update it every time it's called. If you want the build number
> to be increased every time, Eclipse performs build (eg. every file
> save), you also have to indicate this in builder options.
> Finally properties file can be included in your .jar file or anywhere
> you want and accessed like any other properties.
>
> In your project properties, on Builders tab add new builder, choose Ant
> Build, and choose your Build file.
>
> build.xml might look like:
> <?xml version="1.0"?>
> <project name="project" default="default">
> <target name="default">
> <buildnumber file="file.with.buildnumber.properies"/>
> </target>
> </project>
>
>
> Please let me know if you have any further questions.
>
>
> David Kerber wrote:
> > Is there a way of getting eclipse to generate auto-incrementing version
> > or build numbers, as many IDE's do? The build number should increment
> > either every time I make a change and run, or at least every time I use
> > the "export" command to generate a .jar or .war file.
> >
> > Ideally, they would somehow be written into the .war and .jar files I'm
> > exporting, but even if that can't be done, it would be nice to have them
> > stored and available somewhere in the eclipse UI so I can help track
> > versions and modifications without going to a full-blown source code
> > control system.
> >
> > If this is something that can be scripted within eclipse, that would be
> > ok too, but I have no intention of learning to use ant to do my builds,
> > just to get this functionality.
> >
>
--
Remove the ns_ from if replying by e-mail (but keep posts in the
newsgroups if possible).
|
|
|
Re: Build numbers [message #199858 is a reply to message #199823] |
Fri, 16 March 2007 11:05   |
Eclipse User |
|
|
|
Originally posted by: ns_dkerber.ns_WarrenRogersAssociates.com
Ok, I got a build number the very first time after I set this up, but
not since, and I tried recreating the build, and again it worked the
first time, but isn't running again when I change code and save. Here
is what I have:
I made a builder called "BuildNumberBuilder", specifying C:\PROJECTS
\workspace3.2.1\eddSrv\eddSrv.build.xml as my buildfile. Under build
options, I selected "Specify working set of relevant resources", and
selected the top-level project "eddSrv" as the resource. I also told it
to refresh the project contents after a build. Now when I change a
class and save it, I don't get a build number increment.
What am I missing in my setup? I did a bit of googling about Ant, but
couldn't find anything that helped; there isn't enough detail about how
to set things up in the buildfile, and especially not enough examples.
eddSrv.build.xm:
<?xml version="1.0"?>
<project name="eddSrv" default="default">
<target name="default">
<buildnumber
file="C:/PROJECTS/workspace3.2.1/eddSrv/eddSrv.build.number "/>
</target>
</project>
eddSrv.build.number:
#Build Number for ANT. Do not edit!
#Fri Mar 16 10:53:56 EDT 2007
build.number=2
In article <MPG.2063a807e4a189089896de@news.eclipse.org>,
ns_dkerber@ns_WarrenRogersAssociates.com says...
> I'll give that a shot and post back if I have any trouble; thanks!!
>
>
> In article <etcdvh$1p6$1@utils.eclipse.org>, jacek.pospychala@pl.ibm.com
> says...
> > David,
> > it's not directly available as an option, but is easy to do:
> > Please add a custom ANT builder, and create a build.xml file that will
> > call BuildNumber task. This task will store build number in a properties
> > file and update it every time it's called. If you want the build number
> > to be increased every time, Eclipse performs build (eg. every file
> > save), you also have to indicate this in builder options.
> > Finally properties file can be included in your .jar file or anywhere
> > you want and accessed like any other properties.
> >
> > In your project properties, on Builders tab add new builder, choose Ant
> > Build, and choose your Build file.
> >
> > build.xml might look like:
> > <?xml version="1.0"?>
> > <project name="project" default="default">
> > <target name="default">
> > <buildnumber file="file.with.buildnumber.properies"/>
> > </target>
> > </project>
> >
> >
> > Please let me know if you have any further questions.
> >
> >
> > David Kerber wrote:
> > > Is there a way of getting eclipse to generate auto-incrementing version
> > > or build numbers, as many IDE's do? The build number should increment
> > > either every time I make a change and run, or at least every time I use
> > > the "export" command to generate a .jar or .war file.
> > >
> > > Ideally, they would somehow be written into the .war and .jar files I'm
> > > exporting, but even if that can't be done, it would be nice to have them
> > > stored and available somewhere in the eclipse UI so I can help track
> > > versions and modifications without going to a full-blown source code
> > > control system.
> > >
> > > If this is something that can be scripted within eclipse, that would be
> > > ok too, but I have no intention of learning to use ant to do my builds,
> > > just to get this functionality.
> > >
> >
>
>
--
Remove the ns_ from if replying by e-mail (but keep posts in the
newsgroups if possible).
|
|
|
Re: Build numbers [message #199963 is a reply to message #199858] |
Fri, 16 March 2007 18:44   |
Eclipse User |
|
|
|
Originally posted by: jacek.pospychala.pl.ibm.com
In your ANT builder properties, go to "Targets" tab and set "Auto Build"
target.
David Kerber wrote:
> Ok, I got a build number the very first time after I set this up, but
> not since, and I tried recreating the build, and again it worked the
> first time, but isn't running again when I change code and save. Here
> is what I have:
>
> I made a builder called "BuildNumberBuilder", specifying C:\PROJECTS
> \workspace3.2.1\eddSrv\eddSrv.build.xml as my buildfile. Under build
> options, I selected "Specify working set of relevant resources", and
> selected the top-level project "eddSrv" as the resource. I also told it
> to refresh the project contents after a build. Now when I change a
> class and save it, I don't get a build number increment.
>
> What am I missing in my setup? I did a bit of googling about Ant, but
> couldn't find anything that helped; there isn't enough detail about how
> to set things up in the buildfile, and especially not enough examples.
>
>
> eddSrv.build.xm:
>
> <?xml version="1.0"?>
> <project name="eddSrv" default="default">
> <target name="default">
> <buildnumber
> file="C:/PROJECTS/workspace3.2.1/eddSrv/eddSrv.build.number "/>
> </target>
> </project>
>
>
> eddSrv.build.number:
>
> #Build Number for ANT. Do not edit!
> #Fri Mar 16 10:53:56 EDT 2007
> build.number=2
>
>
>
> In article <MPG.2063a807e4a189089896de@news.eclipse.org>,
> ns_dkerber@ns_WarrenRogersAssociates.com says...
>> I'll give that a shot and post back if I have any trouble; thanks!!
>>
>>
>> In article <etcdvh$1p6$1@utils.eclipse.org>, jacek.pospychala@pl.ibm.com
>> says...
>>> David,
>>> it's not directly available as an option, but is easy to do:
>>> Please add a custom ANT builder, and create a build.xml file that will
>>> call BuildNumber task. This task will store build number in a properties
>>> file and update it every time it's called. If you want the build number
>>> to be increased every time, Eclipse performs build (eg. every file
>>> save), you also have to indicate this in builder options.
>>> Finally properties file can be included in your .jar file or anywhere
>>> you want and accessed like any other properties.
>>>
>>> In your project properties, on Builders tab add new builder, choose Ant
>>> Build, and choose your Build file.
>>>
>>> build.xml might look like:
>>> <?xml version="1.0"?>
>>> <project name="project" default="default">
>>> <target name="default">
>>> <buildnumber file="file.with.buildnumber.properies"/>
>>> </target>
>>> </project>
>>>
>>>
>>> Please let me know if you have any further questions.
>>>
>>>
>>> David Kerber wrote:
>>>> Is there a way of getting eclipse to generate auto-incrementing version
>>>> or build numbers, as many IDE's do? The build number should increment
>>>> either every time I make a change and run, or at least every time I use
>>>> the "export" command to generate a .jar or .war file.
>>>>
>>>> Ideally, they would somehow be written into the .war and .jar files I'm
>>>> exporting, but even if that can't be done, it would be nice to have them
>>>> stored and available somewhere in the eclipse UI so I can help track
>>>> versions and modifications without going to a full-blown source code
>>>> control system.
>>>>
>>>> If this is something that can be scripted within eclipse, that would be
>>>> ok too, but I have no intention of learning to use ant to do my builds,
>>>> just to get this functionality.
>>>>
>>
>
|
|
|
Re: Build numbers [message #200108 is a reply to message #199963] |
Sat, 17 March 2007 15:57  |
Eclipse User |
|
|
|
Originally posted by: ns_dkerber.ns_WarrenRogersAssociates.com
That did it; thanks!
In article <etf6kd$e11$1@utils.eclipse.org>, jacek.pospychala@pl.ibm.com
says...
> In your ANT builder properties, go to "Targets" tab and set "Auto Build"
> target.
>
> David Kerber wrote:
> > Ok, I got a build number the very first time after I set this up, but
> > not since, and I tried recreating the build, and again it worked the
> > first time, but isn't running again when I change code and save. Here
> > is what I have:
> >
> > I made a builder called "BuildNumberBuilder", specifying C:\PROJECTS
> > \workspace3.2.1\eddSrv\eddSrv.build.xml as my buildfile. Under build
> > options, I selected "Specify working set of relevant resources", and
> > selected the top-level project "eddSrv" as the resource. I also told it
> > to refresh the project contents after a build. Now when I change a
> > class and save it, I don't get a build number increment.
....
--
Remove the ns_ from if replying by e-mail (but keep posts in the
newsgroups if possible).
|
|
|
Goto Forum:
Current Time: Fri Apr 25 23:40:36 EDT 2025
Powered by FUDForum. Page generated in 0.08333 seconds
|