FAQ
Hi,

I am writing some plugin/hack which needs all the build files that will be
used by Ant for the project [Multi-module project].

Something similar to this

My Project----- build.xml|----- Module 1

       ----- build.xml|----- Module 2
       ----- build.xml

and the build.xml is like this

<project name="test">
  <property name="project.name" value="test"/>

  <ant antfile="module1/build.xml" />
  <ant antfile="module2/build.xml" />
</project>

There's echoproperties task which can list out some useful information.

But it doesn't list out anything regarding `antfile` which can call
another build.xml



Any help is appreciated.

Search Discussions

  • Jan Matèrne (jhm) at Nov 18, 2015 at 7:32 am
    Hacking is always ... surprising ;) as you use APIs in way they weren't intended for.
    But it makes fun :O

    I am not sure if you can get these information during runtime.
    But collecting during a build and analyzing afterwards could be possible using a custom BuildListener.
    With that you get all meessages and could filter ...

    How could a build be invoked? <ant>, <subant>, <exec>, <java>, <script>, <macrodef> wrapping these, custom tasks ...
    Many possibilities.


    Jan

    -----Ursprüngliche Nachricht-----
    Von: nitin reddy
    Gesendet: Mittwoch, 18. November 2015 07:47
    An: user@ant.apache.org
    Betreff: How to get list of build files that will be executed for Ant
    build

    Hi,

    I am writing some plugin/hack which needs all the build files that will
    be used by Ant for the project [Multi-module project].

    Something similar to this

    My Project----- build.xml|----- Module 1

    ----- build.xml|----- Module 2
    ----- build.xml

    and the build.xml is like this

    <project name="test">
    <property name="project.name" value="test"/>

    <ant antfile="module1/build.xml" />
    <ant antfile="module2/build.xml" />
    </project>

    There's echoproperties task which can list out some useful information.

    But it doesn't list out anything regarding `antfile` which can call
    another build.xml



    Any help is appreciated.

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
    For additional commands, e-mail: user-help@ant.apache.org
  • Nitin reddy at Nov 18, 2015 at 11:04 am
    yes. that's the easy way. the biggest challenge is now you have to hack the
    build.
    So if the build is already done, the ship might have already left the shore
    :D

    I expected some task in ant to analyze the build files instead of running
    build, which might give the enough information of my requirement :-/
    On Wed, Nov 18, 2015 at 1:01 PM, Jan Matèrne (jhm) wrote:

    Hacking is always ... surprising ;) as you use APIs in way they weren't
    intended for.
    But it makes fun :O

    I am not sure if you can get these information during runtime.
    But collecting during a build and analyzing afterwards could be possible
    using a custom BuildListener.
    With that you get all meessages and could filter ...

    How could a build be invoked? <ant>, <subant>, <exec>, <java>, <script>,
    <macrodef> wrapping these, custom tasks ...
    Many possibilities.


    Jan

    -----Ursprüngliche Nachricht-----
    Von: nitin reddy
    Gesendet: Mittwoch, 18. November 2015 07:47
    An: user@ant.apache.org
    Betreff: How to get list of build files that will be executed for Ant
    build

    Hi,

    I am writing some plugin/hack which needs all the build files that will
    be used by Ant for the project [Multi-module project].

    Something similar to this

    My Project----- build.xml|----- Module 1

    ----- build.xml|----- Module 2
    ----- build.xml

    and the build.xml is like this

    <project name="test">
    <property name="project.name" value="test"/>

    <ant antfile="module1/build.xml" />
    <ant antfile="module2/build.xml" />
    </project>

    There's echoproperties task which can list out some useful information.

    But it doesn't list out anything regarding `antfile` which can call
    another build.xml



    Any help is appreciated.

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
    For additional commands, e-mail: user-help@ant.apache.org
  • Jan Matèrne (jhm) at Nov 18, 2015 at 11:31 am
    Analyzing would be quite hard as you can include sub-builds dynamically:
    <import file="${systemproperty}"/> override the name from the command line or otherwise imported property value.
    <subant> add an additional subdirectory ...

    Especially if you think of using properties, their value can come from outside ...

    So analyzing in a general way would not really practical.

    But if you want to rely on some conditions (all buildfiles are named as "build.xml", no use of dynamically imported files) much more should be possible.
    But you have to hack deep into the Ant core ...


    Jan
    -----Ursprüngliche Nachricht-----
    Von: nitin reddy
    Gesendet: Mittwoch, 18. November 2015 12:04
    An: Ant Users List
    Betreff: Re: How to get list of build files that will be executed for
    Ant build

    yes. that's the easy way. the biggest challenge is now you have to hack
    the build.
    So if the build is already done, the ship might have already left the
    shore :D

    I expected some task in ant to analyze the build files instead of
    running build, which might give the enough information of my
    requirement :-/
    On Wed, Nov 18, 2015 at 1:01 PM, Jan Matèrne (jhm) wrote:

    Hacking is always ... surprising ;) as you use APIs in way they
    weren't intended for.
    But it makes fun :O

    I am not sure if you can get these information during runtime.
    But collecting during a build and analyzing afterwards could be
    possible using a custom BuildListener.
    With that you get all meessages and could filter ...

    How could a build be invoked? <ant>, <subant>, <exec>, <java>,
    <script>, <macrodef> wrapping these, custom tasks ...
    Many possibilities.


    Jan

    -----Ursprüngliche Nachricht-----
    Von: nitin reddy
    Gesendet: Mittwoch, 18. November 2015 07:47
    An: user@ant.apache.org
    Betreff: How to get list of build files that will be executed for
    Ant build

    Hi,

    I am writing some plugin/hack which needs all the build files that
    will be used by Ant for the project [Multi-module project].

    Something similar to this

    My Project----- build.xml|----- Module 1

    ----- build.xml|----- Module 2
    ----- build.xml

    and the build.xml is like this

    <project name="test">
    <property name="project.name" value="test"/>

    <ant antfile="module1/build.xml" /> <ant
    antfile="module2/build.xml" /> </project>

    There's echoproperties task which can list out some useful
    information.
    But it doesn't list out anything regarding `antfile` which can call
    another build.xml



    Any help is appreciated.

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

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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categoriesant
postedNov 18, '15 at 6:47a
activeNov 18, '15 at 11:31a
posts4
users2
websiteant.apache.org

2 users in discussion

Nitin reddy: 2 posts Jan Matèrne (jhm): 2 posts

People

Translate

site design / logo © 2018 Grokbase