Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Can't Specify Build Directory
Can't Specify Build Directory [message #129395] Thu, 12 January 2006 20:15 Go to next message
Eclipse UserFriend
Originally posted by: anon.anon.org

Hello all,

I'm a newcomer to Eclipse and am trying to import an existing java project
in CVS with an ant build file. I've created the project, however I can't
find the proper way to specify where I want the build output to go. The ant
buildfile requires a variable "BUILDDIR" to be set, but I can't find the
proper place in the IDE to add this environment variable to the project.
I've tried a couple of different things, but then when I specify a directory
not in my workspace, the compilation fails with "directory is not in the
project." I'm totally confused. Why do you have to explicitly add a target
directory to a project and how do I go about doing this? I can't find
anything in the IDE to give me a clue.

Thanks,
Shane
Re: Can't Specify Build Directory [message #129927 is a reply to message #129395] Mon, 16 January 2006 18:34 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse3.rizzoweb.com

Shane Fisher wrote:
> Hello all,
>
> I'm a newcomer to Eclipse and am trying to import an existing java project
> in CVS with an ant build file. I've created the project, however I can't
> find the proper way to specify where I want the build output to go. The ant
> buildfile requires a variable "BUILDDIR" to be set, but I can't find the
> proper place in the IDE to add this environment variable to the project.
> I've tried a couple of different things, but then when I specify a directory
> not in my workspace, the compilation fails with "directory is not in the
> project." I'm totally confused. Why do you have to explicitly add a target
> directory to a project and how do I go about doing this? I can't find
> anything in the IDE to give me a clue.

Do you want to let Eclipse do the building (at least the parts that it
is capable of doing), or do you want to continue to use only you Ant
script to do the build?
I highly recommend setting it up so that Eclipse does its part
(compiling and copying non-source files into the build output location)
as that will give you the most value from what Eclipse has to offer. In
that case, you specify things like source directories, dependent
libraries, and build output locations by right-clicking on the Project
and choose Properties.
I also STRONGLY recommend opening the Help and going through the Getting
Started guides for Java Development and Workbench - understanding those
topics will save you a LOT of time as you get used to the tool.

HTH,
Eric
Re: Can't Specify Build Directory [message #130196 is a reply to message #129927] Tue, 17 January 2006 20:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: anon.anon.org

Eric,

Thanks for the suggestion, however we have a large development team with a
build team that requires command-line automation via the ant script. Is
there no way to specify the required variables in a way that Eclipse can
understand and utilize so they can share the same ant script? It seems the
IDE should integrate with the automated build in a seamless fashion, simply
by specifying the required env variables in the project file. Am I
misunderstanding the tool? I recall doing similar things with the JBuilder
IDE on a previous project.

Thanks again,
Shane


"Eric Rizzo" <eclipse3@rizzoweb.com> wrote in message
news:dqgp0i$tqi$1@utils.eclipse.org...
> Shane Fisher wrote:
> > Hello all,
> >
> > I'm a newcomer to Eclipse and am trying to import an existing java
project
> > in CVS with an ant build file. I've created the project, however I
can't
> > find the proper way to specify where I want the build output to go. The
ant
> > buildfile requires a variable "BUILDDIR" to be set, but I can't find the
> > proper place in the IDE to add this environment variable to the project.
> > I've tried a couple of different things, but then when I specify a
directory
> > not in my workspace, the compilation fails with "directory is not in the
> > project." I'm totally confused. Why do you have to explicitly add a
target
> > directory to a project and how do I go about doing this? I can't find
> > anything in the IDE to give me a clue.
>
> Do you want to let Eclipse do the building (at least the parts that it
> is capable of doing), or do you want to continue to use only you Ant
> script to do the build?
> I highly recommend setting it up so that Eclipse does its part
> (compiling and copying non-source files into the build output location)
> as that will give you the most value from what Eclipse has to offer. In
> that case, you specify things like source directories, dependent
> libraries, and build output locations by right-clicking on the Project
> and choose Properties.
> I also STRONGLY recommend opening the Help and going through the Getting
> Started guides for Java Development and Workbench - understanding those
> topics will save you a LOT of time as you get used to the tool.
>
> HTH,
> Eric
Re: Can't Specify Build Directory [message #130525 is a reply to message #130196] Wed, 18 January 2006 23:52 Go to previous message
Eclipse UserFriend
Originally posted by: eclipse3.rizzoweb.com

Shane Fisher wrote:
> Eric,
>
> Thanks for the suggestion, however we have a large development team with a
> build team that requires command-line automation via the ant script. Is
> there no way to specify the required variables in a way that Eclipse can
> understand and utilize so they can share the same ant script? It seems the
> IDE should integrate with the automated build in a seamless fashion, simply
> by specifying the required env variables in the project file. Am I
> misunderstanding the tool? I recall doing similar things with the JBuilder
> IDE on a previous project.

First, don't make the mistake of comparing Eclipse to JBuilder - it is a
very different colored horse and you'll only frustrate yourself by
trying to think of them as equivalent or even similar. :-)

Now, about your question: it is certainly possible (and desirable) to
have an "automatable" Ant build script that is used for "official"
builds, and still let Eclipse do it's part during development. The key
is to configure your Eclipse project to build into the same output
location that the Ant script builds into. That way Eclipse gets to use
its very intelligent Java compilation and processing tools to provide a
rich dev environment, but you still always have the "official" Ant
script to fall back on. One key here is to have a "clean" target that
you can invoke easily from within Eclipse when you want to toss out the
build work Eclipse did and use the Ant script instead.

Once configured that way, you have two directions to choose between for
invoking the parts of the build that Eclipse can't handle (perhaps code
generation, complex/intricate file copying, JAR production, remote
deployment, etc.) One choice is to just use the Ant view to manually
invoke the Ant script when you need it. This is how I have set up a lot
of projects. Most of the build work that is used many times per day can
be accomplished by Eclipse, but there are some Ant targets that I need
to invoke occasionally to keep the dev build up to date. (Eclipse's
advanced source path and output location configuration features can help
here).

The other alternative is to set up a builder for your project that will
get invoked every time a build is triggered in Eclipse (it can be set up
to run before/after the Eclipse build/compile). By default, Eclipse will
build every time you save a file that is on the project's source path,
so doing this with an Ant target that takes a long time is not a great
idea - you'll find yourself constantly waiting for the Ant script to run
on every file save! Where this works well is when the Ant target you
need to run must run upon all (or at least most) source file changes,
and/or it does not take more than a couple of seconds.

[In any case, the Ant script must be maintained and used exclusively for
those pesky "official" builds :-). But that is no big deal, and you
should be doing "official" builds on a non-dev clean machine anyway, so
Eclipse would have no impact there.]

Either way, this is how I've worked with Eclipse for several yeas now on
projects of various sizes - it has served me well.

HTH,
Eric
Previous Topic:How to move the configuration between different versions of Eclipse
Next Topic:moved eclipse, now says jre should be in eclipse folder
Goto Forum:
  


Current Time: Mon Dec 30 17:18:07 GMT 2024

Powered by FUDForum. Page generated in 0.08108 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top