History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEADEV-10537
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Critical Critical
Assignee: Vyacheslav Lukianov
Reporter: Maxim Mossienko
Votes: 2
Watchers: 3
Operations

If you were logged in you would be able to see more operations.
IDEA: Development

ANT TaskDef support REGRESS

Created: 04 Oct 06 03:10   Updated: 10 Oct 06 21:20
Component/s: Ant Integration
Fix Version/s: Demetra 6.0.2

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown

Fixed in build: 5,779


 Description  « Hide
I have following taskdef and its usage in ant build.xml

<taskdef name="obfuscate"
classname="com.yworks.yguard.ObfuscatorTask"
classpath="${project.path}/build/libs/yguard.jar"/>
<obfuscate>
<inoutpair in="XXX.zip" out="YYY.jar"/>
</obfuscate>
-------------
inoutpair marked with red underline as 'Element 'inoutpair' is undefined'
This code was green in IDEA 5.1.2



 All   Comments   Work Log   Change History      Sort Order:
Gus Heck - 04 Oct 06 23:24
Seeing similar problems with

<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location="${lib}/${lib.ant-contrib}"/>
</classpath>
</taskdef>

<if> and <var> are not recognized, and taskdef is underlined in red saying "failed to load type"

The problem also occurs for emma, and our custom tasks too.

All of this had been green before the upgrade, and all the location specified above for the pathelement does correctly point to the jar.


Vyacheslav Lukianov - 06 Oct 06 10:49
Gus, you've met with another issue, namely not loading classes declared in the resource file. It is already fixed, but for more proper editing and highlighting, I'd recommend to use classpath attributes in taskdefs where possible.

Gus Heck - 10 Oct 06 18:47
I'm not sure I understand your comment. It may be that there are several bugs with IDEA's handling of taskdef, but from a user point of view the following things do NOT work in 5766

1. the taskdef for antcontrib above that references a property file.

2. taskdefs using a classpath ref.

<taskdef
description="Produces a properties file of business errors from an Excel spreadsheet."
name="errorCatalog"
classname="com.aspentech.imos.common.system.load.ErrorCatalog"
classpathref="error-catalog.classpath"/>

(where the path is defined in and imported from our build-classpath.xml like this
<fileset dir="${lib}" id="error-catalog.libs">
<include name="${lib.commons-lang}"/>
<include name="${lib.commons-logging}"/>
<include name="${lib.jtds}"/>
<include name="${lib.log4j}"/>
<include name="${lib.poi}"/>
</fileset>
<path id="error-catalog.classpath">
<fileset refid="error-catalog.libs"/>
<pathelement location="${lib.error-catalog}"/>
</path>

3. (unsuprisingly) the combination of the two also does not work

<!-- this loads <emma> and <emmajava> custom tasks: -->
<taskdef resource="emma_ant.properties" classpathref="emma.classpath"/>

4. included classpath almost works but all the attributes for the taks are red (this was a problem in 5.1 also)

<taskdef name="junit"
classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask">
<classpath id="junit.classpath">
<fileset refid="junit.libs"/>
</classpath>
</taskdef>

So whether it is one bug or several bugs, every aspect of taskdef is broken in at least some way and it is impossible to write any but this absolute simplest build files without a lot of red marks in the gutter, and useless complaints about errors when I checkin any set of files that includes a build file (unless I tell it not to perform code analysis for the effected files).

Given that nothing works a general bug about taskdef seems appropriate. I did not find bugs for the current release that described these cases individually (my search may have been faulty of course). If this should be split into separate bugs or duplicates existing bugs let me know I'll be happy to watch/file those instead. If you've fixed one or all of these cases then thank you!


Gus Heck - 10 Oct 06 18:50
Just to be clear when I say nothing works, I mean nothing highlights properly. The builds all run just fine.