Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #15828
| From | Greg <shireyg@gmail.com> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: ant inheritance |
| Date | 2012-07-05 13:22 -0700 |
| Organization | http://groups.google.com |
| Message-ID | <757f6740-2dc7-429b-a00b-6a6a6b4fba17@googlegroups.com> (permalink) |
| References | <7006151c-c613-4418-ba50-95f7c524a765@googlegroups.com> |
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 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?
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>
>>>>
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Find similar | Unroll thread
ant inheritance Greg <shireyg@gmail.com> - 2012-07-05 11:30 -0700 Re: ant inheritance Lew <lewbloch@gmail.com> - 2012-07-05 13:02 -0700 Re: ant inheritance Greg <shireyg@gmail.com> - 2012-07-05 13:22 -0700
csiph-web