Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [eclipse-dev] Can I run eclipse in the batch mode

Roopa,

Building Eclipse projects outside of Eclipse was very important in my
environment.  We needed to be able to build an Eclipse plugin from the
command line on an automated basis.  We were most concerned about
building Eclipse plugin and feature projects.  Eclipse gives you access
to this with the PDE framework.

The basic idea is that all Eclipse projects are built with Ant.  Eclipse
will generate an Ant build script and then call it.  You need to do the
same thing.  Eclipse provides an Ant task named eclipse.buildScript that
will build Ant build scripts from Eclipse projects.  Once you have
generated the build script you can just call it.  This build task will
only work with Eclipse feature projects.  I'm not sure if there are
other tasks for normal Java projects.

I have attached a sample of the build script I use.  I hope it is
helpful.

 -Zack


-----Original Message-----
From: eclipse-dev-bounces@xxxxxxxxxxx
[mailto:eclipse-dev-bounces@xxxxxxxxxxx]On Behalf Of Roopa Mahishi
Sent: Thursday, April 14, 2005 1:36 AM
To: General development mailing list of the Eclipse project.
Subject: [eclipse-dev] Can i run eclipse in the batch mode



Hi,
I want to use eclipse along with CDT plug-in in building the projects.
I want to put in build commands in a batch file on different projects
and submit it like a nightly build so that i can see
the outputs the next day. If there are any errors, I should be able to
see it in the Problems View of the eclipse IDE.

Typically,my batch file would contain something like this :
build project1
build project2
build project3
..

How can i do that?

-Roopa
<?xml version="1.0" encoding="UTF-8"?>
<project name="MyProject" default="build.update.jar" basedir=".">

    <property name="javacSource" value="1.5"/>
    <property name="javacTarget" value="1.5"/>
    
    <target name="init">
        <echo message="Building in build dir ${build.dir}" />
        <echo message="eclipse.home: ${eclipse.home}" />
    </target>

    <target name="buildScripts" depends="init">
        <eclipse.buildScript elements="feature@xxxxxxxx.myfeature"
                buildDirectory="${build.dir}"
                buildingOSGi="true"
                baseLocation="${eclipse.home}"
                archivesFormat="win32, win32 - zip, x86"
                children="true"
        />
    </target>

    <target name="build.update.jar" depends="buildScripts">
        <ant antfile="build.xml" 
                dir="${build.dir}/features/com.myco.myfeature" 
                target="all.plugins">
            <property name="target" value="clean" />
            <property name="eclipse.running" value="false" />
            <property name="javacFailOnError" value="true" />
            <property name="javacVerbose" value="false" />
            <property name="javacSource" value="50" />
            <property name="javacTarget" value="50" />
        </ant>
        <ant antfile="build.xml" 
                dir="${build.dir}/features/com.myco.myfeature" 
                target="build.update.jar">
            <property name="target" value="build.jars" />
            <property name="eclipse.running" value="false" />
            <property name="javacFailOnError" value="true" />
            <property name="javacVerbose" value="false" />
            <property name="javacSource" value="1.5" />
            <property name="javacTarget" value="1.5" />
        </ant>
    </target>

</project>


Back to the top