You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by xjschwen <xj...@gmail.com> on 2009/11/18 22:56:39 UTC
What was the ANT Command Line?
Hi,
I have a new requirement that I am trying to fill in build scripts.
One of the our release engineers would like to know and have written to the
recorded log file what was the ANT command and called targets that were
given to ANT.
Ideally I would like to do this without creating a wrapper around the call
to ant.
Is there a way without creating the wrapper script?
The basic idea would be to read the log file and get an exact command that
was executed in creating the log. This is to help verify that we can
replicate any build at any time.
--
View this message in context: http://old.nabble.com/What-was-the-ANT-Command-Line--tp26416508p26416508.html
Sent from the Ant - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: What was the ANT Command Line?
Posted by xjschwen <xj...@gmail.com>.
I have found a pretty good solution... Since has been posted a couple of
times over the last few years here is what I found.
When you run "ANT" from a windows box it actually runs ANT.bat from the
%ANT_HOME%\bin\ folder. This is the wrapper script and they already "slurp"
up the command line into a variable called "ANT_CMD_LINE_ARGS"
So from there a quick import of the environment vars with
<property environment ="env"/>
at the top of the build file and this line inserted some time after the
record statement
<echo>ANT ${env.ANT_CMD_LINE_ARGS}</echo>
and I have now recorded the command line that was used to create the build
in the first place.
I did notice that the runAnt.bat and other forms or runAnt did not use the
same variable so this might not work as well if you are using the runANT
flavor of launch scripts.
--
View this message in context: http://old.nabble.com/What-was-the-ANT-Command-Line--tp26416508p26421369.html
Sent from the Ant - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: What was the ANT Command Line?
Posted by xjschwen <xj...@gmail.com>.
Thanks for the reply...
Although we are still carving our our build commands using a hammer and
chisel on stone tablet. We get a build request and have to trigger the
build by hand using our brains to figure out what the command should be
based on an excel build sheet.
we are no where ready for anything that would be automatic like Hudson or
Cruise Control... but the natives are getting restless with this process.
David Weintraub wrote:
>
> You can usually capture the STDOUT of a terminal in any software.
> However, for what you want to do, get Hudson as a build server, and
> use it. Hudson will help make sure you're executing the same build,
> and it records every step of the process. For example:
>
> =================================================================
> Started by upstream project "ADS-5.3.2.1" build number 37
> Updating http://subversion.solbright.com/dev/modules/adapter/trunk
> At revision 57844
> no change for http://subversion.solbright.com/dev/modules/adapter/trunk
> since the previous build
> [adapter] $ ant -Dclient.version=5.3.2.1-SNAPSHOT
> -Dversion=1.6-D-$BUILD_NUMBER clean deploy junit
> Buildfile: build.xml
>
> clean:
> [delete] Deleting directory
> /solbright/home/hudson/workspace/ADAPTER-1.6/adapter/target
>
> =================================================================
>
> The above is taken directly from my build process. You can see the
> revision of Subversion used (57844) and the entire Ant command line
> (ant -Dclient.version=5.3.2.1-SNAPSHOT -Dversion=1.6-D-$BUILD_NUMBER
> clean deploy junit). It even tells you why it is building (There was a
> change in job ADS-5.3.2.1, and this was kicked off after Build #37 was
> done).
>
> Hudson can be setup to trigger a build automatically on a source code
> change, at particular times, by another process, or manually. It can
> label your source code, move your built files to your build server,
> run tests, etc.
>
> See http://hudson.dev.java.net/.
>
> On Wed, Nov 18, 2009 at 4:56 PM, xjschwen <xj...@gmail.com> wrote:
>>
>> Hi,
>>
>> I have a new requirement that I am trying to fill in build scripts.
>>
>> One of the our release engineers would like to know and have written to
>> the
>> recorded log file what was the ANT command and called targets that were
>> given to ANT.
>>
>> Ideally I would like to do this without creating a wrapper around the
>> call
>> to ant.
>>
>> Is there a way without creating the wrapper script?
>>
>> The basic idea would be to read the log file and get an exact command
>> that
>> was executed in creating the log. This is to help verify that we can
>> replicate any build at any time.
>>
>>
>> --
>> View this message in context:
>> http://old.nabble.com/What-was-the-ANT-Command-Line--tp26416508p26416508.html
>> Sent from the Ant - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>> For additional commands, e-mail: user-help@ant.apache.org
>>
>>
>
>
>
> --
> David Weintraub
> qazwart@gmail.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
>
--
View this message in context: http://old.nabble.com/What-was-the-ANT-Command-Line--tp26416508p26418003.html
Sent from the Ant - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: What was the ANT Command Line?
Posted by David Weintraub <qa...@gmail.com>.
You can usually capture the STDOUT of a terminal in any software.
However, for what you want to do, get Hudson as a build server, and
use it. Hudson will help make sure you're executing the same build,
and it records every step of the process. For example:
=================================================================
Started by upstream project "ADS-5.3.2.1" build number 37
Updating http://subversion.solbright.com/dev/modules/adapter/trunk
At revision 57844
no change for http://subversion.solbright.com/dev/modules/adapter/trunk
since the previous build
[adapter] $ ant -Dclient.version=5.3.2.1-SNAPSHOT
-Dversion=1.6-D-$BUILD_NUMBER clean deploy junit
Buildfile: build.xml
clean:
[delete] Deleting directory
/solbright/home/hudson/workspace/ADAPTER-1.6/adapter/target
=================================================================
The above is taken directly from my build process. You can see the
revision of Subversion used (57844) and the entire Ant command line
(ant -Dclient.version=5.3.2.1-SNAPSHOT -Dversion=1.6-D-$BUILD_NUMBER
clean deploy junit). It even tells you why it is building (There was a
change in job ADS-5.3.2.1, and this was kicked off after Build #37 was
done).
Hudson can be setup to trigger a build automatically on a source code
change, at particular times, by another process, or manually. It can
label your source code, move your built files to your build server,
run tests, etc.
See http://hudson.dev.java.net/.
On Wed, Nov 18, 2009 at 4:56 PM, xjschwen <xj...@gmail.com> wrote:
>
> Hi,
>
> I have a new requirement that I am trying to fill in build scripts.
>
> One of the our release engineers would like to know and have written to the
> recorded log file what was the ANT command and called targets that were
> given to ANT.
>
> Ideally I would like to do this without creating a wrapper around the call
> to ant.
>
> Is there a way without creating the wrapper script?
>
> The basic idea would be to read the log file and get an exact command that
> was executed in creating the log. This is to help verify that we can
> replicate any build at any time.
>
>
> --
> View this message in context: http://old.nabble.com/What-was-the-ANT-Command-Line--tp26416508p26416508.html
> Sent from the Ant - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
--
David Weintraub
qazwart@gmail.com
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org