Thanks for the explanation. This change and workflow makes sense now.

Currently, createmobilespec.js is used by the Cordova CI: 
http://ci.apache.org/builders/cordova-windows-phone8.1/builds/4/steps/creating-mobilespec-app/logs/stdio

The intent of the CI is to test the latest unreleased version of cordova.js. 
createmobilespec.js, by default, uses grunt compile to generate the latest 
cordova.js. Now that grunt compile has npm dependency - I believe cordova.js is 
being generated with the latest released version of platform cordova.js 
components and this is an issue.

I have filed a JIRA here: https://issues.apache.org/jira/browse/CB-9063

A tricky thing with this change is that npm link is now the correct way to get 
the latest unreleased version of cordova.js but that requires admin permissions 
on Windows and the cordova CI does not run with admin permissions. Perhaps the 
contents of the cordova-<platform> need to be copied to node_modules of 
cordova.js *before* generating the cordova.js.

Thanks,
Nikhil


-----Original Message-----
From: Steven Gill [mailto:stevengil...@gmail.com] 
Sent: Thursday, May 21, 2015 8:27 PM
To: dev@cordova.apache.org
Subject: Re: Cordova-js update

This change was made so we could get the browserify workflow working well.

The main advantage of the browserify workflow is build time inclusion of 
plugins javascript instead of runtime. Our old way, we use cordova_plugins.js 
to inject the javascript of every plugin at runtime.
With the browserify workflow, all of the JS for the plugins essentially gets 
concatenated to cordova.js.

createmobilespec should work the same. You still use the same grunt commands 
and it grabs the platform specific js from the platforms in the 
node_modules/PLATFORM/cordova-js-src directories. If the platform dependencies 
don't have a cordova-js-src directory (amazon, firefoxos, browser, osx) then it 
will use the src/legacy-exec/PLATFORM directories to build cordova.js.

grunt, grunt compile, grunt test all work still. You actually don't need to 
pass in the --platformVersion flag anymore as it will figure out the version 
based on the platform dependencies of cordova.js. It still accepts it though.

createmobilespec also takes a --browserify flag if you want to build the 
mobile-spec project with the browserified cordovajs. You could also just go to 
generated mobilespec project and run cordova prepare --browserify to generate 
the browserified cordova.js.

Lastly, I added support to paramedic  for the --browserify flag to test the 
plugins that way.

Let me know if you have more questions! I'd love to clear everything up.

If you are having issues with createmobilespec, please let me know the issue so 
I can investigate it. Been working fine for me.

Cheers,
-Steve







On Thu, May 21, 2015 at 5:19 PM, Nikhil Khandelwal <nikhi...@microsoft.com>
wrote:

> I'm new to this area. Steve: Can you provide some background on the 
> motivation for this change? In particular, what is the advantage of 
> this workflow, over the existing one:
>
> I have also made some changes to cordova-lib which will copy the 
> contents of cordova-js-src into platform_www when a project gets 
> created. If a user decided to do cordova prepare --browserify, it will 
> use the platform specific js files included in their app to build 
> their cordova.js. [3] [4]
>
> I think you need to update createmobilespec as it uses the grunt task 
> to generate the latest cordova.js for creating an app that is used by 
> the Apache CI (http://ci.cordova.io). Now the latest cordova.js is not 
> being generated and we are likely missing some test coverage as we 
> make changes to cordova.js.
>
> Thanks,
> Nikhil
>
> -----Original Message-----
> From: Steven Gill [mailto:stevengil...@gmail.com]
> Sent: Monday, May 18, 2015 2:18 AM
> To: dev@cordova.apache.org
> Subject: Cordova-js update
>
> I have a pull request [1] ready for cordova-js which adds platforms as 
> dev dependencies and uses the previously moved cordova-js-src from the 
> platform repos instead of src/platform. I moved existing platform 
> specific js into cordovajs/src/legacy-exec to use in cases where 
> released platforms don't have a cordova-js-src directory. [2]
>
> I have updated both normal build and browserify build to use 
> cordova-js-src if present when building cordova.js.
>
> I have also made some changes to cordova-lib which will copy the 
> contents of cordova-js-src into platform_www when a project gets 
> created. If a user decided to do cordova prepare --browserify, it will 
> use the platform specific js files included in their app to build 
> their cordova.js. [3] [4]
>
> I will need to make sure each platform has their most up to date 
> platform specific js files in cordova-platform/cordova-js-src. After 
> these PRs get merged, platform maintainers should only worry about 
> updating these files instead of what exists in cordovajs/src/legacy-exec.
>
> Let me know if you have any questions or concerns.
>
> [1] https://github.com/apache/cordova-js/pull/112
> [2] https://issues.apache.org/jira/browse/CB-8441
> [3] https://github.com/apache/cordova-lib/pull/221
> [4] https://issues.apache.org/jira/browse/CB-8965
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
> For additional commands, e-mail: dev-h...@cordova.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org

Reply via email to