You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by weiji <na...@hotmail.com> on 2008/01/17 20:34:30 UTC

converting from DOS/Visual Studio to Ant for build

Hi,

Our current build process involves a DOS batch file to loop through a list
of solutions that we want to build, and invoking the command line Visual
Studio client to build each one.  We are interested in Ant as a replacement,
since we believe the logic control/conditional execution of targets will
come in very handy.  However, first we need to get it working as a
functional replacement for our current needs.

There are two parts we need to get working first.  The list of solutions to
build is manually maintained (and is a subset of the directories under our
solutions directory).  The first issue is to figure out how to pass this
list of solutions into Ant. The second issue is how to invoke the same
target for each solution, passing the name of the solution to the exec task.

Any suggestions or alternatives are highly appreciated.

Thanks in advance,
KaJun
-- 
View this message in context: http://www.nabble.com/converting-from-DOS-Visual-Studio-to-Ant-for-build-tp14930444p14930444.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: converting from DOS/Visual Studio to Ant for build

Posted by Steve Loughran <st...@apache.org>.
weiji wrote:
> Thanks DD -- we are mostly an MS shop, but we do have a mixed set of
> developers. I'm actually part of a dev group doing Java and we are already
> using Ant for our build process (javac, junit, javadocs, deployment, even
> some 3rd party tasks for compiling Adobe Flex code and remote ssh
> connections to our staging server) and the success of this build process is
> what is prompting our existing buildmasters to take a look.  So far they are
> very impressed, hence the desire to learn Ant rather than write a custom
> build tool on their own.
> 
> The problem is that we (and by "we" I really mean myself) don't have much
> prior experience with Ant, so "we" are learning it on the side (I picked up
> Steve Loughran's book "Ant in Action" which has helped tremendously).  I'd
> like to be able to stick with Ant since we already have some part of the
> company using it, and have one (very important) guy in the company as my
> advocate.
> 

Well, I guess I'd better help then.

The best way I've found to start VSS stuff is just to <exec with 
failonerror="true"> MSBUILD.exe with the right command line options to 
trigger the whole build of a composite solution. You leave your CI tool 
churning for 30 minutes and then you either get a list of C++ link 
errors, test failures or success.

The advantage of this approach is the VS folk can use the IDE to set 
everything up, while you can use Ant, Cruise Control, Hudson or similar 
to integrate the build with the rest of the project.

I haven't played with Ivy in this world...you could use Ivy to publish 
the native/.NET artifacts and pull them in to other projects...

-- 
Steve Loughran                  http://www.1060.org/blogxter/publish/5
Author: Ant in Action           http://antbook.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: converting from DOS/Visual Studio to Ant for build

Posted by Kevin Jackson <fo...@gmail.com>.
Hi,

> Thanks DD -- we are mostly an MS shop, but we do have a mixed set of
> developers. I'm actually part of a dev group doing Java and we are already
> using Ant for our build process (javac, junit, javadocs, deployment, even
> some 3rd party tasks for compiling Adobe Flex code and remote ssh
> connections to our staging server) and the success of this build process is
> what is prompting our existing buildmasters to take a look.  So far they are
> very impressed, hence the desire to learn Ant rather than write a custom
> build tool on their own.

NAnt or MSBuild are functionally very similar to Ant, so there's a
fair bit of crossover.

> The problem is that we (and by "we" I really mean myself) don't have much
> prior experience with Ant, so "we" are learning it on the side (I picked up
> Steve Loughran's book "Ant in Action" which has helped tremendously).  I'd
> like to be able to stick with Ant since we already have some part of the
> company using it, and have one (very important) guy in the company as my
> advocate.

If your co is fine having a Java build tool installed to build
.net/vis studio solutions, then Ant will probably be fine.  I've been
in situations where Ant was used for the Java builds and batch files
for the .net builds as the .net devs didn't want to install the jvm
that Ant requires.  You need to check how much resistance you'll get
from the people responsible for the .net side.

Having said that :)

For your described situation, you have a 'set' of directories, each
containing a .net/vis studio solution file? Then you can use <apply>
http://ant.apache.org/manual/CoreTasks/apply.html

Or for .net specific tasks (invoking a .net executable, building an msi etc)
http://ant.apache.org/antlibs/dotnet/index.html - although the docs
here don't contain everything available

If you have a problem when you've written your ant build file, let us know

Kev

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: converting from DOS/Visual Studio to Ant for build

Posted by weiji <na...@hotmail.com>.
Thanks DD -- we are mostly an MS shop, but we do have a mixed set of
developers. I'm actually part of a dev group doing Java and we are already
using Ant for our build process (javac, junit, javadocs, deployment, even
some 3rd party tasks for compiling Adobe Flex code and remote ssh
connections to our staging server) and the success of this build process is
what is prompting our existing buildmasters to take a look.  So far they are
very impressed, hence the desire to learn Ant rather than write a custom
build tool on their own.

The problem is that we (and by "we" I really mean myself) don't have much
prior experience with Ant, so "we" are learning it on the side (I picked up
Steve Loughran's book "Ant in Action" which has helped tremendously).  I'd
like to be able to stick with Ant since we already have some part of the
company using it, and have one (very important) guy in the company as my
advocate.

Regards,
KaJun


Dominique Devienne-2 wrote:
> 
> 
> Unless you also have Java code to build, NAnt or msbuild directly may
> be better suited to your needs. Ant can do it, and there's an Antlib
> to deal specifically with Visual Studio and .NET stuff, since it
> sounds you are Windows only, Ant+Java may not be the best fit. Just my
> $0.02. --DD
> 
> 

-- 
View this message in context: http://www.nabble.com/converting-from-DOS-Visual-Studio-to-Ant-for-build-tp14930444p14938028.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: converting from DOS/Visual Studio to Ant for build

Posted by Dominique Devienne <dd...@gmail.com>.
On Jan 17, 2008 1:34 PM, weiji <na...@hotmail.com> wrote:
> Our current build process involves a DOS batch file to loop through a list
> of solutions that we want to build, and invoking the command line Visual
> Studio client to build each one.  We are interested in Ant as a replacement,
> since we believe the logic control/conditional execution of targets will
> come in very handy.  However, first we need to get it working as a
> functional replacement for our current needs.
>
> There are two parts we need to get working first.  The list of solutions to
> build is manually maintained (and is a subset of the directories under our
> solutions directory).  The first issue is to figure out how to pass this
> list of solutions into Ant. The second issue is how to invoke the same
> target for each solution, passing the name of the solution to the exec task.
>
> Any suggestions or alternatives are highly appreciated.

Unless you also have Java code to build, NAnt or msbuild directly may
be better suited to your needs. Ant can do it, and there's an Antlib
to deal specifically with Visual Studio and .NET stuff, since it
sounds you are Windows only, Ant+Java may not be the best fit. Just my
$0.02. --DD

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: converting from DOS/Visual Studio to Ant for build

Posted by Dominique Devienne <dd...@gmail.com>.
On Jan 17, 2008 2:00 PM, Jack J. Woehr <jw...@absolute-performance.com> wrote:
> Many ways to do this. One naive algorithm:
>
>         1. Pass in list of solutions as an ant Property
>                 * i.e., string with some internal delimiter repeated between solutions
>         2. Use AntContrib's 'foreach' logic task to iterate over solutions

If you decide on using Ant, rather use <apply> and filesets than loops. --DD

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: converting from DOS/Visual Studio to Ant for build

Posted by "Jack J. Woehr" <jw...@absolute-performance.com>.
On Jan 17, 2008, at 12:34 PM, weiji wrote:

> The first issue is to figure out how to pass this
> list of solutions into Ant.

Many ways to do this. One naive algorithm:

	1. Pass in list of solutions as an ant Property
		* i.e., string with some internal delimiter repeated between solutions
	2. Use AntContrib's 'foreach' logic task to iterate over solutions

For 'foreach' see http://ant-contrib.sourceforge.net/ant-contrib/ 
manual/tasks/foreach.html

The confusing thing about pure Ant is that it is more declarative  
than procedural. AntContrib
optional Logic tasks make certain activities easier for those more  
oriented towards
procedural coding.

-- 
Jack J. Woehr
Director of Development
Absolute Performance, Inc.
jwoehr@absolute-performance.com
303-443-7000 ext. 527



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: converting from DOS/Visual Studio to Ant for build

Posted by Alexey Solofnenko <A....@mdl.com>.
We did the opposite - converted all ANT scripts that build .Net and C++ 
code into a VisualStudio build (that we execute from ANT script itself). 
The main reason is to avoid double maintenance. It is useful to have a 
single "build" solution that builds only necessary (for delivery or for 
tasting) projects. We also implemented extra build steps using MSBuild 
commands and put them in the project files themselves (in fact one of 
the project even runs ANT to build prerequisites). There were many 
complains from people from other groups that it was difficult to build 
my project's Windows applications - now all necessary parts are done by 
just pressing build or run from VisualStudio.

I would advise against porting VisualStudio build to ANT - VisualStudio 
build is usually enough and it and ANT builds can call each other 
without any problem.

- Alexey.

weiji wrote:
> Hi,
>
> Our current build process involves a DOS batch file to loop through a list
> of solutions that we want to build, and invoking the command line Visual
> Studio client to build each one.  We are interested in Ant as a replacement,
> since we believe the logic control/conditional execution of targets will
> come in very handy.  However, first we need to get it working as a
> functional replacement for our current needs.
>
> There are two parts we need to get working first.  The list of solutions to
> build is manually maintained (and is a subset of the directories under our
> solutions directory).  The first issue is to figure out how to pass this
> list of solutions into Ant. The second issue is how to invoke the same
> target for each solution, passing the name of the solution to the exec task.
>
> Any suggestions or alternatives are highly appreciated.
>
> Thanks in advance,
> KaJun
>   

-- 
------------------------------------------------------------------------
Alexey N. Solofnenko <http://trelony.cjb.net/>
Pleasant Hill, CA (GMT-8 usually)