Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-ant-dev] RE: Can I use Ant (that is not Eclipse's Ant plugin) to compile anEclipse's project by invoke Eclipse's compiler?

Thanks for your help,
Now I can done my task.
I created 2 buildfile, in the first:
<target name="headless"> 
       <exec dir="C:\jdk1.3.1_01\jre\bin" executable="java.exe"
os="Windows 2000">
            <arg line="-cp C:\eclipse\startup.jar
org.eclipse.core.launcher.Main -noupdate -application
org.eclipse.ant.core.antRunner -data c:\temp - buildfile
c:\temp\build.xml" /> 
          </exec>
</target>
and the second:
<target name="configure.eclipse" if="eclipse.running">
     <property name="build.compiler"
value="org.eclipse.jdt.core.JDTCompilerAdapter"/>      
</target>

    <target name="main" depends="init,configure.eclipse">
       <javac srcdir="c:\temp\src" destdir="c:\temp\classes"/> 
</target>
 
Chien


The Eclipse compiler cannot be used outside of Eclipse currently. 

But Eclipse does have a notion of running "headless" using application
entry points. 

The Eclipse Ant integration provides such an entry point. 
I have attached the bat file that I use for dev and testing. 
Then as Gilbert indicated, set build.compiler if eclipse.running 

HTH 
Darins 





	"Rebhan, Gilbert" <Gilbert.Rebhan@xxxxxxxxxxxxx> 


08/21/03 04:20 AM 
Please respond to "Ant Users List" 


        
        To:        "ant_user (E-Mail)" <user@xxxxxxxxxxxxxx> 
        cc:         
        Subject:        RE: Can I use Ant (that is not Eclipse's Ant
plugin) to compile an Eclipse's project by invoke Eclipse's compiler? 





/*
Dear all,
Now am trying to use Ant outside Eclipse but I want to use Ant to
compile an Eclipse's project by using Eclipse's compiler.
How can I do?
Best regards,
Chien
*/

Here is a snippet of my buildfile running in or outside Eclipse :

<!---Checkin whether running in Eclipse, put this target atop your
compile target--> 

<target name="configure.eclipse" if="eclipse.running">
     <property name="build.compiler"
value="org.eclipse.jdt.core.JDTCompilerAdapter"/>      
</target>

<!--compile target must be dependend from above target-->

<target name="compile" depends="init,configure.eclipse">
                <javac srcdir="${src}" destdir="${build.dest}">
                                 <classpath refid="compile.classpath"/>
                </javac>
</target>


For your intention : 

try putting the jar's in
Eclipsedirectory/plugin/org.eclipse.jdt.core.2.1.0
to your classpath and adjust the mechanism in the example above.

I believe the eclipsecompiler won't work without Eclipse running though.

Regards,
       Gilbert


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xxxxxxxxxxxxxx
For additional commands, e-mail: user-help@xxxxxxxxxxxxxx







Back to the top