Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > ant inheritance

Reply
Thread Tools

ant inheritance

 
 
Greg
Guest
Posts: n/a
 
      07-05-2012
I am trying to build an ant build system where each component builds the things that it depends on. Each thing that they depend on are in different build files. Subsequently, I use the include task. However, I run in to a problem when say component 1 needs to build component 2 and component 2 needs to build component 3. Ant tells me that when I told it to build component 1 that it doesn't know the targets in component 3. How do I get 1 to inherit the includes all the way down the line without explicitly telling it about all the components that anyone depends on?
 
Reply With Quote
 
 
 
 
Lew
Guest
Posts: n/a
 
      07-05-2012
On Thursday, July 5, 2012 11:30:37 AM UTC-7, Greg wrote:
> I am trying to build an ant build system where each component builds the things that it depends on. Each thing that they depend on are in differentbuild files. Subsequently, I use the include task. However, I run in to a problem when say component 1 needs to build component 2 and component 2 needs to build component 3. Ant tells me that when I told it to build component 1 that it doesn't know the targets in component 3. How do I get 1 to inherit the includes all the way down the line without explicitly telling it about all the components that anyone depends on?


Hmm. I think that it might help for you to post the build.xml.

You might just have some subtly off way of invoking things.

Without details of your project structure and how you're trying
to do things now, it's hard to suggest anything other than Ant
subtasks.

The build.xml for component 1 should not be hitting any targets
in the component 3 build.xml, nor even in the component 2 build.xml.

ANother way and likely better is to configure the antecedent
projects as libraries, which if they really are components as you
claim should be straightforward. If it isn't straightforward, perhaps
they aren't really components.

Then make the JAR files for each library as dependencies for the project(s)
that relies(y) on them.

--
Lew
 
Reply With Quote
 
 
 
 
Greg
Guest
Posts: n/a
 
      07-05-2012
On Thursday, July 5, 2012 11:30:37 AM UTC-7, Greg wrote:
> I am trying to build an ant build system where each component builds the things that it depends on. Each thing that they depend on are in differentbuild files. Subsequently, I use the include task. However, I run in to a problem when say component 1 needs to build component 2 and component 2 needs to build component 3. Ant tells me that when I told it to build component 1 that it doesn't know the targets in component 3. How do I get 1 to inherit the includes all the way down the line without explicitly telling it about all the components that anyone depends on?


File 1
>>>

<?xml version="1.0" encoding="UTF-8"?>
<project name="hpic4vctest" default="build" basedir=".">
<include file="build.xml" as="common"/>
<target name="build" depends="common.build"/>
</project>
<<<<

File 2
>>>

<?xml version="1.0" encoding="UTF-8"?>
<project name="hpic4vc" default="build" basedir=".">
<!--
===================
COMPILATION SECTION
===================
-->

<include file="testsub/buildcpy.xml" as="nested"/>
<target name = "createBinaryDir">
<echo>I am build file 1's depend</echo>
</target>

<target name = "compile" depends="createBinaryDir, nested.do2">
<echo>I am build file 1 located in ${basedir}</echo>
</target>

<target name = "build">
<property file="build.properties"/>
<antcall target="compile"/>
</target>


</project>
>>>>


File 3
<<<<<

<?xml version="1.0" encoding="UTF-8"?>
<project name="hpic4vc2" default="compile" basedir=".">
<dirname property="hpic4vc2.basedir" file="${ant.file.hpic4vc2}"/>
<property file="${hpic4vc2.basedir}/build.properties"/>
<!--
===================
COMPILATION SECTION
===================
-->
<target name = "createBinaryDir">
<echo>I am build file 2's depend</echo>
</target>

<target name = "compile" depends="createBinaryDir">
<echo>I am build file 2</echo>
</target>
<target name = "do2" depends="compile">
<echo>I am build file 2</echo>
<echo>${hpic4vc2.basedir}</echo>
<echo>VAR: ${test}</echo>
</target>

</project>
>>>>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run ant script from ant script? lionelv@gmail.com Java 6 07-26-2007 02:12 AM
error runing ant in eclipse ant view yihucd@gmail.com Java 1 03-07-2006 08:39 PM
trouble with Hibernate and Ant (probably just Ant) john martin Java 2 04-07-2005 09:27 PM
wondering how i can launch tomcat from ant without ant hanging... Chris Bedford Java 6 12-23-2004 12:41 AM
Private access modifier and Inheritance (Inheritance implementation in Java) maxw_cc Java 1 12-21-2003 11:38 AM



Advertisments