tern.java
tern.java copied to clipboard
[Enhancement] ternModuleInstalls to support folders within a plug-in JAR
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 I'm very busy, do you think it's possible to do a PR with your idea? Thanks!
@angelozerr I'll ask my boss whether we could do this as a contribution to the project. Cheers :-)
@angelozerr I have the necessary changes finalised, just awaiting legal approval before I can submit a PR.
Great!
Pull request https://github.com/angelozerr/tern.java/pull/361 submitted.
Resubmitted Pull Request (https://github.com/angelozerr/tern.java/pull/365)