ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mansou...@yahoo.com
Subject Re: class path problem
Date Mon, 09 Oct 2006 15:25:04 GMT
Yes, it worked as Scot suggested, It was the matter of using the 
sourcepath. Here's the desciption fro the website:
*=================================================================================
sourcepath*
The *sourcepath* to use; defaults to the value of the srcdir attribute 
(or nested |<src>| elements). To suppress the *sourcepath* switch, use 
|*sourcepath*=""|.
*=================================================================================

I added  **sourcepath="." and all went well. Thank you all.


**
*

Scot P. Floess wrote:

> When you execute your ant script, what directory are you "standing" 
> in?  I see you give a "relative" srcdir of Operation1.  Are you 
> standing in the directory that Operation1 lives?  You may also need to 
> use sourcepath attribute.
>
> mansour77@yahoo.com wrote:
>
>> Hi Every Body:
>> I am facing a probelm compile a java application. My Java application 
>> uses external and internal  library.
>> In other words, let's say i have a package called  java.matrix, and 
>> I  wrote a package for this project called MathOp,
>>
>> the layout of my project directory is :
>>    MyProject
>>                MathOp
>>                       Addition.java
>>                       Multiplication.java
>>                       Subtraction.java
>>                       Division.java
>>                Operation1
>>                       some classes
>>                Operation2
>>                       more classes
>>                build.xml
>>                resulting_classes_directory               
>>                MANIFEST.1
>>
>> Now I need to be able to include all or the needed classes from 
>> MathOp into the compilation of Operation1, and put the results in 
>> resulting_classes_directory.  I can do this from the command promt 
>> using option of javac and it works fine  for exmaple I can do :
>> javac -classpath /opt/j2sdk/lib/:/path/to/my/project:Operation1  -d 
>> resulting_classes_directory/     Operation1/*.java
>> When I try to do this with ant, it fails complaining about not 
>> finding the classes in the package MathOp. I dont want to compile the 
>> whole
>> package of MathOp. Please don't suggest this. I want it to be 
>> compiled when the classes that needs it is compiled. Here's what I 
>> have in my build.xml file.
>>
>> <target name="op1"    description="Compiles the Operation 1 and 
>> package it">
>>        <javac     srcdir="Operation1" 
>> destdir="resulting_classes_directory" includes="**/*.java" >
>>            <classpath>
>>                <pathelement path="Operation1"/>
>>                <pathelement path="."/>
>>                <pathelement path="/path/to/my/project"/>
>>                <pathelement path="/opt/j2sdk/lib/" 
>> />                  <fileset dir="Operation1">
>>                      <include name="**/*.java"/>
>>                </fileset>
>>            </classpath>
>>        </javac>
>>        <jar destfile="Op1.jar" basedir="resulting_classes_directory" 
>> manifest="MANIFEST.1" />
>>    </target>
>>
>> none of the classes are compiled, "And It Is Important That They Are 
>> Compiled Only When Ant Is Invoked."
>> Please let me know what I am missing here, or at least what to search 
>> for in google.
>> Thank you in advance.
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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


Mime
View raw message