Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 333687 - apt.core should only require versions of org.apache.ant > 1.6.5
Summary: apt.core should only require versions of org.apache.ant > 1.6.5
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: APT (show other bugs)
Version: 3.7   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.7 M5   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 333592
  Show dependency tree
 
Reported: 2011-01-06 14:53 EST by Michael Rennie CLA
Modified: 2011-01-10 12:40 EST (History)
2 users (show)

See Also:
Olivier_Thomann: review? (eclipse)


Attachments
Proposed fix (844 bytes, patch)
2011-01-06 14:55 EST, Olivier Thomann CLA
no flags Details | Diff
Proposed fix (14.34 KB, patch)
2011-01-07 09:16 EST, Olivier Thomann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Rennie CLA 2011-01-06 14:53:03 EST
I20110104-0920

While trying to find all of the dependencies on org.apache.ant in the platform I found that org.eclipse.jdt.apt.core has a dependency on Ant [1.6.5,1.8.0). This will cause problems once the platform consumes Ant 1.8.2 (see the CQ: https://dev.eclipse.org/ipzilla/show_bug.cgi?id=4727). 

Is there something special APT needs from the 1.7.x versions of Ant? Can the upper bound just be removed?
Comment 1 Olivier Thomann CLA 2011-01-06 14:55:53 EST
Created attachment 186219 [details]
Proposed fix
Comment 2 Olivier Thomann CLA 2011-01-06 14:57:08 EST
Walter, I can release that for you.
Simply confirm that there is no possible side-effect by removing the upper bound.
Comment 3 Olivier Thomann CLA 2011-01-06 15:42:49 EST
I think apt.core should refer to ant code the same way jdt.core did for the ant adapter and provide the ant task in a separate jar file.
The bundle itself doesn't need a dependency on apache.ant.

I'll work on refactoring it properly.
Comment 4 Olivier Thomann CLA 2011-01-07 09:16:44 EST
Created attachment 186272 [details]
Proposed fix

This patch completely removes the dependency on apache.ant. It moves the ant task into a separate jar which is needed if I well understood for class loading purpose.
It properly defines an ant task extension point. The only drawback is that the ant task type was defined as API is considered as removed from the API Tooling standpoint. I wonder if this class has ever been used as it is not defined in its own jar as all ant tasks defined in other bundles.

Walter, please review.

If no answer, I'll release the previous patch for the next I-build.
Comment 5 Walter Harley CLA 2011-01-07 12:18:44 EST
+1.  Thank you, Olivier.
Comment 6 Olivier Thomann CLA 2011-01-07 14:43:15 EST
Walter, do you take care of releasing it for next I-build + tagging of the apt project ?
Comment 7 Walter Harley CLA 2011-01-07 15:20:38 EST
Yes, I'll make sure to do that this weekend.
Comment 8 Walter Harley CLA 2011-01-09 20:56:39 EST
I am a little concerned about API impact.  The documentation (org.eclipse.jdt.doc.isv/guide/jdt_apt_building_with_apt.htm) states that AptBuilder is in aptcore.jar, and it looks like the export_plugin.xml build script is set up to create aptcore.jar, but I think this has been dead since Eclipse 3.2.  Presumably people who use this have figured out how to put the apt.core plugin jar on their Ant classpath.

So, if we take this class out of the plugin jar, we probably need to update the documentation and put something into the What's New; but since it's broken right now I am not sure what the right instructions for headless building with JdtApt should be.  Also we should probably get rid of that export_plugin.xml code.  And there don't seem to be any tests for these entry points.  Yuck!

The alternative is to leave things as they were, and just update the Ant requirement in the manifest.  I've confirmed that Ant 1.8.1 contains all the classes we need (1.8.2 was just released and I've not checked it, but I can't believe they'd be getting rid of these classes).  So we can probably just change the dependency to [1.6.5,1.9.0), or even just get rid of the upper bound as Michael suggests.

Thoughts, Olivier?  Realistically I am not going to have much time to test code changes, even though I agree this is a cleaner approach.
Comment 9 Olivier Thomann CLA 2011-01-10 11:21:45 EST
My concern is that the ant task defined in apt.core is useless as is since it is not separated from bundle's code. Walter, did you actually try the headless build in the past using the ant task?

I am fine to limit the change to only get rid of the upper bound, but another bug should be open to clean this.
Comment 10 Olivier Thomann CLA 2011-01-10 12:11:43 EST
I removed the upper bound.
Released for 3.7M5.
I'll open a new bug to clean up the ant task definition in apt.core.
Comment 11 Olivier Thomann CLA 2011-01-10 12:17:10 EST
Open bug 333887 to track down the ant task definition inside apt.core.
Comment 12 Walter Harley CLA 2011-01-10 12:28:29 EST
(In reply to comment #9)
> My concern is that the ant task defined in apt.core is useless as is since it
> is not separated from bundle's code. Walter, did you actually try the headless
> build in the past using the ant task?
> 
> I am fine to limit the change to only get rid of the upper bound, but another
> bug should be open to clean this.

I share that concern.  I really wonder whether anyone is using this at all.  I did some searching and although I found reference to people using the command-line entry point, I didn't find any mention of using the Ant task.

I have never tried it.  I think this was something that Jess Garms did back in 2005 or so, fairly early in the Eclipse / WebLogic Workshop integration.

Thanks for releasing the bounds change.  Did you update map files for the I-build, or do I still need to do that?
Comment 13 Olivier Thomann CLA 2011-01-10 12:36:36 EST
(In reply to comment #12)
> Thanks for releasing the bounds change.  Did you update map files for the
> I-build, or do I still need to do that?
Yes, the map file is updated and ready for the next I-build
Comment 14 Olivier Thomann CLA 2011-01-10 12:40:23 EST
I also took advantage of this update for remove deprecation warnings (usage of preference scope's constructors instead of the new INSTANCE fields) from other apt bundles.