You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Mikael Petterson (KI/EAB)" <mi...@ericsson.com> on 2004/07/09 14:47:29 UTC
Advice on how to change buildfile structure
Hi,
I have a 4 buildfiles to build different subproducts. However I have found out that it is costly to update each one of the every time a
change ocurrs in e.g. compile target. I wish to have a generic compile, jar, init..... target that I can use in each build.
Any hints on how I can do this? All pointers and suggestions are very much welcome!!
Mikael
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: Advice on how to change buildfile structure
Posted by Nicolas Mailhot <Ni...@laPoste.net>.
Le ven, 09/07/2004 à 15:17 +0200, Stefan Bodewig a écrit :
> On Fri, 09 Jul 2004, Nicolas Mailhot <Ni...@laposte.net>
> wrote:
>
> > xslt is your friend
>
> If all you have is a hammer ... ;-)
>
> xslt can be used to solve almost all problems related to build files,
> but a lot of stuff can be done by Ant 1.6 features that had no
> equivalents in earlier versions. <import>, <macrodef>, <subant>,
> <presetdef> to just name a few.
Well, I guess someday I'll remove all ant 1.5 leftovers and move to the
brave new ant 1.6 world;)
--
Nicolas Mailhot
Re: Advice on how to change buildfile structure
Posted by Ivan Ivanov <ra...@yahoo.com>.
--- Stefan Bodewig <bo...@apache.org> wrote:
> On Fri, 09 Jul 2004, Nicolas Mailhot
> <Ni...@laposte.net>
> wrote:
>
> > xslt is your friend
>
> If all you have is a hammer ... ;-)
>
> xslt can be used to solve almost all problems
> related to build files,
> but a lot of stuff can be done by Ant 1.6 features
> that had no
> equivalents in earlier versions. <import>,
> <macrodef>, <subant>,
> <presetdef> to just name a few.
Stefan, and when Ant will have the task
<write_my_build_file_please> :))
>
> Stefan
> --
> http://stefanbodewig.blogger.de/
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
>
>
__________________________________
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: Advice on how to change buildfile structure
Posted by Stefan Bodewig <bo...@apache.org>.
On Fri, 09 Jul 2004, Nicolas Mailhot <Ni...@laposte.net>
wrote:
> xslt is your friend
If all you have is a hammer ... ;-)
xslt can be used to solve almost all problems related to build files,
but a lot of stuff can be done by Ant 1.6 features that had no
equivalents in earlier versions. <import>, <macrodef>, <subant>,
<presetdef> to just name a few.
Stefan
--
http://stefanbodewig.blogger.de/
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: Advice on how to change buildfile structure
Posted by Nicolas Mailhot <Ni...@laPoste.net>.
Le ven, 09/07/2004 à 14:47 +0200, Mikael Petterson (KI/EAB) a écrit :
> Hi,
>
> I have a 4 buildfiles to build different subproducts. However I have
> found out that it is costly to update each one of the every time a
> change ocurrs in e.g. compile target. I wish to have a generic
> compile, jar, init..... target that I can use in each build.
> Any hints on how I can do this? All pointers and suggestions are very
> much welcome!!
xslt is your friend
--
Nicolas Mailhot
Re: Advice on how to change buildfile structure
Posted by Stephen McConnell <mc...@apache.org>.
Mikael Petterson (KI/EAB) wrote:
> Hi,
>
> I have a 4 buildfiles to build different subproducts. However I have
> found out that it is costly to update each one of the every time a
> change ocurrs in e.g. compile target. I wish to have a generic
> compile, jar, init..... target that I can use in each build. Any
> hints on how I can do this? All pointers and suggestions are very
> much welcome!!
I strongly agree with what Ivan and Stefan suggested - start of with a
consistent structure across all of your projects and from here play
around with <import>. You can achieve a lot of modularization without
too much effort.
Cheers, Steve.
>
> Mikael
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For
> additional commands, e-mail: user-help@ant.apache.org
>
>
--
|---------------------------------------|
| Magic by Merlin |
| Production by Avalon |
| |
| http://avalon.apache.org |
|---------------------------------------|
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: Advice on how to change buildfile structure
Posted by Stefan Bodewig <bo...@apache.org>.
On Fri, 9 Jul 2004, roger day <ro...@gmail.com> wrote:
> On Fri, 9 Jul 2004 14:47:29 +0200 , Mikael Petterson (KI/EAB)
> <mi...@ericsson.com> wrote:
>> Hi,
>>
>> I have a 4 buildfiles to build different subproducts. However I
>> have found out that it is costly to update each one of the every
>> time a change ocurrs in e.g. compile target. I wish to have a
>> generic compile, jar, init..... target that I can use in each
>> build. Any hints on how I can do this? All pointers and
>> suggestions are very much welcome!!
> This isn't an answer, but another question: Can ant "do" xinclude?
The answer to both most probably is <import>.
<http://ant.apache.org/manual/CoreTasks/import.html>
Stefan
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: Advice on how to change buildfile structure
Posted by roger day <ro...@gmail.com>.
This isn't an answer, but another question: Can ant "do" xinclude?
Roger
On Fri, 9 Jul 2004 14:47:29 +0200 , Mikael Petterson (KI/EAB)
<mi...@ericsson.com> wrote:
> Hi,
>
> I have a 4 buildfiles to build different subproducts. However I have found out that it is costly to update each one of the every time a
> change ocurrs in e.g. compile target. I wish to have a generic compile, jar, init..... target that I can use in each build.
> Any hints on how I can do this? All pointers and suggestions are very much welcome!!
>
> Mikael
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
--
http://www.badstep.net
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: Advice on how to change buildfile structure
Posted by Ivan Ivanov <ra...@yahoo.com>.
Hi Mikael, you my find these ideas useful:
1) Impose realtively unified directory structure for
your projects, say your project sources are in
<project-root>/src directory, compiled classes are in
<project-root>/bin directory, third party jars are in
<project-root>/lib and the distributions of the
projected will be made in <project-root>/dist, where
<project-root> is the upper folder of your concrete
project.
2) Create for example a generic.xml that will contain
your "universal target":
<project name="generic" basedir="." default="usage">
<target name="usage">
<!-- Usage instructions here -->
</target>
<target name="-init" description="Initializes
neede d proeprties and taskdefs">
<property name="project.src"
value="${basedir}/src">
<property name="project.classes"
value="${basedir}/classes">
<property name="project.lib"
value="${basedir}/lib">
</target>
<target name="compile" depends="-init">
<javac srcdir="${project.src}
destdir="${project.classes}">
<claspath ....>
</javac>
<target>
<target name="jar" depends="compile">
...
</target>
<target name="dist" depends="jar"
description="Create distribution">
...
</target>
</project>
3) Import this file in the other projects with
<import> . Now you will have compile, jar and dist
targets in your projects automatically.
Note: If you have a rich variety of projects using
rich variety of technlogies, you may find difficult to
unify their file structure. You can use then a
property file, say generic.properties, that will
conatain and define the mutual properties of your
projects.
HTH Ivan.
P.S. I am eager to see other's people opnion too.
--- "Mikael Petterson (KI/EAB)"
<mi...@ericsson.com> wrote:
> Hi,
>
> I have a 4 buildfiles to build different
> subproducts. However I have found out that it is
> costly to update each one of the every time a
> change ocurrs in e.g. compile target. I wish to have
> a generic compile, jar, init..... target that I can
> use in each build.
> Any hints on how I can do this? All pointers and
> suggestions are very much welcome!!
>
> Mikael
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
>
>
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org