You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Andy Wickson <an...@gmail.com> on 2005/09/13 14:34:30 UTC

Very basic newby problem?

Hi,

I am attempting the run the following ant script:

<project name="MyProject" basedir=".">
<description>
simple example build file
</description>

<target name="compile" description="compile the source" >
<javac srcdir="common" destdir="common"/>
</target>
</project>

where common is a directory under the root directory (containing the 
build.xml file) that contains some java source files.

When I run the script with the debug option i get the following output:
-------------------------------------------------------------------------start 
clip
Apache Ant version 1.6.5 compiled on June 2 2005
Buildfile: build.xml
Adding reference: ant.PropertyHelper
Detected Java version: 1.4 in: C:\Program Files\IBM\Java142\jre
Detected OS: Windows XP
Adding reference: ant.ComponentHelper
Setting ro project property: ant.version -> Apache Ant version 1.6.5compiled on
June 2 2005
Setting ro project property: ant.file -> C:\testoutput\build.xml
Adding reference: ant.projectHelper
Adding reference: ant.parsing.context
Adding reference: ant.targets
parsing buildfile C:\testoutput\build.xml with URI = 
file:///C:/testoutput/build
.xml
Setting ro project property: ant.project.name <http://ant.project.name> -> 
MyProject
Adding reference: MyProject
Setting ro project property: ant.file.MyProject -> C:\testoutput\build.xml
Project base dir set to: C:\testoutput
+Target:
+Target: compile
Attempting to create object of type 
org.apache.tools.ant.helper.DefaultExecutor
Adding reference: ant.executor
-----------------------------------------------------------------------------end
clip

no attempt seems to compile the files and indeed no class files are created.

if i run the command javac common\*.java from the root directory it works 
ok.

I have the following env. variables set:
JAVA_HOME=C:\Program Files\IBM\Java142
ANT_HOME=C:\apache-ant-1.6.5

I assume it must be something quite fundamental but the fact that i see 
javac run independently and Ant is invoked, I can't think what.

Any ideas would be greatly appreciated.

Thanks,
Andy

Re: Very basic newby problem?

Posted by Barry White <bw...@fotango.com>.
When you invoke ant with no arguments, it looks for a file called 
build.xml in the working directory. So build.xml needs to come out of 
common and into the working directory. The relaitive paths that you have 
in the javac task are correct if the build file is up one level (working 
dir).

Try this and see how you get on,

Barry

Andy Wickson wrote:
> Hi,
> 
> I am attempting the run the following ant script:
> 
> <project name="MyProject" basedir=".">
> <description>
> simple example build file
> </description>
> 
> <target name="compile" description="compile the source" >
> <javac srcdir="common" destdir="common"/>
> </target>
> </project>
> 
> where common is a directory under the root directory (containing the 
> build.xml file) that contains some java source files.
> 
> When I run the script with the debug option i get the following output:
> -------------------------------------------------------------------------start 
> clip
> Apache Ant version 1.6.5 compiled on June 2 2005
> Buildfile: build.xml
> Adding reference: ant.PropertyHelper
> Detected Java version: 1.4 in: C:\Program Files\IBM\Java142\jre
> Detected OS: Windows XP
> Adding reference: ant.ComponentHelper
> Setting ro project property: ant.version -> Apache Ant version 1.6.5compiled on
> June 2 2005
> Setting ro project property: ant.file -> C:\testoutput\build.xml
> Adding reference: ant.projectHelper
> Adding reference: ant.parsing.context
> Adding reference: ant.targets
> parsing buildfile C:\testoutput\build.xml with URI = 
> file:///C:/testoutput/build
> .xml
> Setting ro project property: ant.project.name <http://ant.project.name> -> 
> MyProject
> Adding reference: MyProject
> Setting ro project property: ant.file.MyProject -> C:\testoutput\build.xml
> Project base dir set to: C:\testoutput
> +Target:
> +Target: compile
> Attempting to create object of type 
> org.apache.tools.ant.helper.DefaultExecutor
> Adding reference: ant.executor
> -----------------------------------------------------------------------------end
> clip
> 
> no attempt seems to compile the files and indeed no class files are created.
> 
> if i run the command javac common\*.java from the root directory it works 
> ok.
> 
> I have the following env. variables set:
> JAVA_HOME=C:\Program Files\IBM\Java142
> ANT_HOME=C:\apache-ant-1.6.5
> 
> I assume it must be something quite fundamental but the fact that i see 
> javac run independently and Ant is invoked, I can't think what.
> 
> Any ideas would be greatly appreciated.
> 
> Thanks,
> Andy
> 

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


RE: Very basic newby problem?

Posted by Kinjal <ki...@mentorix.com>.
how to use ant in clear case
write procedure asap

------------------------------------
LionBridge Technologies Pvt. Ltd.
Kinjal Vohra
SCM/Build Engineer
kinjal.vohra@mentorix.com
5th Floor, Spectra Bldg.,
Hiranandani Business Park,
Powai, Mumbai-400076.
Maharashtra, India.
tel: +912255567349
mobile: +919867240708
------------------------------------


-----Original Message-----
From: Andy Wickson [mailto:andywickson@gmail.com]
Sent: Tuesday, September 13, 2005 18:05
To: user@ant.apache.org
Subject: Very basic newby problem?


Hi,

I am attempting the run the following ant script:

<project name="MyProject" basedir=".">
<description>
simple example build file
</description>

<target name="compile" description="compile the source" >
<javac srcdir="common" destdir="common"/>
</target>
</project>

where common is a directory under the root directory (containing the
build.xml file) that contains some java source files.

When I run the script with the debug option i get the following output:
-------------------------------------------------------------------------sta
rt
clip
Apache Ant version 1.6.5 compiled on June 2 2005
Buildfile: build.xml
Adding reference: ant.PropertyHelper
Detected Java version: 1.4 in: C:\Program Files\IBM\Java142\jre
Detected OS: Windows XP
Adding reference: ant.ComponentHelper
Setting ro project property: ant.version -> Apache Ant version 1.6.5compiled
on
June 2 2005
Setting ro project property: ant.file -> C:\testoutput\build.xml
Adding reference: ant.projectHelper
Adding reference: ant.parsing.context
Adding reference: ant.targets
parsing buildfile C:\testoutput\build.xml with URI =
file:///C:/testoutput/build
.xml
Setting ro project property: ant.project.name <http://ant.project.name> ->
MyProject
Adding reference: MyProject
Setting ro project property: ant.file.MyProject -> C:\testoutput\build.xml
Project base dir set to: C:\testoutput
+Target:
+Target: compile
Attempting to create object of type
org.apache.tools.ant.helper.DefaultExecutor
Adding reference: ant.executor
----------------------------------------------------------------------------
-end
clip

no attempt seems to compile the files and indeed no class files are created.

if i run the command javac common\*.java from the root directory it works
ok.

I have the following env. variables set:
JAVA_HOME=C:\Program Files\IBM\Java142
ANT_HOME=C:\apache-ant-1.6.5

I assume it must be something quite fundamental but the fact that i see
javac run independently and Ant is invoked, I can't think what.

Any ideas would be greatly appreciated.

Thanks,
Andy


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