Using Ant build file as the Idea project

Are there any plans to make Idea projects/modules more tightly integrated with a build.xml file?

Specifically, I'd like to see the source path, docs path and classpath for each module be stored in an Ant file. I'm not asking for Idea to use Ant for builds; Idea's incremental build is critical for my workflow with large projects.

But we have existing handmade Ant build files and very large and complicated classpaths and source module definitions. It's very painful to recreate them in Idea, and what's worse, there are often no obvious build or runtime problems if I don't recreate them exactly.

Even better, I suppose, would be if Idea adopted the Maven Project Object Model or AntMod's POM, or some other open standarn for this kind of stuff.

Netbeans now has this feature, with some caveats. Currently, you can create a Netbeans project that uses an existing Ant build file for all of the project paths. The exception is that currently you also have to manually set up a duplicate class path specification in the project for use by the refactoring and code completion tools.

Eclipse has a variant of this feature in the 3.1 roadmap. It seems to be a bidirectional sync between project and build file, though it's not clear whether it would be automatic.

Thanks,
Willis Morse

7 comments
Comment actions Permalink

Currently you can export the IntelliJ project as an ANT file, but this
is probably not what you mean.

I and others have raised this issue in the past, seeing the feature
creap going into IntelliJ in the project area.

The way we do it here is to maintain both the ANT file and the IJ
project, and since our project doesn't change that often or in large
ways, we can live with that.

If we would have to choose we would choose to maintain only ANT as our
automated build uses that, too.

Regards,
Amnon

Willis Morse wrote:

Are there any plans to make Idea projects/modules more tightly integrated with a build.xml file?

Specifically, I'd like to see the source path, docs path and classpath for each module be stored in an Ant file. I'm not asking for Idea to use Ant for builds; Idea's incremental build is critical for my workflow with large projects.

But we have existing handmade Ant build files and very large and complicated classpaths and source module definitions. It's very painful to recreate them in Idea, and what's worse, there are often no obvious build or runtime problems if I don't recreate them exactly.

Even better, I suppose, would be if Idea adopted the Maven Project Object Model or AntMod's POM, or some other open standarn for this kind of stuff.

Netbeans now has this feature, with some caveats. Currently, you can create a Netbeans project that uses an existing Ant build file for all of the project paths. The exception is that currently you also have to manually set up a duplicate class path specification in the project for use by the refactoring and code completion tools.

Eclipse has a variant of this feature in the 3.1 roadmap. It seems to be a bidirectional sync between project and build file, though it's not clear whether it would be automatic.

Thanks,
Willis Morse

0
Comment actions Permalink

But we have existing handmade Ant build files and very large and complicated
classpaths and source module definitions. It's very painful to recreate them
in Idea, and what's worse, there are often no obvious build or runtime
problems if I don't recreate them exactly.


Did you try the Generate Ant Build from the Build menu?

R

0
Comment actions Permalink

Well, that's a one-shot kind of thing. I'm really hoping to keep the project and ant file continuously in sync.

Also, in my case, I get Ant files from the build guru, so I need to keep the Idea project in sync with the Ant file, not the other way around.

Willis Morse

0
Comment actions Permalink

This doesn't seem feasible to implement. It's very similar to decompiling
java bytecode which haven't been generated by java compiler. You wan't be
able to come up with something declarative (modules structure) out of something
procedural (what ant tasks seem to be). Synchronizing with maven projects
((c) Brian Topping) seem to be much more straitforward.

-


Maxim Shafirov
http://www.jetbrains.com
"Develop with pleasure!"

Well, that's a one-shot kind of thing. I'm really hoping to keep the
project and ant file continuously in sync.

Also, in my case, I get Ant files from the build guru, so I need to
keep the Idea project in sync with the Ant file, not the other way
around.

Willis Morse




0
Comment actions Permalink


I would love to see IntelliJ get all the compiler / path / classpath / output directory settings from the build.xml file. I believe this has been discussed before.

I'm wondering how many large projects with > 10 developers actually use IntelliJ for deploying their application? In my case, I don't even use it for compiling. But I need to have the libraries classpath setup properly so the error hilighting works.

I would like to point IntelliJ to the task in my build.xml and have it keep synced to that. I would be ok if it was one-way read-only, i.e. you can't make changes to the build.xml from IntelliJ Settings Dialog -- you have to edit the build.xml. IntelliJ has added some complexity with the module libs, project libs, global libs. I suppose you might have separate tasks for each module, so maybe each module could be synced to it's own We do everything with ant build.xml files, and it is a pain to have to keep my IntelliJ settings up to date everytime someone adds or updates a 3rd party library. I am working on a project with 50 developers, so changes happen more frequently.. I have the same issues with the web module setup wizard. We don't use IntelliJ for installation, packaging, or deployment of our web app, so it is extra complexity I don't need. All I want to do is setup the classpath and resource path mapping,e.g. "/usr/html" ==>]]> "/", so that
the error hilighting works.

It would be nice if IntelliJ simplified the user interface for those of us who use ant build.xml for to build, package, and deploy our software.

0
Comment actions Permalink

I think I'm relatively smart guy, but still when I'm given a new source
it could take me up to a day just to figure how to build/deploy/run the
sources. The Ant scripts can be written in so many different ways, that
there is no way through static analysis to actually know what's coming
in the javac task.

If you want to use the advanced features of IDEA (btw that's the product
name), you have take the time to understand and configure it. The
modules are a big step forward, but they do complicate the
configuration. You can still use a single module and work as with 3.5

On the other hand, vi and emacs are as good as it gets from a text
editor and do not require any project-specific configuration.

Dimitar


Alex wrote:

I would love to see IntelliJ get all the compiler / path / classpath / output directory settings from the build.xml file. I believe this has been discussed before.

I'm wondering how many large projects with > 10 developers actually use IntelliJ for deploying their application? In my case, I don't even use it for compiling. But I need to have the libraries classpath setup properly so the error hilighting works.

I would like to point IntelliJ to the <javac> task in my build.xml and have it keep synced to that.

I would be ok if it was one-way read-only, i.e. you can't make changes to the build.xml from IntelliJ Settings Dialog -- you have to edit the build.xml.

IntelliJ has added some complexity with the module libs, project libs, global libs. I suppose you might have separate <javac> tasks for each module, so maybe each module could be synced to it's own <javac>

We do everything with ant build.xml files, and it is a pain to have to keep my IntelliJ settings up to date everytime someone adds or updates a 3rd party library. I am working on a project with 50 developers, so changes happen more frequently..

I have the same issues with the web module setup wizard. We don't use IntelliJ for installation, packaging, or deployment of our web app, so it is extra complexity I don't need. All I want to do is setup the classpath and resource path mapping,e.g. "/usr/html" ==> "/", so that
the error hilighting works.

It would be nice if IntelliJ simplified the user interface for those of us who use ant build.xml for to build, package, and deploy our software.

0
Comment actions Permalink

Yeah, I'm not really looking for arbitrary Ant build file support, I guess. If there were SOME restrictions on the format of the Ant file, the problem would be a lot more tractable.

I guess what I REALLY want is an open standard for encoding projects in Ant files that can be used by all IDEs. That's basically what the Maven POM does. How suitable do you think this POM is as the basis for an Idea project specification?

Check out what Netbeans is doing in the latest version. Roughly speaking, they take your arbitrary ant file, parse it for targets, then let you map specific targets to Netbeans UI commands like "Build", "Test", etc. Once the IDE knows which target is the build target, it could easily suck out the classpath declarations in that specific target, couldn't it?

Netbeans currently only uses this classpath for builds, not for code completion and refactoring. This makes me think that when you set up a project this way, you're implicitly choosing to use Ant for all builds. They plan to integrate this Ant support more fully into the whole app.

Here's a Netbeans page that describes how to make a Netbeans from an existing codebase and Ant file:

<http://netbeans.org/kb/articles/import_j2se_40.html>

Thanks,
Willis Morse

0

Please sign in to leave a comment.