Ant - red hilighiting

The build process used at my company requires creating several different jar files, and tar.gz archives. In my Ant file, the part that specifies the output filename looks something like this:

The problem is, when I open the Ant file in IntelliJ, the path name can't be resolved because the tar file doesn't exist yet. It can't possibly exist because the version number is determined as the script runs, so there is no way IntelliJ can resolve it. IntelliJ displays it in red, and says there is an error.

Does anyone know a way around this? I just would like an option to suppress those warnings. I don't want the whole file to suppress all warnings, because usually they are valuable in finding errors.

I suppose it's not really a problem, but more of an annoyance (though there are a ton of them). I mainly don't want the next maintainer to spend time trying to fix errors that don't exist, or worse yet, to become accustomed to ignoring IntelliJ's warnings. Maybe there is some sort of @suppressWarnings thing that can be used for the offending lines?

If anyone has any solutions or suggestions I would be very grateful!

3 comments
Comment actions Permalink

Hello Benjamin,

The build process used at my company requires creating several
different jar files, and tar.gz archives. In my Ant file, the part
that specifies the output filename looks something like this:



The problem is, when I open the Ant file in IntelliJ, the path name
can't be resolved because the tar file doesn't exist yet. It can't
possibly exist because the version number is determined as the script
runs, so there is no way IntelliJ can resolve it. IntelliJ displays
it in red, and says there is an error.

Does anyone know a way around this? I just would like an option to
suppress those warnings. I don't want the whole file to suppress all
warnings, because usually they are valuable in finding errors.

I suppose it's not really a problem, but more of an annoyance (though
there are a ton of them). I mainly don't want the next maintainer to
spend time trying to fix errors that don't exist, or worse yet, to
become accustomed to ignoring IntelliJ's warnings. Maybe there is
some sort of @suppressWarnings thing that can be used for the
offending lines?

If anyone has any solutions or suggestions I would be very grateful!


There are several existent feature requests about this:
http://www.jetbrains.net/jira/browse/IDEADEV-10556
http://www.jetbrains.net/jira/browse/IDEADEV-21761

BTW, how the $ is calculated? Is it read from some .properties file,
or so? Because in some cases (like with .properties file) IDEA should be
able to resolve the value.

Alexander.


0
Comment actions Permalink

So does this mean there is really nothing I can do about it at this point?

BTW, how the $ is calculated? Is it read from some .properties file,
or so? Because in some cases (like with .properties file) IDEA should be
able to resolve the value.


It reads in the latest revision number from a utility that comes with subversion. Since it uses an external application, there is no possible way IDEA can ever resolve it.

Thanks.

0
Comment actions Permalink

So does this mean there is really nothing I can do about it at this point?

>> BTW, how the $ is calculated? Is it read from some .properties file, >> or so? Because in some cases (like with .properties file) IDEA should be >> able to resolve the value. > > It reads in the latest revision number from a utility that comes with subversion. Since it uses an external application, there is no possible way IDEA can ever resolve it. > > Thanks. Does it mean that your Ant script gets this $ from the
parameter list?
-D=]]>
If that's the case, then you can create property file containing
$ definition. Ant command line parameters override values from property files. Idea will not complain, because it can see the definition of $, but your build will use $ provided by
external utility.

TomP

0

Please sign in to leave a comment.