]
Gorkem Ercan commented on JBIDE-15457:
--------------------------------------
Contents of the cordova_plugin.js changes only when a new plugin is installed or removed
from the project. So serving cordova_plugin.js file directly is not a big concern as
changes are not likely to happen often.
Currently hybrid tools uses a two stage installation of the plugins. On the first stage
only plugins are copied to the plugins folder and config.xml file is updated. The second
stage occurs when the project is actually launched. Hybrid tools generate a project for
the targeted platform with all the necessary changes for plugins. This essentially means
that cordova_plugin.js is not generated until the project is launched.
CordovaPluginManager already provides a method for generating the contents of
cordova_plugin.js. CordovaSim launcher can actually use this API to generate the file at a
location convenient for its use and use it from there. We can also add a notification
mechanism to CordovaPluginManager for added/removed plugins so that the file is kept
uptodate while CordovaSim is running.
I am not against creating an eclipse independent API but I am concerned about the penalty
that it brings on it further development & testing to ensure eclipse independence.
CordovaSim and Hybrid tools interaction/source code sharing
-----------------------------------------------------------
Key: JBIDE-15457
URL:
https://issues.jboss.org/browse/JBIDE-15457
Project: Tools (JBoss Tools)
Issue Type: Task
Components: aerogear-hybrid, browsersim
Reporter: Yahor Radtsevich
Assignee: Yahor Radtsevich
Fix For: 4.2.x
Currently CordovaSim application consists of two parts: a Jetty-based server, and a
BrowserSim-based client. The server part generates some content on the fly. For instance,
the server may response with generated {{cordova_plugins.js}} content when it is requested
by the client. Both parts of CordovaSim are executed in their own JVM, which means they do
not have access to the Eclipse API.
Hybrid tools do very similar things, but in static way. For instance, while creating
Android executables, they create {{cordova_plugins.js}} file on disk. Hybrid tools is a
set of Eclipse plugins, so they have access to the Eclipse API.
Obviously CordovaSim and Hybrid tools have some code in their sources that could be
shared. For the example above, both of them need a method to generate content of
{{cordova_plugins.js}}. There are several approaches to implement it:
1. Create two different implementations for CordovaSim and Hybrid tools and synchronize
them when needed (currently we do this). This approach creates code duplication problems.
2. Create an Eclipse API-independent plugin, so both CordovaSim and Hybrid tools could
set it as a dependency. This approach imposes some restriction on the independent plugin
(useful Eclipse API and libs cannot be used).
3. Move the server part of CordovaSim to the Eclipse JVM, so it could use Eclipse API and
any Hybrid tools API. With this approach we loose the ability to create standalone
CordovaSim in the future.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: