Paths in IDEA-generated Ant Scripts

We are writing an application with IntelliJ IDEA, which needs do do several things such as signing JAR files and running custom ANT tasks, so we need an ANT build script.

We want to keep the ANT script to match what IntelliJ does when we compile the application, so we're trying to write a script that calls another ANT script generated by IntelliJ.

This all seems to work, apart from a few problems:
1) The build script generated by Ant has explicit pathnames (eg "C:/Program Files/JetBrains/IntelliJ IDEA 7.0.3/lib/javaee.jar") which won't work when we move the project to other machines (we use Windows XP, Vista and Linux, each of which stores these files in different places). We have the "Relative" radio button selected in the Project Settings/General tab/"References to resources outside project file directory" option, and the filename is stored as jar://$APPLICATION_HOME_DIR$/lib/javaee.jar!/]]> in the shared.iml file, but it still appears as a full path in the output ant script. Is there any way to make this store the path in a property so we can change it?

2) We have a web facet in the project that JARs the module output from other modules into JAR files and includes them in the WAR. We want to sign these JAR files, so we can't keep this as one target. We can use an EJB facet in the other modules to tell it to generate an explicit JAR file for each module, and include that into the WAR file as an external module, but then the dependency order is lost (even though the other module is still a dependency), and IntelliJ errors during the build saying that the JAR file does not exist. Is there another way we can achieve this that will not result in the ant target having only one task to build both the WAR file and the JAR files it contains?

For reference, we have attached our IML files and the generated ANT build script.

IntelliJ build files.rar

Please sign in to leave a comment.