Generate a "Makefile" for a Java project? [message #168635] |
Wed, 14 July 2004 02:13  |
Eclipse User |
|
|
|
Is there no way of generating any sort of "Makefile"-like setup (could be
Ant, I really don't care) for building java projects developed in Eclipse?
Using the Eclipse GUI to build the project is fine for development, but I
would like to be able to build a stable product from the command line, or
perhaps even on a machine without Eclipse installed on it. Much googling
has left me with no idea on how to do this. Is this possible?
|
|
|
|
|
Re: Generate a "Makefile" for a Java project? [message #168771 is a reply to message #168659] |
Wed, 14 July 2004 22:16  |
Eclipse User |
|
|
|
There is already an 8-month old bug in Eclipse, and I voted for it. It
really does surprise me that this doesn't exist already. I guess for now
I'll just have to learn to write Ant by hand.
Markus wrote:
> "Eric Camden" <adampauls@yahoo.ca> schrieb im Newsbeitrag
> news:cd2iti$d71$1@eclipse.org...
> > Is there no way of generating any sort of "Makefile"-like setup (could be
> > Ant, I really don't care) for building java projects developed in Eclipse?
> > Using the Eclipse GUI to build the project is fine for development, but I
> > would like to be able to build a stable product from the command line, or
> > perhaps even on a machine without Eclipse installed on it. Much googling
> > has left me with no idea on how to do this. Is this possible?
> >
> I'd suppose you create an Ant Build Scipt for your project in Eclipse.
> Steps:
> -"New/File" in context menu of the project.
> -Name it "build.xml" which is the registered for the Ant editor
> -The Ant editor provides context sensitive code completion which allows you
> to set up a new script from the scratch easily.
> -You can test the script within eclipse with "Run/Ant Build"
> -If you have finished your script you might use it from the command line
> with the standalone Ant for Apache.org (just change to the directory which
> contains your build.xml and type "ant"). Ant itself must be on the path.
> -be sure that you don't rely on eclipse specific parameters in your script,
> which are (of course) not available at commandline
> -if you want to use the eclipse internal java compiler you must add the
> appropriate -lib switch. Example:
> C:devmyproject>c:workantbinant -lib
> c:Deveclipse3pluginsorg.eclipse.jdt.core_3.0.0.cheetah06jdtC ompilerAdap
> ter.jar -lib
> c:Deveclipse3pluginsorg.eclipse.jdt.core_3.0.0.cheetah06jdtc ore.jar
> Example build.xml:
> <?xml version="1.0"?>
> <!-- ============================================================ ==========
> 13.07.2004 13:42:17
> project
> description
> ============================================================ ========== -->
> <project name="project" default="default">
> <description>
> description
> </description>
> <property name="build.compiler"
> value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
> <!-- =================================
> target: default
> ================================= -->
> <target name="default" description="--> description">
> <property name="src" value="${basedir}/src"/>
> <property name="dst" value="${basedir}/bin"/>
> <delete dir="${dst}"/>
> <mkdir dir="${dst}"/>
> <javac srcdir="${src}"
> destdir="${dst}"
> debug="on"
> verbose="on"
> source="1.5"
> target="1.5">
> </javac>
> </target>
> </project>
|
|
|
Powered by
FUDForum. Page generated in 0.03715 seconds