tern.java icon indicating copy to clipboard operation
tern.java copied to clipboard

[Enhancement] ternModuleInstalls to support folders within a plug-in JAR

Open demonfiddler opened this issue 10 years ago • 6 comments

The tern.eclipse.ide.core.ternModuleInstalls extension point has a plugin.xml#/plugin/extension[@point='tern.eclipse.ide.core.ternModuleInstalls']/moduleInstall@src attribute which currently provides the plug-in-relative path to a ZIP file containing the Tern module(s) to be deployed to the Tern repository. The plug-in is expected to be installed as a directory rather than a JAR.

It would be more elegant, convenient and OSGI compliant if the src path could alternatively be the path, relative to the plug-in root, of a folder containing the modules for deployment. It is rather more work for a developer to create a plug-in that contains a ZIP of some of its content rather than simply containing that content directly in the deployed plug-in directory or JAR. This approach would also enable the plug-in to be installed as a JAR, which is much preferable.

Implementation note: you can use org.osgi.framework.Bundle.getEntryPaths(String path) : Enumeration<String> and getEntry(String path) : URL to read the structure and entries from the src path within the plug-in, and this approach would work regardless of whether the bundle is deployed as a directory or an archive. If this enhancement were to be implemented I can't imagine anyone using the ZIP format, so you could drop it and simplify the code somewhat.

demonfiddler avatar Sep 24 '15 13:09 demonfiddler

@demonfiddler I'm very busy, do you think it's possible to do a PR with your idea? Thanks!

angelozerr avatar Sep 24 '15 13:09 angelozerr

@angelozerr I'll ask my boss whether we could do this as a contribution to the project. Cheers :-)

demonfiddler avatar Sep 24 '15 14:09 demonfiddler

@angelozerr I have the necessary changes finalised, just awaiting legal approval before I can submit a PR.

demonfiddler avatar Oct 06 '15 13:10 demonfiddler

Great!

angelozerr avatar Oct 06 '15 14:10 angelozerr

Pull request https://github.com/angelozerr/tern.java/pull/361 submitted.

demonfiddler avatar Nov 03 '15 16:11 demonfiddler

Resubmitted Pull Request (https://github.com/angelozerr/tern.java/pull/365)

demonfiddler avatar Nov 10 '15 15:11 demonfiddler