[GitHub] cordova-windows pull request: Fix for callback invocation with NO_...

2015-03-11 Thread robpaveza
Github user robpaveza commented on a diff in the pull request:

https://github.com/apache/cordova-windows/pull/61#discussion_r26281092
  
--- Diff: cordova-js-src/exec.js ---
@@ -60,18 +60,32 @@ module.exports = function (success, fail, service, 
action, args) {
 // CB-5806 [Windows8] Add keepCallback support to proxy
 onSuccess = function (result, callbackOptions) {
 callbackOptions = callbackOptions || {};
+var callbackStatus;
+if (callbackOptions.status !== null) {
--- End diff --

If the user passed undefined explicitly, it would have evaluated to falsy 
and in line 65 (pre-change) would have been replaced with 
cordova.callbackStatus.OK.  With your change, line 64's (post-change) test is 
true (undefined !== null), so local callbackStatus becomes undefined (line 65), 
and the status property is undefined (line 72 or 88).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] cordova-windows pull request: Fix for callback invocation with NO_...

2015-03-11 Thread CJRChang
Github user CJRChang commented on a diff in the pull request:

https://github.com/apache/cordova-windows/pull/61#discussion_r26280804
  
--- Diff: cordova-js-src/exec.js ---
@@ -60,18 +60,32 @@ module.exports = function (success, fail, service, 
action, args) {
 // CB-5806 [Windows8] Add keepCallback support to proxy
 onSuccess = function (result, callbackOptions) {
 callbackOptions = callbackOptions || {};
+var callbackStatus;
+if (callbackOptions.status !== null) {
--- End diff --

Yes it is - in the event that the user passes a callbackOptions but does 
not specify status, it will return null.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



RE: [GitHub] cordova-windows pull request: Fix for callback invocation with NO_...

2015-03-11 Thread Rob Paveza
Only question is if callback.status might be undefined (stands to reason if it 
can be null).  If so, the present check is insufficient and changes because you 
test with ===.

-Rob

-Original Message-
From: robpaveza [mailto:g...@git.apache.org] 
Sent: Wednesday, March 11, 2015 11:14 PM
To: dev@cordova.apache.org
Subject: [GitHub] cordova-windows pull request: Fix for callback invocation 
with NO_...

Github user robpaveza commented on a diff in the pull request:

https://github.com/apache/cordova-windows/pull/61#discussion_r26280733
  
--- Diff: cordova-js-src/exec.js ---
@@ -60,18 +60,32 @@ module.exports = function (success, fail, service, 
action, args) {
 // CB-5806 [Windows8] Add keepCallback support to proxy
 onSuccess = function (result, callbackOptions) {
 callbackOptions = callbackOptions || {};
+var callbackStatus;
+if (callbackOptions.status !== null) {
--- End diff --

Is undefined a possible value here?


---
If your project is set up for it, you can reply to this email and have your 
reply appear on GitHub as well. If your project does not have this feature 
enabled and wishes so, or if the feature is enabled but not working, please 
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with 
INFRA.
---

-
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



[GitHub] cordova-windows pull request: Fix for callback invocation with NO_...

2015-03-11 Thread robpaveza
Github user robpaveza commented on a diff in the pull request:

https://github.com/apache/cordova-windows/pull/61#discussion_r26280733
  
--- Diff: cordova-js-src/exec.js ---
@@ -60,18 +60,32 @@ module.exports = function (success, fail, service, 
action, args) {
 // CB-5806 [Windows8] Add keepCallback support to proxy
 onSuccess = function (result, callbackOptions) {
 callbackOptions = callbackOptions || {};
+var callbackStatus;
+if (callbackOptions.status !== null) {
--- End diff --

Is undefined a possible value here?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] cordova-mobile-spec pull request: [CB-8652] Createmobilespec White...

2015-03-11 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/cordova-mobile-spec/pull/122


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



Re: Why no onStart/onStop for Cordova Android plugins?

2015-03-11 Thread Andrew Grieve
Likely won't create it until closer to the event, but I'll send it to the
list as soon as I do! :)

On Wed, Mar 11, 2015 at 3:44 PM, Homer, Tony  wrote:

> Thanks for the response and the tip!
> I¹ll submit a JIRA and a PR sometime soon.
>
> As an aside, any chance we can get a preview of your ApacheCon
> presentation?
> I really need to learn how to set up my environment the right way!
> ;)
>
>
> On 3/9/15, 12:05 PM, "Andrew Grieve"  wrote:
>
> >I see no reason we couldn't add onStart / onStop.
> >
> >As an aside, if you're okay with supporting only ICS+, you can use
> >Application.registerActivityLifecycleCallbacks() as a work-around.
> >
> >
> >On Mon, Mar 9, 2015 at 11:23 AM, Homer, Tony 
> wrote:
> >
> >> I assumed that this must have been discussed at some point, but I
> >>couldn¹t
> >> find anything in the list archives or JIRA.
> >> I¹m guessing that there might be some practical issues with
> >>onStart/onStop
> >> and plugin loading timing, but it seems like if there are issues like
> >>this
> >> they could be addressed somehow.
> >>
> >> I¹m asking about this because we have an internal request to enable apps
> >> to override onStart/onStop in the Intel XDK build system in order to
> >> support plugins that want to handle onStart/onStop.
> >> My initial response was ³why not use onResume/onPause², but some plugin
> >> authors apparently believe that onStart/onStop are the lifecycle events
> >> they need.
> >>
> >> For example, the Flurry plugin instructions direct users to override
> >> onStart and onStop in their activity in order to handle onStop:
> >> https://github.com/Initsogar/cordova-flurry
> >> There are other analytics plugins that want to know about onStart/onStop
> >> instead of onPause/onResume.
> >> Obviously it is possible to modify your activity in order to do this in
> >> your project, but if this capability is important, it should be possible
> >> without abandoning the Cordova Way.
> >>
> >> So I was wondering what you guys think?
> >> onPause/onResume should be good enough for anyone?
> >> onStart/onStop are edge cases that users need to handle by modifying
> >>their
> >> activity?
> >> onStart/onStop cannot be handled by plugins due to timing issues?
> >>
> >> Thanks!
> >> Tony
> >>
> >> -
> >> 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
>
>


Re: Android's new Whitelist Plugins

2015-03-11 Thread Andrew Grieve
yes... yes I did... :) Pushed now.

On Wed, Mar 11, 2015 at 5:49 PM, Steven Gill  wrote:

> Hey Andrew,
>
> I don't see the new plugins in coho yet. Did you forget to push them?
>
> On Wed, Mar 11, 2015 at 7:35 AM, Andrew Grieve 
> wrote:
>
> > Done! They are now alive at their now spots and added to coho's plugins
> > list.
> >
> > On Thu, Mar 5, 2015 at 3:49 PM, Jesse  wrote:
> >
> > > +1
> > > better late than never
> > >
> > > @purplecabbage
> > > risingj.com
> > >
> > > On Thu, Mar 5, 2015 at 12:39 PM, Andrew Grieve 
> > > wrote:
> > >
> > > > Going with it: https://issues.apache.org/jira/browse/INFRA-9238
> > > >
> > > > On Wed, Mar 4, 2015 at 11:22 PM, Michal Mocny 
> > > wrote:
> > > >
> > > > > +1 to names.
> > > > >
> > > > > On Wed, Mar 4, 2015 at 9:03 PM, Andrew Grieve <
> agri...@chromium.org>
> > > > > wrote:
> > > > >
> > > > >> No comments about the names yet, but I'm now leaning towards:
> > > > >>
> > > > >> cordova-plugin-legacy-whitelist
> > > > >>
> > > > >> and
> > > > >>
> > > > >> cordova-plugin-whitelist
> > > > >>
> > > > >> as the two new git repos to create (rather than "url-policy")
> > > > >>
> > > > >> On Wed, Mar 4, 2015 at 8:49 PM, Andrew Grieve <
> agri...@chromium.org
> > >
> > > > >> wrote:
> > > > >>
> > > > >> > I think how Cordova works right now was the best way. Have
> access
> > > > >> blocked
> > > > >> > by default, but have a  in the default
> > template.
> > > > It
> > > > >> > makes the setting visible, while still working out-of-the-box.
> > > > >> >
> > > > >> > If we turned on requests when no whitelist plugin is installed,
> > then
> > > > >> > existing apps that have  tags will have their whitelist
> > > > removed
> > > > >> > with 4.0.0 and not know it. If someone updates and their app
> can't
> > > hit
> > > > >> the
> > > > >> > network anymore, then I think Stack Overflow will tell them why
> > > pretty
> > > > >> > quickly. We should also be very clear in the release notes and
> > > upgrade
> > > > >> > guide.
> > > > >> >
> > > > >> >
> > > > >> >
> > > > >> >
> > > > >> > On Wed, Mar 4, 2015 at 7:54 PM, Nikhil Khandelwal <
> > > > >> nikhi...@microsoft.com>
> > > > >> > wrote:
> > > > >> >
> > > > >> >> I like Ian's proposal of blocking network access only when a
> > > > whitelist
> > > > >> >> plugin is added to do so and is choosing to override the
> default
> > > > >> behavior.
> > > > >> >>
> > > > >> >> Scanning config.xml on upgrade might be a good way to warn devs
> > to
> > > > >> refer
> > > > >> >> them to use this plugin. These changes should also be
> documented
> > in
> > > > the
> > > > >> >> migration guide from Android 3.x to 4.0.
> > > > >> >>
> > > > >> >> Thanks,
> > > > >> >> Nikhil
> > > > >> >>
> > > > >> >>
> > > > >> >> -Original Message-
> > > > >> >> From: Jesse [mailto:purplecabb...@gmail.com]
> > > > >> >> Sent: Wednesday, March 4, 2015 11:05 AM
> > > > >> >> To: dev@cordova.apache.org
> > > > >> >> Subject: Re: Android's new Whitelist Plugins
> > > > >> >>
> > > > >> >> I like the defaults as discussed, regardless of how they are
> > > > achieved.
> > > > >> >> ie. network yes, intents no
> > > > >> >> This is similar to how a plain webview works if you add it to a
> > > > native
> > > > >> >> app on ios or android, at least the network part, not sure what
> > the
> > > > >> default
> > > > >> >> intent handling is.
> > > > >> >>
> > > > >> >> Are there portions of this functionality that make more sense
> as
> > > part
> > > > >> of
> > > > >> >> the platform native code?  To me a plugin that is installed by
> > > > default
> > > > >> is
> > > > >> >> just modular platform code. Is there ever a reason to NOT want
> > this
> > > > >> plugin,
> > > > >> >> versus just opening up access?
> > > > >> >>
> > > > >> >>
> > > > >> >>
> > > > >> >>
> > > > >> >>
> > > > >> >>
> > > > >> >>
> > > > >> >>
> > > > >> >>
> > > > >> >> @purplecabbage
> > > > >> >> risingj.com
> > > > >> >>
> > > > >> >> On Wed, Mar 4, 2015 at 9:37 AM, Michal Mocny <
> > mmo...@chromium.org>
> > > > >> wrote:
> > > > >> >>
> > > > >> >> > I've been working on adding support to just install the
> > whitelist
> > > > >> >> > plugin by default, and to add the  to the
> > > > default
> > > > >> >> app.
> > > > >> >> >
> > > > >> >> > Is that sufficient?  I think we may still need to do what Ian
> > > > >> suggests
> > > > >> >> > and prompt on upgrade (or prepare)?
> > > > >> >> >
> > > > >> >> > For downstreams, especially IDE based ones, they will need to
> > > make
> > > > >> >> > sure the plugin is added by default however they do that.
> > > > >> >> >
> > > > >> >> > On Wed, Mar 4, 2015 at 12:06 PM, Ian Clelland <
> > > > >> iclell...@chromium.org>
> > > > >> >> > wrote:
> > > > >> >> >
> > > > >> >> > > On Tue, Mar 3, 2015 at 8:20 PM, Nikhil Khandelwal <
> > > > >> >> > nikhi...@microsoft.com>
> > > > >> >> > > wrote:
> > > > >> >> > >
> > > > >> >> > > > Here are my thoughts on the default behavior:
> > > > >> >> > > > - navigation should 

Re: CSP policy

2015-03-11 Thread Andrew Grieve
Great questions! Certainly was hoping to get more eyes on this!

Not sure where a good spot to document this is, but maybe right in the
template is okay? That way users will also know the rationale :)



On Wed, Mar 11, 2015 at 2:04 PM, Nikhil Khandelwal 
wrote:

> Thanks for bringing this to notice. Forking the thread for better
> understanding of the default CSP policy. Can you provide more details of
> the rationale behind this CSP policy?
> https://ssl.gstatic.com/accessibility/javascript/android/; style-src
> 'self' 'unsafe-inline'; media-src: *">
>
> Few specific questions:
> - 'gap:' - could not find documentation on this - what does this mean?
>
Needed only on iOS, because it navigates iframes to that URL for it's
exec() bridge.


> - Why is https://ssl.gstatic.com/accessibility/javascript/android/ URL
> there for all platforms? Why is it even needed for Android?
>
Needed only on Android and is needed (crazily) to not break TalkBack
(screen reader). Note that CSP right now ignores paths, so that actually
has the effect of whitelisting all of ssl.gstatic.com


> - 'unsafe-eval' is not present - does that mean evals do not work. I know
> a number of templating libraries depend on this.
>
Correct. My thinking here is that both FFOS and Chrome Apps both decided
that this is a good policy for packaged apps with access to "dangerous"
APIs, and so it would make a good default for us as well.


>
> Thanks,
> Nikhil
>
>
> -Original Message-
> From: agri...@google.com [mailto:agri...@google.com] On Behalf Of Andrew
> Grieve
> Sent: Wednesday, March 11, 2015 7:16 AM
> To: dev
> Subject: Re: [Vote] 3.8.0 Cordova App Hello World Release
>
> Note that this pulls in the addition of a content-security-policy 
> tag.
> Please ensure that this doesn't break your platform when voting.
>
> On Tue, Mar 10, 2015 at 7:30 PM, Steven Gill 
> wrote:
>
> > Please review and vote on this 3.8.0 Cordova App Hello World Release.
> >
> > Release issue: https://issues.apache.org/jira/browse/CB-8645
> >
> > Repos ready to be released have been published to
> > dist/dev:https://dist.apache.org/repos/dist/dev/cordova/CB-8645
> >
> > The package was published from its corresponding git tag:
> > cordova-app-hello-world: 3.8.0 (0b55140d09)
> >
> > Upon a successful vote I will upload the archive to dist/ and publish
> > it to NPM.
> >
> > Voting guidelines:
> > https://github.com/apache/cordova-coho/blob/master/docs/release-voting
> > .md
> >
> > Voting will go on for a minimum of 48 hours.
> >
> > I vote +1:
> > * Ran coho audit-license-headers over the relevant repos
> > * Ran coho check-license to ensure all dependencies and
> > subdependencies have Apache-compatible licenses
> > * Built a hello world app using the CLI
> >
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
> For additional commands, e-mail: dev-h...@cordova.apache.org
>


Re: Consolidating platform specific code from different places in cordova-lib

2015-03-11 Thread Andrew Grieve
LGTM!

On Wed, Mar 11, 2015 at 1:59 PM, Rob Paveza 
wrote:

> LGTM.  Only weird thing is that the platforms lib is in
> '../platforms/platforms' moved from just '../platforms' - but not a big
> deal in the least.
>
> -Original Message-
> From: mmo...@google.com [mailto:mmo...@google.com] On Behalf Of Michal
> Mocny
> Sent: Wednesday, March 11, 2015 7:29 AM
> To: dev
> Subject: Re: Consolidating platform specific code from different places in
> cordova-lib
>
> Reviewed, left comments.  Overall looks good, thanks Mark.
>
> However, seems you left something uncommitted, since you literally cannot
> require('cordova-lib'); without an exception thrown.  Yet all the
> cordova-lib tests pass.  What does it say about the quality of the tests ;)
>
> On Tue, Mar 10, 2015 at 6:24 PM, Jesse  wrote:
>
> > Had a quick look, looks great!
> >
> > @purplecabbage
> > risingj.com
> >
> > On Tue, Mar 10, 2015 at 3:09 PM, Mark Koudritsky 
> > wrote:
> >
> > > I've created a pull request with changes across cordova-lib that
> > > should make it much easier to consolidate the platform specific code
> > > in cordova-lib to reduce duplication and maybe eventually move this
> > > code to the platforms repos.
> > >
> > > https://github.com/apache/cordova-lib/pull/183
> > > Feedback is welcome.
> > >
> > > Those changes only deal with interfacing the platform specific code
> > > from cordova/metadata/ and plugman/platforms/ dirs, the dirs
> > > themselves and their contents weren't changed yet.
> > >
> >
>


RE: [Vote] 3.8.0 Cordova App Hello World Release

2015-03-11 Thread Parashuram N (MS OPEN TECH)
I think if we change the tag, we will have to vote again. However, we don’t 
have to necessarily wait for 72 hours, for a fix that is small. 

-Original Message-
From: agri...@google.com [mailto:agri...@google.com] On Behalf Of Andrew Grieve
Sent: Wednesday, March 11, 2015 6:18 PM
To: dev
Subject: Re: [Vote] 3.8.0 Cordova App Hello World Release

-1 Verified it works on the latest release iOS and Android, but I had a typo in 
the CSP string:
https://github.com/apache/cordova-app-hello-world/commit/18fc9b4eaecd90bf35795c31a7801bc5260b5c6c

Perhaps we could re-spin with this one fix and leave the vote end period the 
same (assuming everyone can still verify based on this one-character change)?

On Wed, Mar 11, 2015 at 2:13 PM, Parashuram N (MS OPEN TECH) < 
panar...@microsoft.com> wrote:

> Voting +1 for this. Also did initial tests on Windows, seems to work
>
> •   Verified signatures and hashes
> •   Verified tags
> •   Verified that app can be built and ran under windows, wp8 and android
> platforms
> •   Verified release notes:
>   + added license header to config.xml
>   + added releasenotes.md
>   + removed version file, package.json can keep track of version
>   + Adding hooks to default app
>   + [CB-8597] First attempt at importing cordova-app-hello-world 
> via npm dependency
>   + Remove jasmine ref
>   + Tweak CSP string
>   + CB-8295 Add content-security-policy  to template
>   + Remove target-density and height=device-height from 
>   + Remove self-closing slashes from  since this isn't xhtml
>
>
> -Original Message-
> From: agri...@google.com [mailto:agri...@google.com] On Behalf Of 
> Andrew Grieve
> Sent: Wednesday, March 11, 2015 7:16 AM
> To: dev
> Subject: Re: [Vote] 3.8.0 Cordova App Hello World Release
>
> Note that this pulls in the addition of a content-security-policy 
>  tag.
> Please ensure that this doesn't break your platform when voting.
>
> On Tue, Mar 10, 2015 at 7:30 PM, Steven Gill 
> wrote:
>
> > Please review and vote on this 3.8.0 Cordova App Hello World Release.
> >
> > Release issue: https://issues.apache.org/jira/browse/CB-8645
> >
> > Repos ready to be released have been published to
> > dist/dev:https://dist.apache.org/repos/dist/dev/cordova/CB-8645
> >
> > The package was published from its corresponding git tag:
> > cordova-app-hello-world: 3.8.0 (0b55140d09)
> >
> > Upon a successful vote I will upload the archive to dist/ and 
> > publish it to NPM.
> >
> > Voting guidelines:
> > https://github.com/apache/cordova-coho/blob/master/docs/release-voti
> > ng
> > .md
> >
> > Voting will go on for a minimum of 48 hours.
> >
> > I vote +1:
> > * Ran coho audit-license-headers over the relevant repos
> > * Ran coho check-license to ensure all dependencies and 
> > subdependencies have Apache-compatible licenses
> > * Built a hello world app using the CLI
> >
>


Re: [Vote] 3.8.0 Cordova App Hello World Release

2015-03-11 Thread Andrew Grieve
-1 Verified it works on the latest release iOS and Android, but I had a
typo in the CSP string:
https://github.com/apache/cordova-app-hello-world/commit/18fc9b4eaecd90bf35795c31a7801bc5260b5c6c

Perhaps we could re-spin with this one fix and leave the vote end period
the same (assuming everyone can still verify based on this one-character
change)?

On Wed, Mar 11, 2015 at 2:13 PM, Parashuram N (MS OPEN TECH) <
panar...@microsoft.com> wrote:

> Voting +1 for this. Also did initial tests on Windows, seems to work
>
> •   Verified signatures and hashes
> •   Verified tags
> •   Verified that app can be built and ran under windows, wp8 and android
> platforms
> •   Verified release notes:
>   + added license header to config.xml
>   + added releasenotes.md
>   + removed version file, package.json can keep track of version
>   + Adding hooks to default app
>   + [CB-8597] First attempt at importing cordova-app-hello-world via
> npm dependency
>   + Remove jasmine ref
>   + Tweak CSP string
>   + CB-8295 Add content-security-policy  to template
>   + Remove target-density and height=device-height from 
>   + Remove self-closing slashes from  since this isn't xhtml
>
>
> -Original Message-
> From: agri...@google.com [mailto:agri...@google.com] On Behalf Of Andrew
> Grieve
> Sent: Wednesday, March 11, 2015 7:16 AM
> To: dev
> Subject: Re: [Vote] 3.8.0 Cordova App Hello World Release
>
> Note that this pulls in the addition of a content-security-policy 
> tag.
> Please ensure that this doesn't break your platform when voting.
>
> On Tue, Mar 10, 2015 at 7:30 PM, Steven Gill 
> wrote:
>
> > Please review and vote on this 3.8.0 Cordova App Hello World Release.
> >
> > Release issue: https://issues.apache.org/jira/browse/CB-8645
> >
> > Repos ready to be released have been published to
> > dist/dev:https://dist.apache.org/repos/dist/dev/cordova/CB-8645
> >
> > The package was published from its corresponding git tag:
> > cordova-app-hello-world: 3.8.0 (0b55140d09)
> >
> > Upon a successful vote I will upload the archive to dist/ and publish
> > it to NPM.
> >
> > Voting guidelines:
> > https://github.com/apache/cordova-coho/blob/master/docs/release-voting
> > .md
> >
> > Voting will go on for a minimum of 48 hours.
> >
> > I vote +1:
> > * Ran coho audit-license-headers over the relevant repos
> > * Ran coho check-license to ensure all dependencies and
> > subdependencies have Apache-compatible licenses
> > * Built a hello world app using the CLI
> >
>


[GitHub] cordova-windows pull request: Fix for callback invocation with NO_...

2015-03-11 Thread CJRChang
GitHub user CJRChang opened a pull request:

https://github.com/apache/cordova-windows/pull/61

Fix for callback invocation with NO_RESULT

Due to the enumeration of cordova.callbackStatus (NO_RESULT = 0 and OK = 
1), the logic used for defaulting to cordova.callbackStatus.OK will always 
default to cordova.callbackStatus.OK when the callbackStatus is set to 
cordova.callbackStatus.NO_RESULT.

This change addresses this issue by first checking if 
callbackOptions.status is null and defaulting to cordova.callbackStatus.OK, 
otherwise it will accept the callbackOptions.status value provided by the user.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/CJRChang/cordova-windows patch-1

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/cordova-windows/pull/61.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #61


commit 1e4b5330103af18a75dd82772eab3541b6436f19
Author: CJRChang 
Date:   2015-03-12T01:14:38Z

Fix for callback invocation with NO_RESULT

Due to the enumeration of cordova.callbackStatus (NO_RESULT = 0 and OK = 
1), the logic used for defaulting to cordova.callbackStatus.OK will always 
default to cordova.callbackStatus.OK when the callbackStatus is set to 
cordova.callbackStatus.NO_RESULT.

This change addresses this issue by first checking if 
callbackOptions.status is null and defaulting to cordova.callbackStatus.OK, 
otherwise it will accept the callbackOptions.status value provided by the user.




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



RE: March 2015 Board Report for Apache Cordova

2015-03-11 Thread Mefire O .
Looks good, Shaz.

From: Michael Brooks
Sent: ‎3/‎11/‎2015 4:28 PM
To: dev@cordova.apache.org
Subject: Re: March 2015 Board Report for Apache Cordova

Excellent board report Shaz!

On Wed, Mar 11, 2015 at 3:38 PM, Shazron  wrote:

> https://github.com/cordova/apache-board-reports/blob/master/2015/2015-03.md
>
> I intend to submit this by EOD, let me know if any edits needed.
>
> I did not include any releases where votes are under way.
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
> For additional commands, e-mail: dev-h...@cordova.apache.org
>
>


Re: March 2015 Board Report for Apache Cordova

2015-03-11 Thread Michael Brooks
Excellent board report Shaz!

On Wed, Mar 11, 2015 at 3:38 PM, Shazron  wrote:

> https://github.com/cordova/apache-board-reports/blob/master/2015/2015-03.md
>
> I intend to submit this by EOD, let me know if any edits needed.
>
> I did not include any releases where votes are under way.
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
> For additional commands, e-mail: dev-h...@cordova.apache.org
>
>


[GitHub] cordova-lib pull request: CB-8634 : `cordova platform add git_url#...

2015-03-11 Thread omefire
Github user omefire commented on the pull request:

https://github.com/apache/cordova-lib/pull/180#issuecomment-78390923
  
This change was merged in.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



March 2015 Board Report for Apache Cordova

2015-03-11 Thread Shazron
https://github.com/cordova/apache-board-reports/blob/master/2015/2015-03.md

I intend to submit this by EOD, let me know if any edits needed.

I did not include any releases where votes are under way.

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



[GitHub] cordova-mobile-spec pull request: [CB-8652] Createmobilespec White...

2015-03-11 Thread dblotsky
Github user dblotsky commented on the pull request:

https://github.com/apache/cordova-mobile-spec/pull/122#issuecomment-78388071
  
@agrieve could you please take a look if you have a convenient time? Thank 
you!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] cordova-lib pull request: CB-8636 Remove FEATURE_SPECIAL_PARAMS fr...

2015-03-11 Thread omefire
Github user omefire commented on the pull request:

https://github.com/apache/cordova-lib/pull/181#issuecomment-78387046
  
closing this PR because #182 went in.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] cordova-lib pull request: CB-8636 Remove FEATURE_SPECIAL_PARAMS fr...

2015-03-11 Thread omefire
Github user omefire closed the pull request at:

https://github.com/apache/cordova-lib/pull/181


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



Re: Android's new Whitelist Plugins

2015-03-11 Thread Steven Gill
Hey Andrew,

I don't see the new plugins in coho yet. Did you forget to push them?

On Wed, Mar 11, 2015 at 7:35 AM, Andrew Grieve  wrote:

> Done! They are now alive at their now spots and added to coho's plugins
> list.
>
> On Thu, Mar 5, 2015 at 3:49 PM, Jesse  wrote:
>
> > +1
> > better late than never
> >
> > @purplecabbage
> > risingj.com
> >
> > On Thu, Mar 5, 2015 at 12:39 PM, Andrew Grieve 
> > wrote:
> >
> > > Going with it: https://issues.apache.org/jira/browse/INFRA-9238
> > >
> > > On Wed, Mar 4, 2015 at 11:22 PM, Michal Mocny 
> > wrote:
> > >
> > > > +1 to names.
> > > >
> > > > On Wed, Mar 4, 2015 at 9:03 PM, Andrew Grieve 
> > > > wrote:
> > > >
> > > >> No comments about the names yet, but I'm now leaning towards:
> > > >>
> > > >> cordova-plugin-legacy-whitelist
> > > >>
> > > >> and
> > > >>
> > > >> cordova-plugin-whitelist
> > > >>
> > > >> as the two new git repos to create (rather than "url-policy")
> > > >>
> > > >> On Wed, Mar 4, 2015 at 8:49 PM, Andrew Grieve  >
> > > >> wrote:
> > > >>
> > > >> > I think how Cordova works right now was the best way. Have access
> > > >> blocked
> > > >> > by default, but have a  in the default
> template.
> > > It
> > > >> > makes the setting visible, while still working out-of-the-box.
> > > >> >
> > > >> > If we turned on requests when no whitelist plugin is installed,
> then
> > > >> > existing apps that have  tags will have their whitelist
> > > removed
> > > >> > with 4.0.0 and not know it. If someone updates and their app can't
> > hit
> > > >> the
> > > >> > network anymore, then I think Stack Overflow will tell them why
> > pretty
> > > >> > quickly. We should also be very clear in the release notes and
> > upgrade
> > > >> > guide.
> > > >> >
> > > >> >
> > > >> >
> > > >> >
> > > >> > On Wed, Mar 4, 2015 at 7:54 PM, Nikhil Khandelwal <
> > > >> nikhi...@microsoft.com>
> > > >> > wrote:
> > > >> >
> > > >> >> I like Ian's proposal of blocking network access only when a
> > > whitelist
> > > >> >> plugin is added to do so and is choosing to override the default
> > > >> behavior.
> > > >> >>
> > > >> >> Scanning config.xml on upgrade might be a good way to warn devs
> to
> > > >> refer
> > > >> >> them to use this plugin. These changes should also be documented
> in
> > > the
> > > >> >> migration guide from Android 3.x to 4.0.
> > > >> >>
> > > >> >> Thanks,
> > > >> >> Nikhil
> > > >> >>
> > > >> >>
> > > >> >> -Original Message-
> > > >> >> From: Jesse [mailto:purplecabb...@gmail.com]
> > > >> >> Sent: Wednesday, March 4, 2015 11:05 AM
> > > >> >> To: dev@cordova.apache.org
> > > >> >> Subject: Re: Android's new Whitelist Plugins
> > > >> >>
> > > >> >> I like the defaults as discussed, regardless of how they are
> > > achieved.
> > > >> >> ie. network yes, intents no
> > > >> >> This is similar to how a plain webview works if you add it to a
> > > native
> > > >> >> app on ios or android, at least the network part, not sure what
> the
> > > >> default
> > > >> >> intent handling is.
> > > >> >>
> > > >> >> Are there portions of this functionality that make more sense as
> > part
> > > >> of
> > > >> >> the platform native code?  To me a plugin that is installed by
> > > default
> > > >> is
> > > >> >> just modular platform code. Is there ever a reason to NOT want
> this
> > > >> plugin,
> > > >> >> versus just opening up access?
> > > >> >>
> > > >> >>
> > > >> >>
> > > >> >>
> > > >> >>
> > > >> >>
> > > >> >>
> > > >> >>
> > > >> >>
> > > >> >> @purplecabbage
> > > >> >> risingj.com
> > > >> >>
> > > >> >> On Wed, Mar 4, 2015 at 9:37 AM, Michal Mocny <
> mmo...@chromium.org>
> > > >> wrote:
> > > >> >>
> > > >> >> > I've been working on adding support to just install the
> whitelist
> > > >> >> > plugin by default, and to add the  to the
> > > default
> > > >> >> app.
> > > >> >> >
> > > >> >> > Is that sufficient?  I think we may still need to do what Ian
> > > >> suggests
> > > >> >> > and prompt on upgrade (or prepare)?
> > > >> >> >
> > > >> >> > For downstreams, especially IDE based ones, they will need to
> > make
> > > >> >> > sure the plugin is added by default however they do that.
> > > >> >> >
> > > >> >> > On Wed, Mar 4, 2015 at 12:06 PM, Ian Clelland <
> > > >> iclell...@chromium.org>
> > > >> >> > wrote:
> > > >> >> >
> > > >> >> > > On Tue, Mar 3, 2015 at 8:20 PM, Nikhil Khandelwal <
> > > >> >> > nikhi...@microsoft.com>
> > > >> >> > > wrote:
> > > >> >> > >
> > > >> >> > > > Here are my thoughts on the default behavior:
> > > >> >> > > > - navigation should be disabled.
> > > >> >> > > > - XHR & network request should be enabled.
> > > >> >> > > >
> > > >> >> > >
> > > >> >> > > And application launch through intent URLs should also be
> > > disabled.
> > > >> >> > > (IMO)
> > > >> >> > >
> > > >> >> > > That's not a bad default -- it enables CSP usage by default,
> > > which
> > > >> I
> > > >> >> > think
> > > >> >> > > is good. It also (I think) means we're giving up on
> suggesting
> > > that
> > > >> >

Re: Some thoughts/questions on the new --save feature

2015-03-11 Thread John M. Wargo

You used to be able to pass settings for the project's config.json file on the 
command line to create:

cordova create test com.johnwargo.test Test {\"autosave\":\"true\"}

That worked pre-4.0 but didn't seem to work in my moments ago test of this with 
the latest version. It would make the .cordova folder and populate the .json 
file with any parameters that were passed on the command line. At SAP we use 
this to help developers set the plugin search path so the CLI can find locally 
installed dependent plugins.

Was this (admittedly ugly) feature removed?

On 3/6/2015 9:30 PM, Mefire O. wrote:

- autosave IS a released feature. The 4.3.0 release includes it.
- I don't think the feature may go away, I think it just feels dirty to 
instruct users to directly edit the .cordova/config.json file. It doesn't seem 
to me like it contributes a good user experience.
- I like the idea of having a command to hide this from the user as suggested 
by Jesse : 'cordova config [--global] autosave true|false'.

If we decide to go the 'cordova config' route, I think it might make sense to 
wait on documenting it until it's in.
Otherwise, we should just go ahead and document it.

Thanks,
Mefire


-Original Message-
From: Raymond Camden [mailto:raymondcam...@gmail.com]
Sent: Friday, March 6, 2015 6:09 PM
To: dev@cordova.apache.org
Subject: Re: Some thoughts/questions on the new --save feature

Well to be clear, I thought at first this was a *released* feature, just not 
one documented well. (Or maybe documented and I missed it - I miss crap all the 
time.)

If I understand right, this is a feature, but one that may go away, so there 
may not be a need to document it.

Or maybe not - this thread has gone back and forth a bit. ;)

In my opinion, the ability to modify the CLI at the global or project level 
seems interesting. Maybe not terribly useful to most, but it seems like a good 
feature, so I'd be in favor of this being documented. (I don't actually see me 
adding this to my book - it feels too out there.)

But what I really want is to hear a firm decision. :)

On Fri, Mar 6, 2015 at 6:59 PM, Jesse  wrote:

We are not expecting users to modify this file, afaik.
Raymond is living on the cutting edge because he is writing a book, so
he wants details before they are available.

Personally, I would expect that we would mimic git with something like :
cordova config [--global] autosave true|false

But all of this is currently sausage ingredients ...




@purplecabbage
risingj.com

On Fri, Mar 6, 2015 at 4:43 PM, Nikhil Khandelwal

wrote:


If we are expecting users of the CLI to modify this config.json file,
not only should we document it but also make it easy for them to edit
it. The analogy of git's config management comes to mind - with both
support for local & global preferences. However, looks like
'autosave' is the only user preference that we might have for now.

Thanks,
Nikhil

-Original Message-
From: Mefire O. [mailto:ommen...@microsoft.com]
Sent: Thursday, March 5, 2015 12:37 PM
To: dev@cordova.apache.org
Subject: RE: Some thoughts/questions on the new --save feature

Yep, I think both options should be documented.

Thanks,
Mefire

-Original Message-
From: agri...@google.com [mailto:agri...@google.com] On Behalf Of
Andrew Grieve
Sent: Thursday, March 5, 2015 11:28 AM
To: dev
Subject: Re: Some thoughts/questions on the new --save feature

I don't have strong feelings about this.

When designing this, some wanted to have --save be default, some
wanted to match npm for the sake of matching npm. In the end both
ways were implemented.

I don't think we need to spend a lot of time on strategizing this. If
some one wants to doc it, go for it.

On Thu, Mar 5, 2015 at 12:34 PM, Victor Sosa 
wrote:


So, to me this file is a good way to automate the autosave feature
just as Gorkem is pointing (configure the JSON file, add plugins in
the usual way with cordova plugin add and share your project, no
flags needed to simply allow a good, or best,  SCM practice), but
it has been mentioned that the consensus is to not promote it, does
this mean at some point the support will be dropped? Is it considered 
experimental?

2015-03-05 11:17 GMT-06:00 Gorkem Ercan :



On 5 Mar 2015, at 12:01, Raymond Camden wrote:

  "just one way of doing things"

This confuses me though. It seemed as if this new config (I mean
new to me) was a way to configure the CLI. Is there another way
to configure the CLI? With the example that was given (default
to auto
save) being a preference for the tooling - can we accomplish
that another way?



That is the only way to enable auto save.
That preference is originally added for IDEs, build servers etc.
that use CLI.
However I think it does provide a more natural flow at least for me.
If

we

think we do not like config.json
then we should think about a more acceptable way to enable that
functionality.


  On Thu, Mar 5, 2015 at 10:50 AM, Andrew Grieve


wrote:


I don't think they a

[GitHub] cordova-ios pull request: CB-3360 Set custom User-Agent

2015-03-11 Thread sinofool
Github user sinofool commented on the pull request:

https://github.com/apache/cordova-ios/pull/131#issuecomment-78368407
  
Thanks @shazron


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] cordova-mobile-spec pull request: Createmobilespec Whitelist Fix

2015-03-11 Thread dblotsky
GitHub user dblotsky opened a pull request:

https://github.com/apache/cordova-mobile-spec/pull/122

Createmobilespec Whitelist Fix

Searching for whitelist plugin in top dir instead of cordova-plugins. Also 
factoring out plugin installation into a function. This is change relates to 
these ones: apache/cordova-plugins@65775dd59f0ac70fe4c27628bd6f339d6dae6ea3, 
and apache/cordova-plugin-whitelist@4c66fc80237735e899de0f2587da04bb206443c0.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/MSOpenTech/cordova-mobile-spec whitelist-move

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/cordova-mobile-spec/pull/122.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #122


commit 0b7e5984b86236ecb9672c75a0a85e0289cef51c
Author: Dmitry Blotsky 
Date:   2015-03-11T20:05:07Z

Searching for whitelist plugin in top dir instead of cordova-plugins. Also 
factoring out plugin installation into a function.




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] cordova-ios pull request: CB-3360 Set custom User-Agent

2015-03-11 Thread shazron
Github user shazron commented on the pull request:

https://github.com/apache/cordova-ios/pull/131#issuecomment-78356414
  
Note: will review this for the next release, on the 4.0.x branch. Sorry 
it's taking so long but we were working on getting the 3.8.0 release out with 
bug fixes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



Re: Why no onStart/onStop for Cordova Android plugins?

2015-03-11 Thread Homer, Tony
Thanks for the response and the tip!
I¹ll submit a JIRA and a PR sometime soon.

As an aside, any chance we can get a preview of your ApacheCon
presentation?
I really need to learn how to set up my environment the right way!
;)


On 3/9/15, 12:05 PM, "Andrew Grieve"  wrote:

>I see no reason we couldn't add onStart / onStop.
>
>As an aside, if you're okay with supporting only ICS+, you can use
>Application.registerActivityLifecycleCallbacks() as a work-around.
>
>
>On Mon, Mar 9, 2015 at 11:23 AM, Homer, Tony  wrote:
>
>> I assumed that this must have been discussed at some point, but I
>>couldn¹t
>> find anything in the list archives or JIRA.
>> I¹m guessing that there might be some practical issues with
>>onStart/onStop
>> and plugin loading timing, but it seems like if there are issues like
>>this
>> they could be addressed somehow.
>>
>> I¹m asking about this because we have an internal request to enable apps
>> to override onStart/onStop in the Intel XDK build system in order to
>> support plugins that want to handle onStart/onStop.
>> My initial response was ³why not use onResume/onPause², but some plugin
>> authors apparently believe that onStart/onStop are the lifecycle events
>> they need.
>>
>> For example, the Flurry plugin instructions direct users to override
>> onStart and onStop in their activity in order to handle onStop:
>> https://github.com/Initsogar/cordova-flurry
>> There are other analytics plugins that want to know about onStart/onStop
>> instead of onPause/onResume.
>> Obviously it is possible to modify your activity in order to do this in
>> your project, but if this capability is important, it should be possible
>> without abandoning the Cordova Way.
>>
>> So I was wondering what you guys think?
>> onPause/onResume should be good enough for anyone?
>> onStart/onStop are edge cases that users need to handle by modifying
>>their
>> activity?
>> onStart/onStop cannot be handled by plugins due to timing issues?
>>
>> Thanks!
>> Tony
>>
>> -
>> 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



RE: CSP policy

2015-03-11 Thread Nikhil Khandelwal
Thanks for bringing this to notice. Forking the thread for better understanding 
of the default CSP policy. Can you provide more details of the rationale behind 
this CSP policy?
https://ssl.gstatic.com/accessibility/javascript/android/; style-src 
'self' 'unsafe-inline'; media-src: *">

Few specific questions:
- 'gap:' - could not find documentation on this - what does this mean?
- Why is https://ssl.gstatic.com/accessibility/javascript/android/ URL there 
for all platforms? Why is it even needed for Android?
- 'unsafe-eval' is not present - does that mean evals do not work. I know a 
number of templating libraries depend on this.

Thanks,
Nikhil


-Original Message-
From: agri...@google.com [mailto:agri...@google.com] On Behalf Of Andrew Grieve
Sent: Wednesday, March 11, 2015 7:16 AM
To: dev
Subject: Re: [Vote] 3.8.0 Cordova App Hello World Release

Note that this pulls in the addition of a content-security-policy  tag.
Please ensure that this doesn't break your platform when voting.

On Tue, Mar 10, 2015 at 7:30 PM, Steven Gill  wrote:

> Please review and vote on this 3.8.0 Cordova App Hello World Release.
>
> Release issue: https://issues.apache.org/jira/browse/CB-8645
>
> Repos ready to be released have been published to
> dist/dev:https://dist.apache.org/repos/dist/dev/cordova/CB-8645
>
> The package was published from its corresponding git tag:
> cordova-app-hello-world: 3.8.0 (0b55140d09)
>
> Upon a successful vote I will upload the archive to dist/ and publish 
> it to NPM.
>
> Voting guidelines:
> https://github.com/apache/cordova-coho/blob/master/docs/release-voting
> .md
>
> Voting will go on for a minimum of 48 hours.
>
> I vote +1:
> * Ran coho audit-license-headers over the relevant repos
> * Ran coho check-license to ensure all dependencies and 
> subdependencies have Apache-compatible licenses
> * Built a hello world app using the CLI
>

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


RE: Consolidating platform specific code from different places in cordova-lib

2015-03-11 Thread Rob Paveza
LGTM.  Only weird thing is that the platforms lib is in 
'../platforms/platforms' moved from just '../platforms' - but not a big deal in 
the least.

-Original Message-
From: mmo...@google.com [mailto:mmo...@google.com] On Behalf Of Michal Mocny
Sent: Wednesday, March 11, 2015 7:29 AM
To: dev
Subject: Re: Consolidating platform specific code from different places in 
cordova-lib

Reviewed, left comments.  Overall looks good, thanks Mark.

However, seems you left something uncommitted, since you literally cannot 
require('cordova-lib'); without an exception thrown.  Yet all the cordova-lib 
tests pass.  What does it say about the quality of the tests ;)

On Tue, Mar 10, 2015 at 6:24 PM, Jesse  wrote:

> Had a quick look, looks great!
>
> @purplecabbage
> risingj.com
>
> On Tue, Mar 10, 2015 at 3:09 PM, Mark Koudritsky 
> wrote:
>
> > I've created a pull request with changes across cordova-lib that 
> > should make it much easier to consolidate the platform specific code 
> > in cordova-lib to reduce duplication and maybe eventually move this 
> > code to the platforms repos.
> >
> > https://github.com/apache/cordova-lib/pull/183
> > Feedback is welcome.
> >
> > Those changes only deal with interfacing the platform specific code 
> > from cordova/metadata/ and plugman/platforms/ dirs, the dirs 
> > themselves and their contents weren't changed yet.
> >
>


[GitHub] cordova-lib pull request: CB-8595 Merge platforms.js from cordova ...

2015-03-11 Thread purplecabbage
Github user purplecabbage commented on a diff in the pull request:

https://github.com/apache/cordova-lib/pull/183#discussion_r26233744
  
--- Diff: cordova-lib/src/PluginInfo.js ---
@@ -288,6 +293,19 @@ function PluginInfo(dirname) {
 return ret;
 });
 };
+
+self.getFilesAndFrameworks = getFilesAndFrameworks;
+function getFilesAndFrameworks(platform) {
+var items = [];
+// Please avoid changing the order of the calls below, files will 
be
+// installed in this order.
+items = items.concat(self.getSourceFiles(platform));
+items = items.concat(self.getHeaderFiles(platform));
+items = items.concat(self.getResourceFiles(platform));
+items = items.concat(self.getFrameworks(platform));
+items = items.concat(self.getLibFiles(platform));
--- End diff --

I would recommend :
var items = [];
items = items.concat(self.getSourceFiles(platform),
  self.getHeaderFiles(platform),
  ... );
// unnecessarily tricky code is a barrier to some, clarity is king


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] cordova-medic pull request: Medic Refactor

2015-03-11 Thread dblotsky
Github user dblotsky commented on a diff in the pull request:

https://github.com/apache/cordova-medic/pull/37#discussion_r26228733
  
--- Diff: buildbot-conf/cordova.conf ---
@@ -0,0 +1,336 @@
+import os
+import re
+import json
+
+from buildbot.schedulers.basic import SingleBranchScheduler, 
AnyBranchScheduler
+from buildbot.schedulers.forcesched import ForceScheduler
+from buildbot.schedulers.timed import Nightly
+
+from buildbot.changes.gitpoller import GitPoller
+from buildbot.changes import filter as change_filter
+
+from buildbot.process.factory import BuildFactory
+from buildbot.config import BuilderConfig
+
+from buildbot.process.properties import renderer
+from buildbot.process.properties import Property as P
+from buildbot.process.properties import Interpolate as I
+
+from buildbot.steps.source.git import Git
+from buildbot.steps.transfer import FileDownload
+from buildbot.steps.shell import ShellCommand
+from buildbot.steps.master import SetProperty
+
+from buildbot.status.results import SUCCESS
+
+# config
+MEDIC_CONFIG_FILE= os.path.join(FP, 'cordova-config.json')
+PROJECTS_CONFIG_FILE = os.path.join(FP, 'cordova-repos.json')
+
+def parse_config_file(file_name):
+with open(file_name, 'r') as config_file:
+return json.load(config_file)
+
+medic_config= parse_config_file(MEDIC_CONFIG_FILE)
+projects_config = parse_config_file(PROJECTS_CONFIG_FILE)
+
+# constants
+DEFAULT_REPO_NAME = 'src'
+BASE_WORKDIR  = '.'
+TEST_APP_NAME = 'mobilespec'
+
+OSX = 'osx'
+LINUX   = 'linux'
+WINDOWS = 'windows'
+
+# patterns
+CORDOVA_REPO_PATTERN = r'^.*(cordova-[^\.]+)\.git$'
+
+# interpretation of every byte-sized return code as success
+ALWAYS_SUCCESS = {i: SUCCESS for i in range(0, 256)}
+
+### UTILITIES
+
+# helper functions
+def cordova_builders():
+return [b.name for b in c['builders'] if b.name.startswith('cordova-')]
+
+def repo_name_from_url(url):
+match = re.match(CORDOVA_REPO_PATTERN, url)
+if match is not None:
+return match.group(1)
+return DEFAULT_REPO_NAME
+
+def repo_codebase_from_name(name):
+repo  = projects_config[name]
+codebase_name = repo['codebase']
+return repo['codebases'][codebase_name]
+
+def repo_url_from_name(name):
+return repo_codebase_from_name(name)['repo']
+
+def repo_branch_from_name(name):
+return repo_codebase_from_name(name)['branch']
+
+def slugify(string):
+return string.replace(' ', '-')
+
+def running_tasks_on_platform(platform_name, os_name):
+"""
+Return the names of tasks possibly started by
+builds on the given platform and OS.
+"""
+if platform_name == 'windows':
+return ['WWAHost.exe']
+elif platform_name == 'wp8':
+return ['Xde.exe']
+elif platform_name == 'ios':
+return ['iOS Simulator']
+return []
+
+def can_find_running_tasks(step):
+"""
+Return true if an OS and a platform is specified. Those are the
+criteria for finding a task because running_tasks_on_platform uses
+those properties to determine which tasks could be running.
+"""
+return (
+(step.build.getProperty('slaveos') is not None) and
+(step.build.getProperty('platform') is not None)
+)
+
+# renderers
+@renderer
+def render_repo_name(props):
+repo_url = props.getProperty('repository')
+return repo_name_from_url(repo_url)
+
+@renderer
+def render_task_kill_command(props):
+
+os_name   = props.getProperty('slaveos')
+platform_name = props.getProperty('platform')
+running_tasks = running_tasks_on_platform(platform_name, os_name)
+
+if not running_tasks:
+return ['echo', 'No tasks to kill known.']
+
+if os_name == WINDOWS:
+command = ['taskkill', '/F']
+for task in running_tasks:
+command.append('/IM')
+command.append(task)
+
+else:
+command = ['killall']
+command.extend(running_tasks)
+
+return command
+
+@renderer
+def render_run_args(props):
+platform = props.getProperty('platform')
+if platform == 'windows':
+return '--win'
+return ''
+
+# step wrappers
+def DescribedStep(step_class, description, haltOnFailure=True, **kwargs):
+return step_class(description=description, 
descriptionDone=description, name=slugify(description), 
haltOnFailure=haltOnFailure, **kwargs)
+
+def SH(workdir=BASE_WORKDIR, timeout=medic_config['app']

[GitHub] cordova-medic pull request: Medic Refactor

2015-03-11 Thread dblotsky
Github user dblotsky commented on a diff in the pull request:

https://github.com/apache/cordova-medic/pull/37#discussion_r26228450
  
--- Diff: buildbot-conf/cordova.conf ---
@@ -0,0 +1,336 @@
+import os
+import re
+import json
+
+from buildbot.schedulers.basic import SingleBranchScheduler, 
AnyBranchScheduler
+from buildbot.schedulers.forcesched import ForceScheduler
--- End diff --

They will be used in future PRs.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] cordova-medic pull request: Medic Refactor

2015-03-11 Thread dblotsky
Github user dblotsky commented on a diff in the pull request:

https://github.com/apache/cordova-medic/pull/37#discussion_r26228193
  
--- Diff: buildbot-conf/cordova.conf ---
@@ -0,0 +1,336 @@
+import os
+import re
+import json
+
+from buildbot.schedulers.basic import SingleBranchScheduler, 
AnyBranchScheduler
+from buildbot.schedulers.forcesched import ForceScheduler
+from buildbot.schedulers.timed import Nightly
+
+from buildbot.changes.gitpoller import GitPoller
+from buildbot.changes import filter as change_filter
+
+from buildbot.process.factory import BuildFactory
+from buildbot.config import BuilderConfig
+
+from buildbot.process.properties import renderer
+from buildbot.process.properties import Property as P
+from buildbot.process.properties import Interpolate as I
+
+from buildbot.steps.source.git import Git
+from buildbot.steps.transfer import FileDownload
+from buildbot.steps.shell import ShellCommand
+from buildbot.steps.master import SetProperty
+
+from buildbot.status.results import SUCCESS
+
+# config
+MEDIC_CONFIG_FILE= os.path.join(FP, 'cordova-config.json')
+PROJECTS_CONFIG_FILE = os.path.join(FP, 'cordova-repos.json')
+
+def parse_config_file(file_name):
+with open(file_name, 'r') as config_file:
+return json.load(config_file)
+
+medic_config= parse_config_file(MEDIC_CONFIG_FILE)
+projects_config = parse_config_file(PROJECTS_CONFIG_FILE)
+
+# constants
+DEFAULT_REPO_NAME = 'src'
+BASE_WORKDIR  = '.'
+TEST_APP_NAME = 'mobilespec'
+
+OSX = 'osx'
+LINUX   = 'linux'
+WINDOWS = 'windows'
+
+# patterns
+CORDOVA_REPO_PATTERN = r'^.*(cordova-[^\.]+)\.git$'
+
+# interpretation of every byte-sized return code as success
+ALWAYS_SUCCESS = {i: SUCCESS for i in range(0, 256)}
+
+### UTILITIES
+
+# helper functions
+def cordova_builders():
+return [b.name for b in c['builders'] if b.name.startswith('cordova-')]
+
+def repo_name_from_url(url):
+match = re.match(CORDOVA_REPO_PATTERN, url)
+if match is not None:
+return match.group(1)
+return DEFAULT_REPO_NAME
+
+def repo_codebase_from_name(name):
+repo  = projects_config[name]
+codebase_name = repo['codebase']
+return repo['codebases'][codebase_name]
+
+def repo_url_from_name(name):
+return repo_codebase_from_name(name)['repo']
+
+def repo_branch_from_name(name):
+return repo_codebase_from_name(name)['branch']
+
+def slugify(string):
+return string.replace(' ', '-')
+
+def running_tasks_on_platform(platform_name, os_name):
+"""
+Return the names of tasks possibly started by
+builds on the given platform and OS.
+"""
+if platform_name == 'windows':
+return ['WWAHost.exe']
+elif platform_name == 'wp8':
+return ['Xde.exe']
+elif platform_name == 'ios':
+return ['iOS Simulator']
+return []
+
+def can_find_running_tasks(step):
+"""
+Return true if an OS and a platform is specified. Those are the
+criteria for finding a task because running_tasks_on_platform uses
+those properties to determine which tasks could be running.
+"""
+return (
+(step.build.getProperty('slaveos') is not None) and
+(step.build.getProperty('platform') is not None)
+)
+
+# renderers
+@renderer
+def render_repo_name(props):
+repo_url = props.getProperty('repository')
+return repo_name_from_url(repo_url)
+
+@renderer
+def render_task_kill_command(props):
+
+os_name   = props.getProperty('slaveos')
+platform_name = props.getProperty('platform')
+running_tasks = running_tasks_on_platform(platform_name, os_name)
+
+if not running_tasks:
+return ['echo', 'No tasks to kill known.']
+
+if os_name == WINDOWS:
+command = ['taskkill', '/F']
+for task in running_tasks:
+command.append('/IM')
+command.append(task)
+
+else:
+command = ['killall']
+command.extend(running_tasks)
+
+return command
+
+@renderer
+def render_run_args(props):
+platform = props.getProperty('platform')
+if platform == 'windows':
+return '--win'
+return ''
+
+# step wrappers
+def DescribedStep(step_class, description, haltOnFailure=True, **kwargs):
+return step_class(description=description, 
descriptionDone=description, name=slugify(description), 
haltOnFailure=haltOnFailure, **kwargs)
--- End diff --

The name is used in different places t

[GitHub] cordova-medic pull request: Medic Refactor

2015-03-11 Thread dblotsky
Github user dblotsky commented on a diff in the pull request:

https://github.com/apache/cordova-medic/pull/37#discussion_r26227988
  
--- Diff: buildbot-conf/cordova.conf ---
@@ -0,0 +1,336 @@
+import os
+import re
+import json
+
+from buildbot.schedulers.basic import SingleBranchScheduler, 
AnyBranchScheduler
+from buildbot.schedulers.forcesched import ForceScheduler
+from buildbot.schedulers.timed import Nightly
+
+from buildbot.changes.gitpoller import GitPoller
+from buildbot.changes import filter as change_filter
+
+from buildbot.process.factory import BuildFactory
+from buildbot.config import BuilderConfig
+
+from buildbot.process.properties import renderer
+from buildbot.process.properties import Property as P
+from buildbot.process.properties import Interpolate as I
+
+from buildbot.steps.source.git import Git
+from buildbot.steps.transfer import FileDownload
+from buildbot.steps.shell import ShellCommand
+from buildbot.steps.master import SetProperty
+
+from buildbot.status.results import SUCCESS
+
+# config
+MEDIC_CONFIG_FILE= os.path.join(FP, 'cordova-config.json')
+PROJECTS_CONFIG_FILE = os.path.join(FP, 'cordova-repos.json')
+
+def parse_config_file(file_name):
+with open(file_name, 'r') as config_file:
+return json.load(config_file)
+
+medic_config= parse_config_file(MEDIC_CONFIG_FILE)
+projects_config = parse_config_file(PROJECTS_CONFIG_FILE)
+
+# constants
+DEFAULT_REPO_NAME = 'src'
+BASE_WORKDIR  = '.'
+TEST_APP_NAME = 'mobilespec'
+
+OSX = 'osx'
+LINUX   = 'linux'
+WINDOWS = 'windows'
+
+# patterns
+CORDOVA_REPO_PATTERN = r'^.*(cordova-[^\.]+)\.git$'
+
+# interpretation of every byte-sized return code as success
+ALWAYS_SUCCESS = {i: SUCCESS for i in range(0, 256)}
+
+### UTILITIES
+
+# helper functions
+def cordova_builders():
+return [b.name for b in c['builders'] if b.name.startswith('cordova-')]
+
+def repo_name_from_url(url):
+match = re.match(CORDOVA_REPO_PATTERN, url)
+if match is not None:
+return match.group(1)
+return DEFAULT_REPO_NAME
+
+def repo_codebase_from_name(name):
+repo  = projects_config[name]
+codebase_name = repo['codebase']
+return repo['codebases'][codebase_name]
+
+def repo_url_from_name(name):
+return repo_codebase_from_name(name)['repo']
+
+def repo_branch_from_name(name):
+return repo_codebase_from_name(name)['branch']
+
+def slugify(string):
+return string.replace(' ', '-')
+
+def running_tasks_on_platform(platform_name, os_name):
+"""
+Return the names of tasks possibly started by
+builds on the given platform and OS.
+"""
+if platform_name == 'windows':
+return ['WWAHost.exe']
+elif platform_name == 'wp8':
+return ['Xde.exe']
+elif platform_name == 'ios':
+return ['iOS Simulator']
+return []
+
+def can_find_running_tasks(step):
+"""
+Return true if an OS and a platform is specified. Those are the
+criteria for finding a task because running_tasks_on_platform uses
+those properties to determine which tasks could be running.
+"""
+return (
+(step.build.getProperty('slaveos') is not None) and
+(step.build.getProperty('platform') is not None)
+)
+
+# renderers
+@renderer
+def render_repo_name(props):
+repo_url = props.getProperty('repository')
+return repo_name_from_url(repo_url)
+
+@renderer
+def render_task_kill_command(props):
+
+os_name   = props.getProperty('slaveos')
+platform_name = props.getProperty('platform')
+running_tasks = running_tasks_on_platform(platform_name, os_name)
+
+if not running_tasks:
+return ['echo', 'No tasks to kill known.']
+
+if os_name == WINDOWS:
+command = ['taskkill', '/F']
+for task in running_tasks:
+command.append('/IM')
+command.append(task)
+
+else:
+command = ['killall']
+command.extend(running_tasks)
+
+return command
+
+@renderer
+def render_run_args(props):
--- End diff --

Good catch. Removed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubsc

[GitHub] cordova-medic pull request: Medic Refactor

2015-03-11 Thread dblotsky
Github user dblotsky commented on a diff in the pull request:

https://github.com/apache/cordova-medic/pull/37#discussion_r26227709
  
--- Diff: buildbot-conf/cordova.conf ---
@@ -0,0 +1,336 @@
+import os
+import re
+import json
+
+from buildbot.schedulers.basic import SingleBranchScheduler, 
AnyBranchScheduler
+from buildbot.schedulers.forcesched import ForceScheduler
+from buildbot.schedulers.timed import Nightly
+
+from buildbot.changes.gitpoller import GitPoller
+from buildbot.changes import filter as change_filter
+
+from buildbot.process.factory import BuildFactory
+from buildbot.config import BuilderConfig
+
+from buildbot.process.properties import renderer
+from buildbot.process.properties import Property as P
+from buildbot.process.properties import Interpolate as I
+
+from buildbot.steps.source.git import Git
+from buildbot.steps.transfer import FileDownload
+from buildbot.steps.shell import ShellCommand
+from buildbot.steps.master import SetProperty
+
+from buildbot.status.results import SUCCESS
+
+# config
+MEDIC_CONFIG_FILE= os.path.join(FP, 'cordova-config.json')
+PROJECTS_CONFIG_FILE = os.path.join(FP, 'cordova-repos.json')
+
+def parse_config_file(file_name):
+with open(file_name, 'r') as config_file:
+return json.load(config_file)
+
+medic_config= parse_config_file(MEDIC_CONFIG_FILE)
+projects_config = parse_config_file(PROJECTS_CONFIG_FILE)
+
+# constants
+DEFAULT_REPO_NAME = 'src'
+BASE_WORKDIR  = '.'
+TEST_APP_NAME = 'mobilespec'
+
+OSX = 'osx'
+LINUX   = 'linux'
+WINDOWS = 'windows'
+
+# patterns
+CORDOVA_REPO_PATTERN = r'^.*(cordova-[^\.]+)\.git$'
+
+# interpretation of every byte-sized return code as success
+ALWAYS_SUCCESS = {i: SUCCESS for i in range(0, 256)}
+
+### UTILITIES
+
+# helper functions
+def cordova_builders():
+return [b.name for b in c['builders'] if b.name.startswith('cordova-')]
+
+def repo_name_from_url(url):
+match = re.match(CORDOVA_REPO_PATTERN, url)
+if match is not None:
+return match.group(1)
+return DEFAULT_REPO_NAME
+
+def repo_codebase_from_name(name):
+repo  = projects_config[name]
+codebase_name = repo['codebase']
+return repo['codebases'][codebase_name]
+
+def repo_url_from_name(name):
+return repo_codebase_from_name(name)['repo']
+
+def repo_branch_from_name(name):
+return repo_codebase_from_name(name)['branch']
+
+def slugify(string):
+return string.replace(' ', '-')
+
+def running_tasks_on_platform(platform_name, os_name):
+"""
+Return the names of tasks possibly started by
+builds on the given platform and OS.
+"""
+if platform_name == 'windows':
+return ['WWAHost.exe']
+elif platform_name == 'wp8':
+return ['Xde.exe']
+elif platform_name == 'ios':
+return ['iOS Simulator']
+return []
+
+def can_find_running_tasks(step):
+"""
+Return true if an OS and a platform is specified. Those are the
+criteria for finding a task because running_tasks_on_platform uses
+those properties to determine which tasks could be running.
+"""
+return (
+(step.build.getProperty('slaveos') is not None) and
+(step.build.getProperty('platform') is not None)
+)
+
+# renderers
+@renderer
+def render_repo_name(props):
+repo_url = props.getProperty('repository')
+return repo_name_from_url(repo_url)
+
+@renderer
+def render_task_kill_command(props):
+
+os_name   = props.getProperty('slaveos')
+platform_name = props.getProperty('platform')
+running_tasks = running_tasks_on_platform(platform_name, os_name)
+
+if not running_tasks:
+return ['echo', 'No tasks to kill known.']
+
+if os_name == WINDOWS:
+command = ['taskkill', '/F']
+for task in running_tasks:
+command.append('/IM')
+command.append(task)
+
+else:
+command = ['killall']
+command.extend(running_tasks)
+
+return command
+
+@renderer
+def render_run_args(props):
+platform = props.getProperty('platform')
+if platform == 'windows':
+return '--win'
+return ''
+
+# step wrappers
+def DescribedStep(step_class, description, haltOnFailure=True, **kwargs):
+return step_class(description=description, 
descriptionDone=description, name=slugify(description), 
haltOnFailure=haltOnFailure, **kwargs)
+
+def SH(workdir=BASE_WORKDIR, timeout=medic_config['app']

[GitHub] cordova-medic pull request: Medic Refactor

2015-03-11 Thread dblotsky
Github user dblotsky commented on a diff in the pull request:

https://github.com/apache/cordova-medic/pull/37#discussion_r26227034
  
--- Diff: buildbot-conf/cordova-config.json.sample ---
@@ -0,0 +1,43 @@
+{
+"couchdb": {
+"uri":  "http://localhost:5984";
+},
+"dashboard": {
+"port": 8088
+},
+"app": {
+"entry":   "autotest/pages/all.html",
+"release": "master",
--- End diff --

I was hesitating to remove it, because I was unsure if it was unused. 
Removed now.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] cordova-medic pull request: Medic Refactor

2015-03-11 Thread dblotsky
Github user dblotsky commented on a diff in the pull request:

https://github.com/apache/cordova-medic/pull/37#discussion_r26227251
  
--- Diff: buildbot-conf/cordova-internal.conf ---
@@ -0,0 +1,101 @@
+import os
+import json
+
+from buildbot.changes.gitpoller import GitPoller
+from buildbot.schedulers.forcesched import ForceScheduler
+
+# config
+MEDIC_CONFIG_FILE= os.path.join(FP, 'cordova-config.json')
+PROJECTS_CONFIG_FILE = os.path.join(FP, 'cordova-repos.json')
+
+def parse_config_file(file_name):
+with open(file_name, 'r') as config_file:
+return json.load(config_file)
+
+medic_config= parse_config_file(MEDIC_CONFIG_FILE)
+projects_config = parse_config_file(PROJECTS_CONFIG_FILE)
+
+# constants
+GIT_BIN   = 'git' if os.name != 'nt' else 'C:\Program Files 
(x86)\Git\cmd\git.exe'
+GITPOLLER_DIR = 'gitpoller-workdir'
+
+POLLED_PROJECT_PATTERNS = [
+'cordova-mobile-spec',
+'cordova-lib',
+'cordova-js',
+'cordova-cli',
+'cordova-medic',
+'cordova-plugman',
+'cordova-windows',
+'cordova-android',
+]
--- End diff --

This is currently in test, and plugins will be added later.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] cordova-medic pull request: Medic Refactor

2015-03-11 Thread dmitriy-barkalov
Github user dmitriy-barkalov commented on a diff in the pull request:

https://github.com/apache/cordova-medic/pull/37#discussion_r26225224
  
--- Diff: buildbot-conf/cordova.conf ---
@@ -0,0 +1,336 @@
+import os
+import re
+import json
+
+from buildbot.schedulers.basic import SingleBranchScheduler, 
AnyBranchScheduler
+from buildbot.schedulers.forcesched import ForceScheduler
+from buildbot.schedulers.timed import Nightly
+
+from buildbot.changes.gitpoller import GitPoller
+from buildbot.changes import filter as change_filter
+
+from buildbot.process.factory import BuildFactory
+from buildbot.config import BuilderConfig
+
+from buildbot.process.properties import renderer
+from buildbot.process.properties import Property as P
+from buildbot.process.properties import Interpolate as I
+
+from buildbot.steps.source.git import Git
+from buildbot.steps.transfer import FileDownload
+from buildbot.steps.shell import ShellCommand
+from buildbot.steps.master import SetProperty
+
+from buildbot.status.results import SUCCESS
+
+# config
+MEDIC_CONFIG_FILE= os.path.join(FP, 'cordova-config.json')
+PROJECTS_CONFIG_FILE = os.path.join(FP, 'cordova-repos.json')
+
+def parse_config_file(file_name):
+with open(file_name, 'r') as config_file:
+return json.load(config_file)
+
+medic_config= parse_config_file(MEDIC_CONFIG_FILE)
+projects_config = parse_config_file(PROJECTS_CONFIG_FILE)
+
+# constants
+DEFAULT_REPO_NAME = 'src'
+BASE_WORKDIR  = '.'
+TEST_APP_NAME = 'mobilespec'
+
+OSX = 'osx'
+LINUX   = 'linux'
+WINDOWS = 'windows'
+
+# patterns
+CORDOVA_REPO_PATTERN = r'^.*(cordova-[^\.]+)\.git$'
+
+# interpretation of every byte-sized return code as success
+ALWAYS_SUCCESS = {i: SUCCESS for i in range(0, 256)}
+
+### UTILITIES
+
+# helper functions
+def cordova_builders():
+return [b.name for b in c['builders'] if b.name.startswith('cordova-')]
+
+def repo_name_from_url(url):
+match = re.match(CORDOVA_REPO_PATTERN, url)
+if match is not None:
+return match.group(1)
+return DEFAULT_REPO_NAME
+
+def repo_codebase_from_name(name):
+repo  = projects_config[name]
+codebase_name = repo['codebase']
+return repo['codebases'][codebase_name]
+
+def repo_url_from_name(name):
+return repo_codebase_from_name(name)['repo']
+
+def repo_branch_from_name(name):
+return repo_codebase_from_name(name)['branch']
+
+def slugify(string):
+return string.replace(' ', '-')
+
+def running_tasks_on_platform(platform_name, os_name):
+"""
+Return the names of tasks possibly started by
+builds on the given platform and OS.
+"""
+if platform_name == 'windows':
+return ['WWAHost.exe']
+elif platform_name == 'wp8':
+return ['Xde.exe']
+elif platform_name == 'ios':
+return ['iOS Simulator']
+return []
+
+def can_find_running_tasks(step):
+"""
+Return true if an OS and a platform is specified. Those are the
+criteria for finding a task because running_tasks_on_platform uses
+those properties to determine which tasks could be running.
+"""
+return (
+(step.build.getProperty('slaveos') is not None) and
+(step.build.getProperty('platform') is not None)
+)
+
+# renderers
+@renderer
+def render_repo_name(props):
+repo_url = props.getProperty('repository')
+return repo_name_from_url(repo_url)
+
+@renderer
+def render_task_kill_command(props):
+
+os_name   = props.getProperty('slaveos')
+platform_name = props.getProperty('platform')
+running_tasks = running_tasks_on_platform(platform_name, os_name)
+
+if not running_tasks:
+return ['echo', 'No tasks to kill known.']
+
+if os_name == WINDOWS:
+command = ['taskkill', '/F']
+for task in running_tasks:
+command.append('/IM')
+command.append(task)
+
+else:
+command = ['killall']
+command.extend(running_tasks)
+
+return command
+
+@renderer
+def render_run_args(props):
+platform = props.getProperty('platform')
+if platform == 'windows':
+return '--win'
+return ''
+
+# step wrappers
+def DescribedStep(step_class, description, haltOnFailure=True, **kwargs):
+return step_class(description=description, 
descriptionDone=description, name=slugify(description), 
haltOnFailure=haltOnFailure, **kwargs)
+
+def SH(workdir=BASE_WORKDIR, timeout=medic_confi

[GitHub] cordova-lib pull request: CB-8595 Merge platforms.js from cordova ...

2015-03-11 Thread mmocny
Github user mmocny commented on a diff in the pull request:

https://github.com/apache/cordova-lib/pull/183#discussion_r26224327
  
--- Diff: cordova-lib/src/platforms/platforms.js ---
@@ -0,0 +1,102 @@
+/**
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+*/
+
+var platforms = require('./platformsConfig.json');
+
+// Remove this block soon. The parser property is no longer used in
+// cordova-lib but some downstream tools still use it.
+var addModuleProperty = require('../cordova/util').addModuleProperty;
+Object.keys(platforms).forEach(function(key) {
+var obj = platforms[key];
+if (obj.parser_file) {
+addModuleProperty(module, 'parser', obj.parser_file, false, obj);
+}
+});
+
+
+// Avoid loading the same platform projects more than once (identified by 
path)
+var cachedProjects = {};
+
+var PARSER_PUBLIC_METHODS = [
+'config_xml',
+'cordovajs_path',
+'update_from_config',
+'update_overrides',
+'update_project',
+'update_www',
+'www_dir',
+];
+
+var HANDLER_PUBLIC_METHODS = [
+'package_name',
+'parseProjectFile',
+'purgeProjectFileCache',
+];
+
+
+// A single class that exposes functionality from platform specific files 
from
+// both places cordova/metadata and plugman/platforms. Hopefully, to be 
soon
+// replaced by real unified platform specific classes.
+function PlatformProjectAdapter(platform, platformRootDir) {
+var self = this;
+self.root = platformRootDir;
+self.platform = platform;
+var ParserConstructor = require(platforms[platform].parser_file);
+self.parser = new ParserConstructor(platformRootDir);
+self.handler = require(platforms[platform].handler_file);
+
+// Expos all public methods from the parser and handler, properly 
bound.
+PARSER_PUBLIC_METHODS.forEach(function(method) {
+if (self.parser[method]) {
+self[method] = self.parser[method].bind(self.parser);
+}
+});
+
+HANDLER_PUBLIC_METHODS.forEach(function(method) {
+if (self.handler[method]) {
+self[method] = self.handler[method].bind(self.handler);
+}
+});
+
+self.getInstaller = function(type) {
+return self.handler[type].install;
+};
+
+self.getUninstaller = function(type) {
+return self.handler[type].uninstall;
+};
+}
+
+// getPlatformProject() should be the only method of instantiating the
+// PlatformProject classes for now.
+function getPlatformProject(platform, platformRootDir) {
+var cached = cachedProjects[platformRootDir];
+if (cached && cached.platform == platform) {
--- End diff --

Okay, Fair enough.

On Wed, Mar 11, 2015 at 10:57 AM Mark Koudritsky 
wrote:

> In cordova-lib/src/platforms/platforms.js
> :
>
> > +});
> > +
> > +self.getInstaller = function(type) {
> > +return self.handler[type].install;
> > +};
> > +
> > +self.getUninstaller = function(type) {
> > +return self.handler[type].uninstall;
> > +};
> > +}
> > +
> > +// getPlatformProject() should be the only method of instantiating the
> > +// PlatformProject classes for now.
> > +function getPlatformProject(platform, platformRootDir) {
> > +var cached = cachedProjects[platformRootDir];
> > +if (cached && cached.platform == platform) {
>
> The tests sometimes reuse the same dir for several platforms. Added the
> platform check after spending a couple of hours figuring this out. Not 
sure
> if there is a viable real world case for using the same dir for different
> platforms.
>
> —
> Reply to this email directly or view it on GitHub
> 

Re: Update: Plugins to NPM (Phase 1)

2015-03-11 Thread Michal Mocny
I guess since we have a MAJOR version bump on plugins, I agree thats the
right choice.

-Michal

On Wed, Mar 11, 2015 at 11:15 AM, Andrew Grieve 
wrote:

> On Wed, Mar 11, 2015 at 10:30 AM, Michal Mocny 
> wrote:
>
> > On Wed, Mar 11, 2015 at 10:10 AM, Andrew Grieve 
> > wrote:
> >
> > > On Mon, Mar 9, 2015 at 8:20 PM, Steven Gill 
> > > wrote:
> > >
> > > > Our master branch has plugin fetching from npm set as the fallback
> now.
> > > It
> > > > will go directly to npm if the plugin-id entered isn't reverse domain
> > > name
> > > > style. Cordova-lib also warns users to use the package-name instead
> of
> > > > plugin-id when adding plugins that we have renamed and are in
> > > > https://github.com/stevengill/cordova-registry-mapper
> > > >
> > > > Plugins TODO:
> > > >
> > > > - README: Move doc/en/index.md into README.md. Delete doc/en/
> index.md.
> > > Add
> > > > links in README.md that point to github page of translated docs for
> > > plugin.
> > > > (ex.
> > > >
> > >
> >
> https://github.com/apache/cordova-plugin-device/blob/master/doc/es/index.md
> > > > ).
> > > > I'd love to hear from someone (Victor?) working on docs translations
> > > about
> > > > how this change will impact them.
> > > >
> > > > - Rename plugin-ids to new plugin names in plugin.xml. Anything we
> > should
> > > > be aware of before we do this? (Ex. rename org.apache.cordova.device
> to
> > > > cordova-plugin-device in plugin.xml)
> > > >
> > > Will need to update JS / native references where plugins depend on each
> > > other (e.g. in require()s). Think there are only a couple.
> > >
> >
> > Should make sure the mapper does this automatically for js require(), but
> > we should still update core plugins to not rely on it.
> >
>
> I don't think that would work since require()s are a runtime thing. I don't
> want to have a list of require mappings end up in every app's cordova.js.
> Pretty simple just to fix the couple of require()s.
>
>
> >
> > For native side plugin deps, we will need to make the updates.
> >
> >
> > >
> > >
> > > >
> > > > - Add peer dependencies to plugins that depend on other plugins
> (file,
> > > > media-capture, etc)
> > > >
> > > > - Paramedic support for every plugin
> > > >
> > > > - Major version bump for all core plugins
> > > >
> > > > - Update plugins release process to use package.json version as main
> > > > version and have it update plugin.xml's version. Will do this when we
> > do
> > > > next release
> > > >
> > > > Migration TODO:
> > > >
> > > > - Create blog post talking about migration to npm for community
> > > >
> > > > - include how we are renaming, suggest they do so if they want to.
> Will
> > > > suggest they follow the pattern cordova-plugin-*
> > > >
> > > > - mention https://github.com/stevengill/cordova-registry-mapper for
> > > > warning
> > > > purposes
> > > > - include potential lifespan of CPR (publishing and read only)
> > > > - Discuss plugman createpackage.json command
> > > > - Discuss keyword: 'ecosystem:cordova'
> > > >
> > > >
> > > > Thoughts? Missing anything?
> > > >
> > >
> >
>


[GitHub] cordova-windows pull request: Fixed wording of warning + removed a...

2015-03-11 Thread chrisbubernak
Github user chrisbubernak commented on the pull request:

https://github.com/apache/cordova-windows/pull/58#issuecomment-78286333
  
yeah, didn't realize the email address was wrong on that machine until a 
week or so after I submitted this :( 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



Re: Update: Plugins to NPM (Phase 1)

2015-03-11 Thread Andrew Grieve
On Wed, Mar 11, 2015 at 10:30 AM, Michal Mocny  wrote:

> On Wed, Mar 11, 2015 at 10:10 AM, Andrew Grieve 
> wrote:
>
> > On Mon, Mar 9, 2015 at 8:20 PM, Steven Gill 
> > wrote:
> >
> > > Our master branch has plugin fetching from npm set as the fallback now.
> > It
> > > will go directly to npm if the plugin-id entered isn't reverse domain
> > name
> > > style. Cordova-lib also warns users to use the package-name instead of
> > > plugin-id when adding plugins that we have renamed and are in
> > > https://github.com/stevengill/cordova-registry-mapper
> > >
> > > Plugins TODO:
> > >
> > > - README: Move doc/en/index.md into README.md. Delete doc/en/index.md.
> > Add
> > > links in README.md that point to github page of translated docs for
> > plugin.
> > > (ex.
> > >
> >
> https://github.com/apache/cordova-plugin-device/blob/master/doc/es/index.md
> > > ).
> > > I'd love to hear from someone (Victor?) working on docs translations
> > about
> > > how this change will impact them.
> > >
> > > - Rename plugin-ids to new plugin names in plugin.xml. Anything we
> should
> > > be aware of before we do this? (Ex. rename org.apache.cordova.device to
> > > cordova-plugin-device in plugin.xml)
> > >
> > Will need to update JS / native references where plugins depend on each
> > other (e.g. in require()s). Think there are only a couple.
> >
>
> Should make sure the mapper does this automatically for js require(), but
> we should still update core plugins to not rely on it.
>

I don't think that would work since require()s are a runtime thing. I don't
want to have a list of require mappings end up in every app's cordova.js.
Pretty simple just to fix the couple of require()s.


>
> For native side plugin deps, we will need to make the updates.
>
>
> >
> >
> > >
> > > - Add peer dependencies to plugins that depend on other plugins (file,
> > > media-capture, etc)
> > >
> > > - Paramedic support for every plugin
> > >
> > > - Major version bump for all core plugins
> > >
> > > - Update plugins release process to use package.json version as main
> > > version and have it update plugin.xml's version. Will do this when we
> do
> > > next release
> > >
> > > Migration TODO:
> > >
> > > - Create blog post talking about migration to npm for community
> > >
> > > - include how we are renaming, suggest they do so if they want to. Will
> > > suggest they follow the pattern cordova-plugin-*
> > >
> > > - mention https://github.com/stevengill/cordova-registry-mapper for
> > > warning
> > > purposes
> > > - include potential lifespan of CPR (publishing and read only)
> > > - Discuss plugman createpackage.json command
> > > - Discuss keyword: 'ecosystem:cordova'
> > >
> > >
> > > Thoughts? Missing anything?
> > >
> >
>


[GitHub] cordova-lib pull request: CB-8595 Merge platforms.js from cordova ...

2015-03-11 Thread kamrik
Github user kamrik commented on a diff in the pull request:

https://github.com/apache/cordova-lib/pull/183#discussion_r26218885
  
--- Diff: cordova-lib/src/platforms/platforms.js ---
@@ -0,0 +1,102 @@
+/**
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+*/
+
+var platforms = require('./platformsConfig.json');
+
+// Remove this block soon. The parser property is no longer used in
+// cordova-lib but some downstream tools still use it.
+var addModuleProperty = require('../cordova/util').addModuleProperty;
+Object.keys(platforms).forEach(function(key) {
+var obj = platforms[key];
+if (obj.parser_file) {
+addModuleProperty(module, 'parser', obj.parser_file, false, obj);
+}
+});
+
+
+// Avoid loading the same platform projects more than once (identified by 
path)
+var cachedProjects = {};
+
+var PARSER_PUBLIC_METHODS = [
+'config_xml',
+'cordovajs_path',
+'update_from_config',
+'update_overrides',
+'update_project',
+'update_www',
+'www_dir',
+];
+
+var HANDLER_PUBLIC_METHODS = [
+'package_name',
+'parseProjectFile',
+'purgeProjectFileCache',
+];
+
+
+// A single class that exposes functionality from platform specific files 
from
+// both places cordova/metadata and plugman/platforms. Hopefully, to be 
soon
+// replaced by real unified platform specific classes.
+function PlatformProjectAdapter(platform, platformRootDir) {
+var self = this;
+self.root = platformRootDir;
+self.platform = platform;
+var ParserConstructor = require(platforms[platform].parser_file);
+self.parser = new ParserConstructor(platformRootDir);
+self.handler = require(platforms[platform].handler_file);
+
+// Expos all public methods from the parser and handler, properly 
bound.
+PARSER_PUBLIC_METHODS.forEach(function(method) {
+if (self.parser[method]) {
+self[method] = self.parser[method].bind(self.parser);
+}
+});
+
+HANDLER_PUBLIC_METHODS.forEach(function(method) {
+if (self.handler[method]) {
+self[method] = self.handler[method].bind(self.handler);
+}
+});
+
+self.getInstaller = function(type) {
+return self.handler[type].install;
+};
+
+self.getUninstaller = function(type) {
+return self.handler[type].uninstall;
+};
+}
+
+// getPlatformProject() should be the only method of instantiating the
+// PlatformProject classes for now.
+function getPlatformProject(platform, platformRootDir) {
+var cached = cachedProjects[platformRootDir];
+if (cached && cached.platform == platform) {
--- End diff --

The tests sometimes reuse the same dir for several platforms. Added the 
platform check after spending a couple of hours figuring this out. Not sure if 
there is a viable real world case for using the same dir for different 
platforms.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] cordova-medic pull request: Medic Refactor

2015-03-11 Thread dmitriy-barkalov
Github user dmitriy-barkalov commented on a diff in the pull request:

https://github.com/apache/cordova-medic/pull/37#discussion_r26218840
  
--- Diff: buildbot-conf/cordova.conf ---
@@ -0,0 +1,336 @@
+import os
+import re
+import json
+
+from buildbot.schedulers.basic import SingleBranchScheduler, 
AnyBranchScheduler
+from buildbot.schedulers.forcesched import ForceScheduler
+from buildbot.schedulers.timed import Nightly
+
+from buildbot.changes.gitpoller import GitPoller
+from buildbot.changes import filter as change_filter
+
+from buildbot.process.factory import BuildFactory
+from buildbot.config import BuilderConfig
+
+from buildbot.process.properties import renderer
+from buildbot.process.properties import Property as P
+from buildbot.process.properties import Interpolate as I
+
+from buildbot.steps.source.git import Git
+from buildbot.steps.transfer import FileDownload
+from buildbot.steps.shell import ShellCommand
+from buildbot.steps.master import SetProperty
+
+from buildbot.status.results import SUCCESS
+
+# config
+MEDIC_CONFIG_FILE= os.path.join(FP, 'cordova-config.json')
+PROJECTS_CONFIG_FILE = os.path.join(FP, 'cordova-repos.json')
+
+def parse_config_file(file_name):
+with open(file_name, 'r') as config_file:
+return json.load(config_file)
+
+medic_config= parse_config_file(MEDIC_CONFIG_FILE)
+projects_config = parse_config_file(PROJECTS_CONFIG_FILE)
+
+# constants
+DEFAULT_REPO_NAME = 'src'
+BASE_WORKDIR  = '.'
+TEST_APP_NAME = 'mobilespec'
+
+OSX = 'osx'
+LINUX   = 'linux'
+WINDOWS = 'windows'
+
+# patterns
+CORDOVA_REPO_PATTERN = r'^.*(cordova-[^\.]+)\.git$'
+
+# interpretation of every byte-sized return code as success
+ALWAYS_SUCCESS = {i: SUCCESS for i in range(0, 256)}
+
+### UTILITIES
+
+# helper functions
+def cordova_builders():
+return [b.name for b in c['builders'] if b.name.startswith('cordova-')]
+
+def repo_name_from_url(url):
+match = re.match(CORDOVA_REPO_PATTERN, url)
+if match is not None:
+return match.group(1)
+return DEFAULT_REPO_NAME
+
+def repo_codebase_from_name(name):
+repo  = projects_config[name]
+codebase_name = repo['codebase']
+return repo['codebases'][codebase_name]
+
+def repo_url_from_name(name):
--- End diff --

Seems this method is very short and used only once in this code. May be it 
could be removed?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] cordova-medic pull request: Medic Refactor

2015-03-11 Thread dmitriy-barkalov
Github user dmitriy-barkalov commented on a diff in the pull request:

https://github.com/apache/cordova-medic/pull/37#discussion_r26218870
  
--- Diff: buildbot-conf/cordova.conf ---
@@ -0,0 +1,336 @@
+import os
+import re
+import json
+
+from buildbot.schedulers.basic import SingleBranchScheduler, 
AnyBranchScheduler
+from buildbot.schedulers.forcesched import ForceScheduler
+from buildbot.schedulers.timed import Nightly
+
+from buildbot.changes.gitpoller import GitPoller
+from buildbot.changes import filter as change_filter
+
+from buildbot.process.factory import BuildFactory
+from buildbot.config import BuilderConfig
+
+from buildbot.process.properties import renderer
+from buildbot.process.properties import Property as P
+from buildbot.process.properties import Interpolate as I
+
+from buildbot.steps.source.git import Git
+from buildbot.steps.transfer import FileDownload
+from buildbot.steps.shell import ShellCommand
+from buildbot.steps.master import SetProperty
+
+from buildbot.status.results import SUCCESS
+
+# config
+MEDIC_CONFIG_FILE= os.path.join(FP, 'cordova-config.json')
+PROJECTS_CONFIG_FILE = os.path.join(FP, 'cordova-repos.json')
+
+def parse_config_file(file_name):
+with open(file_name, 'r') as config_file:
+return json.load(config_file)
+
+medic_config= parse_config_file(MEDIC_CONFIG_FILE)
+projects_config = parse_config_file(PROJECTS_CONFIG_FILE)
+
+# constants
+DEFAULT_REPO_NAME = 'src'
+BASE_WORKDIR  = '.'
+TEST_APP_NAME = 'mobilespec'
+
+OSX = 'osx'
+LINUX   = 'linux'
+WINDOWS = 'windows'
+
+# patterns
+CORDOVA_REPO_PATTERN = r'^.*(cordova-[^\.]+)\.git$'
+
+# interpretation of every byte-sized return code as success
+ALWAYS_SUCCESS = {i: SUCCESS for i in range(0, 256)}
+
+### UTILITIES
+
+# helper functions
+def cordova_builders():
+return [b.name for b in c['builders'] if b.name.startswith('cordova-')]
+
+def repo_name_from_url(url):
+match = re.match(CORDOVA_REPO_PATTERN, url)
+if match is not None:
+return match.group(1)
+return DEFAULT_REPO_NAME
+
+def repo_codebase_from_name(name):
+repo  = projects_config[name]
+codebase_name = repo['codebase']
+return repo['codebases'][codebase_name]
+
+def repo_url_from_name(name):
+return repo_codebase_from_name(name)['repo']
+
+def repo_branch_from_name(name):
--- End diff --

Same as  repo_url_from_name


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] cordova-lib pull request: CB-8595 Merge platforms.js from cordova ...

2015-03-11 Thread kamrik
Github user kamrik commented on a diff in the pull request:

https://github.com/apache/cordova-lib/pull/183#discussion_r26218471
  
--- Diff: cordova-lib/src/plugman/uninstall.js ---
@@ -293,58 +293,25 @@ function runUninstallPlatform(actions, platform, 
project_dir, plugin_dir, plugin
 function handleUninstall(actions, platform, pluginInfo, project_dir, 
www_dir, plugins_dir, is_top_level, options) {
 var plugin_id = pluginInfo.id;
 var plugin_dir = pluginInfo.dir;
-var platform_modules = require('./platforms');
-var handler = platform_modules[platform];
-www_dir = www_dir || handler.www_dir(project_dir);
+var handler = platform_modules.getPlatformProject(platform, 
project_dir);
+www_dir = www_dir || handler.www_dir();
 events.emit('log', 'Uninstalling ' + plugin_id + ' from ' + platform);
 
+var pluginItems = pluginInfo.getFilesAndFrameworks(platform);
 var assets = pluginInfo.getAssets(platform);
--- End diff --

Assets are not copied during installation, only during prepare (because www 
dir is blown on prepare). It wouldn't harm to copy them here as well, just some 
duplication, but they are also currently dealt with by directly calling 
common.asset.install(), not from the handlers with a slightly different 
function signature, so I left it as is for now.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



Re: Android's new Whitelist Plugins

2015-03-11 Thread Andrew Grieve
Done! They are now alive at their now spots and added to coho's plugins
list.

On Thu, Mar 5, 2015 at 3:49 PM, Jesse  wrote:

> +1
> better late than never
>
> @purplecabbage
> risingj.com
>
> On Thu, Mar 5, 2015 at 12:39 PM, Andrew Grieve 
> wrote:
>
> > Going with it: https://issues.apache.org/jira/browse/INFRA-9238
> >
> > On Wed, Mar 4, 2015 at 11:22 PM, Michal Mocny 
> wrote:
> >
> > > +1 to names.
> > >
> > > On Wed, Mar 4, 2015 at 9:03 PM, Andrew Grieve 
> > > wrote:
> > >
> > >> No comments about the names yet, but I'm now leaning towards:
> > >>
> > >> cordova-plugin-legacy-whitelist
> > >>
> > >> and
> > >>
> > >> cordova-plugin-whitelist
> > >>
> > >> as the two new git repos to create (rather than "url-policy")
> > >>
> > >> On Wed, Mar 4, 2015 at 8:49 PM, Andrew Grieve 
> > >> wrote:
> > >>
> > >> > I think how Cordova works right now was the best way. Have access
> > >> blocked
> > >> > by default, but have a  in the default template.
> > It
> > >> > makes the setting visible, while still working out-of-the-box.
> > >> >
> > >> > If we turned on requests when no whitelist plugin is installed, then
> > >> > existing apps that have  tags will have their whitelist
> > removed
> > >> > with 4.0.0 and not know it. If someone updates and their app can't
> hit
> > >> the
> > >> > network anymore, then I think Stack Overflow will tell them why
> pretty
> > >> > quickly. We should also be very clear in the release notes and
> upgrade
> > >> > guide.
> > >> >
> > >> >
> > >> >
> > >> >
> > >> > On Wed, Mar 4, 2015 at 7:54 PM, Nikhil Khandelwal <
> > >> nikhi...@microsoft.com>
> > >> > wrote:
> > >> >
> > >> >> I like Ian's proposal of blocking network access only when a
> > whitelist
> > >> >> plugin is added to do so and is choosing to override the default
> > >> behavior.
> > >> >>
> > >> >> Scanning config.xml on upgrade might be a good way to warn devs to
> > >> refer
> > >> >> them to use this plugin. These changes should also be documented in
> > the
> > >> >> migration guide from Android 3.x to 4.0.
> > >> >>
> > >> >> Thanks,
> > >> >> Nikhil
> > >> >>
> > >> >>
> > >> >> -Original Message-
> > >> >> From: Jesse [mailto:purplecabb...@gmail.com]
> > >> >> Sent: Wednesday, March 4, 2015 11:05 AM
> > >> >> To: dev@cordova.apache.org
> > >> >> Subject: Re: Android's new Whitelist Plugins
> > >> >>
> > >> >> I like the defaults as discussed, regardless of how they are
> > achieved.
> > >> >> ie. network yes, intents no
> > >> >> This is similar to how a plain webview works if you add it to a
> > native
> > >> >> app on ios or android, at least the network part, not sure what the
> > >> default
> > >> >> intent handling is.
> > >> >>
> > >> >> Are there portions of this functionality that make more sense as
> part
> > >> of
> > >> >> the platform native code?  To me a plugin that is installed by
> > default
> > >> is
> > >> >> just modular platform code. Is there ever a reason to NOT want this
> > >> plugin,
> > >> >> versus just opening up access?
> > >> >>
> > >> >>
> > >> >>
> > >> >>
> > >> >>
> > >> >>
> > >> >>
> > >> >>
> > >> >>
> > >> >> @purplecabbage
> > >> >> risingj.com
> > >> >>
> > >> >> On Wed, Mar 4, 2015 at 9:37 AM, Michal Mocny 
> > >> wrote:
> > >> >>
> > >> >> > I've been working on adding support to just install the whitelist
> > >> >> > plugin by default, and to add the  to the
> > default
> > >> >> app.
> > >> >> >
> > >> >> > Is that sufficient?  I think we may still need to do what Ian
> > >> suggests
> > >> >> > and prompt on upgrade (or prepare)?
> > >> >> >
> > >> >> > For downstreams, especially IDE based ones, they will need to
> make
> > >> >> > sure the plugin is added by default however they do that.
> > >> >> >
> > >> >> > On Wed, Mar 4, 2015 at 12:06 PM, Ian Clelland <
> > >> iclell...@chromium.org>
> > >> >> > wrote:
> > >> >> >
> > >> >> > > On Tue, Mar 3, 2015 at 8:20 PM, Nikhil Khandelwal <
> > >> >> > nikhi...@microsoft.com>
> > >> >> > > wrote:
> > >> >> > >
> > >> >> > > > Here are my thoughts on the default behavior:
> > >> >> > > > - navigation should be disabled.
> > >> >> > > > - XHR & network request should be enabled.
> > >> >> > > >
> > >> >> > >
> > >> >> > > And application launch through intent URLs should also be
> > disabled.
> > >> >> > > (IMO)
> > >> >> > >
> > >> >> > > That's not a bad default -- it enables CSP usage by default,
> > which
> > >> I
> > >> >> > think
> > >> >> > > is good. It also (I think) means we're giving up on suggesting
> > that
> > >> >> > network
> > >> >> > > requests can be completely blocked by default, because that's
> > >> >> > > definitely not the case on Android.
> > >> >> > >
> > >> >> > > We can implement this within the new framework: there is the
> idea
> > >> of
> > >> >> > > a 'default policy' that only comes into effect when no plugins
> > take
> > >> >> > > responsibility for the whitelist. As soon as any plugin,
> though,
> > >> >> > > handles the shouldAllowRequest() call, for instance, the
> de

Re: Consolidating platform specific code from different places in cordova-lib

2015-03-11 Thread Michal Mocny
Reviewed, left comments.  Overall looks good, thanks Mark.

However, seems you left something uncommitted, since you literally cannot
require('cordova-lib'); without an exception thrown.  Yet all the
cordova-lib tests pass.  What does it say about the quality of the tests ;)

On Tue, Mar 10, 2015 at 6:24 PM, Jesse  wrote:

> Had a quick look, looks great!
>
> @purplecabbage
> risingj.com
>
> On Tue, Mar 10, 2015 at 3:09 PM, Mark Koudritsky 
> wrote:
>
> > I've created a pull request with changes across cordova-lib that should
> > make it much easier to consolidate the platform specific code in
> > cordova-lib to reduce duplication and maybe eventually move this code to
> > the platforms repos.
> >
> > https://github.com/apache/cordova-lib/pull/183
> > Feedback is welcome.
> >
> > Those changes only deal with interfacing the platform specific code from
> > cordova/metadata/ and plugman/platforms/ dirs, the dirs themselves and
> > their contents weren't changed yet.
> >
>


Re: Update: Plugins to NPM (Phase 1)

2015-03-11 Thread Michal Mocny
On Wed, Mar 11, 2015 at 10:10 AM, Andrew Grieve 
wrote:

> On Mon, Mar 9, 2015 at 8:20 PM, Steven Gill 
> wrote:
>
> > Our master branch has plugin fetching from npm set as the fallback now.
> It
> > will go directly to npm if the plugin-id entered isn't reverse domain
> name
> > style. Cordova-lib also warns users to use the package-name instead of
> > plugin-id when adding plugins that we have renamed and are in
> > https://github.com/stevengill/cordova-registry-mapper
> >
> > Plugins TODO:
> >
> > - README: Move doc/en/index.md into README.md. Delete doc/en/index.md.
> Add
> > links in README.md that point to github page of translated docs for
> plugin.
> > (ex.
> >
> https://github.com/apache/cordova-plugin-device/blob/master/doc/es/index.md
> > ).
> > I'd love to hear from someone (Victor?) working on docs translations
> about
> > how this change will impact them.
> >
> > - Rename plugin-ids to new plugin names in plugin.xml. Anything we should
> > be aware of before we do this? (Ex. rename org.apache.cordova.device to
> > cordova-plugin-device in plugin.xml)
> >
> Will need to update JS / native references where plugins depend on each
> other (e.g. in require()s). Think there are only a couple.
>

Should make sure the mapper does this automatically for js require(), but
we should still update core plugins to not rely on it.

For native side plugin deps, we will need to make the updates.


>
>
> >
> > - Add peer dependencies to plugins that depend on other plugins (file,
> > media-capture, etc)
> >
> > - Paramedic support for every plugin
> >
> > - Major version bump for all core plugins
> >
> > - Update plugins release process to use package.json version as main
> > version and have it update plugin.xml's version. Will do this when we do
> > next release
> >
> > Migration TODO:
> >
> > - Create blog post talking about migration to npm for community
> >
> > - include how we are renaming, suggest they do so if they want to. Will
> > suggest they follow the pattern cordova-plugin-*
> >
> > - mention https://github.com/stevengill/cordova-registry-mapper for
> > warning
> > purposes
> > - include potential lifespan of CPR (publishing and read only)
> > - Discuss plugman createpackage.json command
> > - Discuss keyword: 'ecosystem:cordova'
> >
> >
> > Thoughts? Missing anything?
> >
>


Re: Deprecation of Config and the embedded use case (4.0.x related)

2015-03-11 Thread Joe Bowser
That's why we have tests! I just changed the activity and saw that we have
one failure.  I'm not sure why this test in particular is failing, since
there's too many assertions in one method, so I'll have to try and debug it
today.

The thing is that if we're deprecating something and replacing it with
something else, we should write tests for it.  Releasing a 4.0.x and
changing how we embed a WebView by changing class names but not fixing up
the deprecation is bizzare.

On Wed, Mar 11, 2015 at 7:15 AM Andrew Grieve  wrote:

> I wanted to make sure that I didn't break the old way of doing things.
>
> On Tue, Mar 10, 2015 at 2:24 PM, Joe Bowser  wrote:
>
> > The main issue is that this isn't documented anywhere, and this is
> > necessary for people to use a Third Party WebView.  Also, why didn't you
> > bother updating the test with the new API?
> >
> > On Mon, Mar 9, 2015 at 5:19 PM Andrew Grieve 
> wrote:
> >
> > > Here's an example:
> > >
> > > ConfigXmlParser parser = new ConfigXmlParser();
> > > parser.parse(activity);
> > > webView.init(cordova, parser.getPluginEntries(),
> > parser.getPreferences());
> > >
> > > Feel free to iterate if you think the API is too obtuse, but I think
> it's
> > > good to allow a file-less mode, and to allow different WebViews to have
> > > different settings.
> > >
> > >
> > >
> > >
> > > On Mon, Mar 9, 2015 at 8:08 PM, Joe Bowser  wrote:
> > >
> > > > Do you have an example of how this would work? This seems to be a lot
> > > more
> > > > complex than it needs to be.
> > > >
> > > > On Mon, Mar 9, 2015 at 5:05 PM Andrew Grieve 
> > > wrote:
> > > >
> > > > > It's so that you can have multiple CordovaWebViews that use
> different
> > > > > configs within one application. It's also so that you don't have to
> > > have
> > > > a
> > > > > config.xml if you prefer to build up your config in code instead.
> > > > >
> > > > > I don't think loadConfig() is deprecated. It has
> > > > > a @SuppressWarnings("deprecation"), which just silences a warning
> > > about
> > > > it
> > > > > setting the config of the Config class (which is done for backwards
> > > > > compatibility).
> > > > >
> > > > >
> > > > > On Mon, Mar 9, 2015 at 3:54 PM, Joe Bowser 
> > wrote:
> > > > >
> > > > > > OK, this actually makes using the WebView as a component a lot
> > > harder,
> > > > > > since you now have to have this loadConfig method which you also
> > > marked
> > > > > for
> > > > > > deprecation required to get all of the necessary attributes out
> of
> > > > this.
> > > > > > I'm pretty sure this is a major step backwards in that people
> > looking
> > > > to
> > > > > > use Cordova as a component now have to jump through additional
> > hoops
> > > to
> > > > > get
> > > > > > this to work.  What is the benefit of deprecating the Config
> static
> > > > class
> > > > > > and replacing it with the ConfigXmlParser again? I don't remember
> > why
> > > > > this
> > > > > > was done.
> > > > > >
> > > > > > On Mon, Mar 9, 2015 at 9:04 AM Andrew Grieve <
> agri...@chromium.org
> > >
> > > > > wrote:
> > > > > >
> > > > > > > On Mon, Mar 9, 2015 at 11:56 AM, Joe Bowser  >
> > > > wrote:
> > > > > > >
> > > > > > > > On Mon, Mar 9, 2015 at 7:39 AM Andrew Grieve <
> > > agri...@chromium.org
> > > > >
> > > > > > > wrote:
> > > > > > > >
> > > > > > > > > You can now instantiate a CordovaWebView without a
> > config.xml,
> > > > and
> > > > > > > > without
> > > > > > > > > using Config. This happened when I added an "init()" method
> > to
> > > > > > > > > CordovaWebView. You can pass in a CordovaPreferences
> object,
> > > and
> > > > a
> > > > > > list
> > > > > > > > of
> > > > > > > > > PluginEntry. Maybe we just need a better comment on Config
> > > saying
> > > > > to
> > > > > > > use
> > > > > > > > > these instead?
> > > > > > > > >
> > > > > > > > >
> > > > > > > > Where does one get this PluginEntry list when they're
> > embedding a
> > > > > > > WebView?
> > > > > > > > This needs to be documented or at least put in the test that
> > > tests
> > > > > this
> > > > > > > use
> > > > > > > > case.
> > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > > > > > That has nothing to do with InAppBrowser, this is to do
> > with
> > > > > > > embedding
> > > > > > > > a
> > > > > > > > > > WebView inside an Android application. I don't think you
> > > > > understand
> > > > > > > > what
> > > > > > > > > I
> > > > > > > > > > mean when I say the embedded use case.
> > > > > > > > > >
> > > > > > > > > Maybe try explaining a bit more?
> > > > > > > >
> > > > > > > >
> > > > > > > > Even though you edited the test that explicitly covers this
> > use,
> > > > > case,
> > > > > > > and
> > > > > > > > even though we've talked about using CordovaWebView as an
> > Android
> > > > > View
> > > > > > > for
> > > > > > > > over a year, you need it explained more?
> > > > > > > >
> > > > > > > > So, not everyone wants to use all of Cordova, for many
> reasons.
> > > > > > Instead,
> > > > > > > > th

[GitHub] cordova-lib pull request: CB-8595 Merge platforms.js from cordova ...

2015-03-11 Thread kamrik
Github user kamrik commented on a diff in the pull request:

https://github.com/apache/cordova-lib/pull/183#discussion_r26215211
  
--- Diff: cordova-lib/src/platforms/platforms.js ---
@@ -0,0 +1,102 @@
+/**
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+*/
+
+var platforms = require('./platformsConfig.json');
+
+// Remove this block soon. The parser property is no longer used in
+// cordova-lib but some downstream tools still use it.
+var addModuleProperty = require('../cordova/util').addModuleProperty;
+Object.keys(platforms).forEach(function(key) {
+var obj = platforms[key];
+if (obj.parser_file) {
+addModuleProperty(module, 'parser', obj.parser_file, false, obj);
+}
+});
+
+
+// Avoid loading the same platform projects more than once (identified by 
path)
+var cachedProjects = {};
+
+var PARSER_PUBLIC_METHODS = [
+'config_xml',
+'cordovajs_path',
+'update_from_config',
+'update_overrides',
+'update_project',
+'update_www',
+'www_dir',
+];
+
+var HANDLER_PUBLIC_METHODS = [
+'package_name',
+'parseProjectFile',
+'purgeProjectFileCache',
+];
+
+
+// A single class that exposes functionality from platform specific files 
from
+// both places cordova/metadata and plugman/platforms. Hopefully, to be 
soon
+// replaced by real unified platform specific classes.
+function PlatformProjectAdapter(platform, platformRootDir) {
+var self = this;
+self.root = platformRootDir;
+self.platform = platform;
+var ParserConstructor = require(platforms[platform].parser_file);
+self.parser = new ParserConstructor(platformRootDir);
+self.handler = require(platforms[platform].handler_file);
+
+// Expos all public methods from the parser and handler, properly 
bound.
+PARSER_PUBLIC_METHODS.forEach(function(method) {
+if (self.parser[method]) {
+self[method] = self.parser[method].bind(self.parser);
+}
+});
+
+HANDLER_PUBLIC_METHODS.forEach(function(method) {
+if (self.handler[method]) {
--- End diff --

For the handlers the if is still needed because there is actually code that 
checks if the handler has a parseProjectFile() function before calling it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] cordova-lib pull request: CB-8595 Merge platforms.js from cordova ...

2015-03-11 Thread mmocny
Github user mmocny commented on a diff in the pull request:

https://github.com/apache/cordova-lib/pull/183#discussion_r26215219
  
--- Diff: cordova-lib/src/plugman/uninstall.js ---
@@ -293,58 +293,25 @@ function runUninstallPlatform(actions, platform, 
project_dir, plugin_dir, plugin
 function handleUninstall(actions, platform, pluginInfo, project_dir, 
www_dir, plugins_dir, is_top_level, options) {
 var plugin_id = pluginInfo.id;
 var plugin_dir = pluginInfo.dir;
-var platform_modules = require('./platforms');
-var handler = platform_modules[platform];
-www_dir = www_dir || handler.www_dir(project_dir);
+var handler = platform_modules.getPlatformProject(platform, 
project_dir);
+www_dir = www_dir || handler.www_dir();
 events.emit('log', 'Uninstalling ' + plugin_id + ' from ' + platform);
 
+var pluginItems = pluginInfo.getFilesAndFrameworks(platform);
 var assets = pluginInfo.getAssets(platform);
--- End diff --

Why are assets different?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] cordova-lib pull request: CB-8595 Merge platforms.js from cordova ...

2015-03-11 Thread kamrik
Github user kamrik commented on a diff in the pull request:

https://github.com/apache/cordova-lib/pull/183#discussion_r26215310
  
--- Diff: cordova-lib/src/PluginInfo.js ---
@@ -288,6 +293,19 @@ function PluginInfo(dirname) {
 return ret;
 });
 };
+
+self.getFilesAndFrameworks = getFilesAndFrameworks;
+function getFilesAndFrameworks(platform) {
+var items = [];
+// Please avoid changing the order of the calls below, files will 
be
+// installed in this order.
+items = items.concat(self.getSourceFiles(platform));
+items = items.concat(self.getHeaderFiles(platform));
+items = items.concat(self.getResourceFiles(platform));
+items = items.concat(self.getFrameworks(platform));
+items = items.concat(self.getLibFiles(platform));
--- End diff --

Good idea, will change.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] cordova-lib pull request: CB-8595 Merge platforms.js from cordova ...

2015-03-11 Thread kamrik
Github user kamrik commented on a diff in the pull request:

https://github.com/apache/cordova-lib/pull/183#discussion_r26215186
  
--- Diff: cordova-lib/src/platforms/platforms.js ---
@@ -0,0 +1,102 @@
+/**
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+*/
+
+var platforms = require('./platformsConfig.json');
+
+// Remove this block soon. The parser property is no longer used in
+// cordova-lib but some downstream tools still use it.
+var addModuleProperty = require('../cordova/util').addModuleProperty;
+Object.keys(platforms).forEach(function(key) {
+var obj = platforms[key];
+if (obj.parser_file) {
+addModuleProperty(module, 'parser', obj.parser_file, false, obj);
+}
+});
+
+
+// Avoid loading the same platform projects more than once (identified by 
path)
+var cachedProjects = {};
+
+var PARSER_PUBLIC_METHODS = [
+'config_xml',
+'cordovajs_path',
+'update_from_config',
+'update_overrides',
+'update_project',
+'update_www',
+'www_dir',
+];
+
+var HANDLER_PUBLIC_METHODS = [
+'package_name',
+'parseProjectFile',
+'purgeProjectFileCache',
+];
+
+
+// A single class that exposes functionality from platform specific files 
from
+// both places cordova/metadata and plugman/platforms. Hopefully, to be 
soon
+// replaced by real unified platform specific classes.
+function PlatformProjectAdapter(platform, platformRootDir) {
+var self = this;
+self.root = platformRootDir;
+self.platform = platform;
+var ParserConstructor = require(platforms[platform].parser_file);
+self.parser = new ParserConstructor(platformRootDir);
+self.handler = require(platforms[platform].handler_file);
+
+// Expos all public methods from the parser and handler, properly 
bound.
+PARSER_PUBLIC_METHODS.forEach(function(method) {
+if (self.parser[method]) {
--- End diff --

Added the if because windows parser doesn't have update_overrides() but 
apparently update_overrides() is only used internally inside the parsers so 
I'll remove it from PARSER_PUBLIC_METHODS and remove the if so it will throw if 
no method is found.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



Re: [Vote] 3.8.0 Cordova App Hello World Release

2015-03-11 Thread Andrew Grieve
Note that this pulls in the addition of a content-security-policy 
tag.
Please ensure that this doesn't break your platform when voting.

On Tue, Mar 10, 2015 at 7:30 PM, Steven Gill  wrote:

> Please review and vote on this 3.8.0 Cordova App Hello World Release.
>
> Release issue: https://issues.apache.org/jira/browse/CB-8645
>
> Repos ready to be released have been published to
> dist/dev:https://dist.apache.org/repos/dist/dev/cordova/CB-8645
>
> The package was published from its corresponding git tag:
> cordova-app-hello-world: 3.8.0 (0b55140d09)
>
> Upon a successful vote I will upload the archive to dist/ and publish it
> to NPM.
>
> Voting guidelines:
> https://github.com/apache/cordova-coho/blob/master/docs/release-voting.md
>
> Voting will go on for a minimum of 48 hours.
>
> I vote +1:
> * Ran coho audit-license-headers over the relevant repos
> * Ran coho check-license to ensure all dependencies and
> subdependencies have Apache-compatible licenses
> * Built a hello world app using the CLI
>


Re: Deprecation of Config and the embedded use case (4.0.x related)

2015-03-11 Thread Andrew Grieve
I wanted to make sure that I didn't break the old way of doing things.

On Tue, Mar 10, 2015 at 2:24 PM, Joe Bowser  wrote:

> The main issue is that this isn't documented anywhere, and this is
> necessary for people to use a Third Party WebView.  Also, why didn't you
> bother updating the test with the new API?
>
> On Mon, Mar 9, 2015 at 5:19 PM Andrew Grieve  wrote:
>
> > Here's an example:
> >
> > ConfigXmlParser parser = new ConfigXmlParser();
> > parser.parse(activity);
> > webView.init(cordova, parser.getPluginEntries(),
> parser.getPreferences());
> >
> > Feel free to iterate if you think the API is too obtuse, but I think it's
> > good to allow a file-less mode, and to allow different WebViews to have
> > different settings.
> >
> >
> >
> >
> > On Mon, Mar 9, 2015 at 8:08 PM, Joe Bowser  wrote:
> >
> > > Do you have an example of how this would work? This seems to be a lot
> > more
> > > complex than it needs to be.
> > >
> > > On Mon, Mar 9, 2015 at 5:05 PM Andrew Grieve 
> > wrote:
> > >
> > > > It's so that you can have multiple CordovaWebViews that use different
> > > > configs within one application. It's also so that you don't have to
> > have
> > > a
> > > > config.xml if you prefer to build up your config in code instead.
> > > >
> > > > I don't think loadConfig() is deprecated. It has
> > > > a @SuppressWarnings("deprecation"), which just silences a warning
> > about
> > > it
> > > > setting the config of the Config class (which is done for backwards
> > > > compatibility).
> > > >
> > > >
> > > > On Mon, Mar 9, 2015 at 3:54 PM, Joe Bowser 
> wrote:
> > > >
> > > > > OK, this actually makes using the WebView as a component a lot
> > harder,
> > > > > since you now have to have this loadConfig method which you also
> > marked
> > > > for
> > > > > deprecation required to get all of the necessary attributes out of
> > > this.
> > > > > I'm pretty sure this is a major step backwards in that people
> looking
> > > to
> > > > > use Cordova as a component now have to jump through additional
> hoops
> > to
> > > > get
> > > > > this to work.  What is the benefit of deprecating the Config static
> > > class
> > > > > and replacing it with the ConfigXmlParser again? I don't remember
> why
> > > > this
> > > > > was done.
> > > > >
> > > > > On Mon, Mar 9, 2015 at 9:04 AM Andrew Grieve  >
> > > > wrote:
> > > > >
> > > > > > On Mon, Mar 9, 2015 at 11:56 AM, Joe Bowser 
> > > wrote:
> > > > > >
> > > > > > > On Mon, Mar 9, 2015 at 7:39 AM Andrew Grieve <
> > agri...@chromium.org
> > > >
> > > > > > wrote:
> > > > > > >
> > > > > > > > You can now instantiate a CordovaWebView without a
> config.xml,
> > > and
> > > > > > > without
> > > > > > > > using Config. This happened when I added an "init()" method
> to
> > > > > > > > CordovaWebView. You can pass in a CordovaPreferences object,
> > and
> > > a
> > > > > list
> > > > > > > of
> > > > > > > > PluginEntry. Maybe we just need a better comment on Config
> > saying
> > > > to
> > > > > > use
> > > > > > > > these instead?
> > > > > > > >
> > > > > > > >
> > > > > > > Where does one get this PluginEntry list when they're
> embedding a
> > > > > > WebView?
> > > > > > > This needs to be documented or at least put in the test that
> > tests
> > > > this
> > > > > > use
> > > > > > > case.
> > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > > > > That has nothing to do with InAppBrowser, this is to do
> with
> > > > > > embedding
> > > > > > > a
> > > > > > > > > WebView inside an Android application. I don't think you
> > > > understand
> > > > > > > what
> > > > > > > > I
> > > > > > > > > mean when I say the embedded use case.
> > > > > > > > >
> > > > > > > > Maybe try explaining a bit more?
> > > > > > >
> > > > > > >
> > > > > > > Even though you edited the test that explicitly covers this
> use,
> > > > case,
> > > > > > and
> > > > > > > even though we've talked about using CordovaWebView as an
> Android
> > > > View
> > > > > > for
> > > > > > > over a year, you need it explained more?
> > > > > > >
> > > > > > > So, not everyone wants to use all of Cordova, for many reasons.
> > > > > Instead,
> > > > > > > they really just want to take advantage of the WebView
> component
> > in
> > > > > their
> > > > > > > native apps so that they can create hybrid apps that are mostly
> > > > native
> > > > > > with
> > > > > > > only some parts that use Cordova.  This is where you would
> > declare
> > > > your
> > > > > > > view in your layout XML like this:
> > > > > > >
> > > > > > >  > > > > > > android:id="@+id/WebViewComponent"
> > > > > > > android:layout_width="match_parent"
> > > > > > > android:layout_height="match_parent">
> > > > > > > 
> > > > > > >
> > > > > > > And then, in the activity start up your view like this:
> > > > > > >
> > > > > > >   private CordovaWebView webInterface;
> > > > > > >   private CordovaInterfaceImpl systemInterface = new
> > > > > > > CordovaInterfaceImpl(this);
> > > > > > 

[GitHub] cordova-lib pull request: CB-8595 Merge platforms.js from cordova ...

2015-03-11 Thread mmocny
Github user mmocny commented on a diff in the pull request:

https://github.com/apache/cordova-lib/pull/183#discussion_r26214642
  
--- Diff: cordova-lib/src/platforms/platforms.js ---
@@ -0,0 +1,102 @@
+/**
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+*/
+
+var platforms = require('./platformsConfig.json');
+
+// Remove this block soon. The parser property is no longer used in
+// cordova-lib but some downstream tools still use it.
+var addModuleProperty = require('../cordova/util').addModuleProperty;
+Object.keys(platforms).forEach(function(key) {
+var obj = platforms[key];
+if (obj.parser_file) {
+addModuleProperty(module, 'parser', obj.parser_file, false, obj);
+}
+});
+
+
+// Avoid loading the same platform projects more than once (identified by 
path)
+var cachedProjects = {};
+
+var PARSER_PUBLIC_METHODS = [
+'config_xml',
+'cordovajs_path',
+'update_from_config',
+'update_overrides',
+'update_project',
+'update_www',
+'www_dir',
+];
+
+var HANDLER_PUBLIC_METHODS = [
+'package_name',
+'parseProjectFile',
+'purgeProjectFileCache',
+];
+
+
+// A single class that exposes functionality from platform specific files 
from
+// both places cordova/metadata and plugman/platforms. Hopefully, to be 
soon
+// replaced by real unified platform specific classes.
+function PlatformProjectAdapter(platform, platformRootDir) {
+var self = this;
+self.root = platformRootDir;
+self.platform = platform;
+var ParserConstructor = require(platforms[platform].parser_file);
+self.parser = new ParserConstructor(platformRootDir);
+self.handler = require(platforms[platform].handler_file);
+
+// Expos all public methods from the parser and handler, properly 
bound.
+PARSER_PUBLIC_METHODS.forEach(function(method) {
+if (self.parser[method]) {
+self[method] = self.parser[method].bind(self.parser);
+}
+});
+
+HANDLER_PUBLIC_METHODS.forEach(function(method) {
+if (self.handler[method]) {
+self[method] = self.handler[method].bind(self.handler);
+}
+});
+
+self.getInstaller = function(type) {
+return self.handler[type].install;
+};
+
+self.getUninstaller = function(type) {
+return self.handler[type].uninstall;
+};
+}
+
+// getPlatformProject() should be the only method of instantiating the
+// PlatformProject classes for now.
+function getPlatformProject(platform, platformRootDir) {
+var cached = cachedProjects[platformRootDir];
+if (cached && cached.platform == platform) {
--- End diff --

If we have a `cached` PlatformProject already, shouldn't we just assert 
that `cached.platform == platform` inside the if?  If the platform is wrong, 
theres a bug right?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



Re: Update: Plugins to NPM (Phase 1)

2015-03-11 Thread Andrew Grieve
On Mon, Mar 9, 2015 at 8:20 PM, Steven Gill  wrote:

> Our master branch has plugin fetching from npm set as the fallback now. It
> will go directly to npm if the plugin-id entered isn't reverse domain name
> style. Cordova-lib also warns users to use the package-name instead of
> plugin-id when adding plugins that we have renamed and are in
> https://github.com/stevengill/cordova-registry-mapper
>
> Plugins TODO:
>
> - README: Move doc/en/index.md into README.md. Delete doc/en/index.md. Add
> links in README.md that point to github page of translated docs for plugin.
> (ex.
> https://github.com/apache/cordova-plugin-device/blob/master/doc/es/index.md
> ).
> I'd love to hear from someone (Victor?) working on docs translations about
> how this change will impact them.
>
> - Rename plugin-ids to new plugin names in plugin.xml. Anything we should
> be aware of before we do this? (Ex. rename org.apache.cordova.device to
> cordova-plugin-device in plugin.xml)
>
Will need to update JS / native references where plugins depend on each
other (e.g. in require()s). Think there are only a couple.


>
> - Add peer dependencies to plugins that depend on other plugins (file,
> media-capture, etc)
>
> - Paramedic support for every plugin
>
> - Major version bump for all core plugins
>
> - Update plugins release process to use package.json version as main
> version and have it update plugin.xml's version. Will do this when we do
> next release
>
> Migration TODO:
>
> - Create blog post talking about migration to npm for community
>
> - include how we are renaming, suggest they do so if they want to. Will
> suggest they follow the pattern cordova-plugin-*
>
> - mention https://github.com/stevengill/cordova-registry-mapper for
> warning
> purposes
> - include potential lifespan of CPR (publishing and read only)
> - Discuss plugman createpackage.json command
> - Discuss keyword: 'ecosystem:cordova'
>
>
> Thoughts? Missing anything?
>


[GitHub] cordova-lib pull request: CB-8595 Merge platforms.js from cordova ...

2015-03-11 Thread mmocny
Github user mmocny commented on a diff in the pull request:

https://github.com/apache/cordova-lib/pull/183#discussion_r26214063
  
--- Diff: cordova-lib/src/platforms/platforms.js ---
@@ -0,0 +1,102 @@
+/**
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+*/
+
+var platforms = require('./platformsConfig.json');
+
+// Remove this block soon. The parser property is no longer used in
+// cordova-lib but some downstream tools still use it.
+var addModuleProperty = require('../cordova/util').addModuleProperty;
+Object.keys(platforms).forEach(function(key) {
+var obj = platforms[key];
+if (obj.parser_file) {
+addModuleProperty(module, 'parser', obj.parser_file, false, obj);
+}
+});
+
+
+// Avoid loading the same platform projects more than once (identified by 
path)
+var cachedProjects = {};
+
+var PARSER_PUBLIC_METHODS = [
+'config_xml',
+'cordovajs_path',
+'update_from_config',
+'update_overrides',
+'update_project',
+'update_www',
+'www_dir',
+];
+
+var HANDLER_PUBLIC_METHODS = [
+'package_name',
+'parseProjectFile',
+'purgeProjectFileCache',
+];
+
+
+// A single class that exposes functionality from platform specific files 
from
+// both places cordova/metadata and plugman/platforms. Hopefully, to be 
soon
+// replaced by real unified platform specific classes.
+function PlatformProjectAdapter(platform, platformRootDir) {
+var self = this;
+self.root = platformRootDir;
+self.platform = platform;
+var ParserConstructor = require(platforms[platform].parser_file);
+self.parser = new ParserConstructor(platformRootDir);
+self.handler = require(platforms[platform].handler_file);
+
+// Expos all public methods from the parser and handler, properly 
bound.
+PARSER_PUBLIC_METHODS.forEach(function(method) {
+if (self.parser[method]) {
+self[method] = self.parser[method].bind(self.parser);
+}
+});
+
+HANDLER_PUBLIC_METHODS.forEach(function(method) {
+if (self.handler[method]) {
--- End diff --

ditto.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] cordova-lib pull request: CB-8595 Merge platforms.js from cordova ...

2015-03-11 Thread mmocny
Github user mmocny commented on a diff in the pull request:

https://github.com/apache/cordova-lib/pull/183#discussion_r26213790
  
--- Diff: cordova-lib/src/PluginInfo.js ---
@@ -288,6 +293,19 @@ function PluginInfo(dirname) {
 return ret;
 });
 };
+
+self.getFilesAndFrameworks = getFilesAndFrameworks;
+function getFilesAndFrameworks(platform) {
+var items = [];
+// Please avoid changing the order of the calls below, files will 
be
+// installed in this order.
+items = items.concat(self.getSourceFiles(platform));
+items = items.concat(self.getHeaderFiles(platform));
+items = items.concat(self.getResourceFiles(platform));
+items = items.concat(self.getFrameworks(platform));
+items = items.concat(self.getLibFiles(platform));
--- End diff --

Tip: `concat` actually accepts any number of arguments and will concat all 
in one go.

Can also do: `[].concat.apply([], [ self.getSourceFiles(..), 
self.getHeaderFiles(..), ...])`

Which I think looks nicest.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] cordova-lib pull request: Deprecate the old feature syntax from co...

2015-03-11 Thread gorkem
Github user gorkem commented on the pull request:

https://github.com/apache/cordova-lib/pull/182#issuecomment-78261223
  
merged


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] cordova-medic pull request: Medic Refactor

2015-03-11 Thread dmitriy-barkalov
Github user dmitriy-barkalov commented on a diff in the pull request:

https://github.com/apache/cordova-medic/pull/37#discussion_r26202982
  
--- Diff: buildbot-conf/cordova.conf ---
@@ -0,0 +1,336 @@
+import os
+import re
+import json
+
+from buildbot.schedulers.basic import SingleBranchScheduler, 
AnyBranchScheduler
+from buildbot.schedulers.forcesched import ForceScheduler
+from buildbot.schedulers.timed import Nightly
+
+from buildbot.changes.gitpoller import GitPoller
+from buildbot.changes import filter as change_filter
+
+from buildbot.process.factory import BuildFactory
+from buildbot.config import BuilderConfig
+
+from buildbot.process.properties import renderer
+from buildbot.process.properties import Property as P
--- End diff --

Seems not used.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] cordova-medic pull request: Medic Refactor

2015-03-11 Thread dmitriy-barkalov
Github user dmitriy-barkalov commented on a diff in the pull request:

https://github.com/apache/cordova-medic/pull/37#discussion_r26202848
  
--- Diff: buildbot-conf/cordova.conf ---
@@ -0,0 +1,336 @@
+import os
+import re
+import json
+
+from buildbot.schedulers.basic import SingleBranchScheduler, 
AnyBranchScheduler
+from buildbot.schedulers.forcesched import ForceScheduler
+from buildbot.schedulers.timed import Nightly
+
+from buildbot.changes.gitpoller import GitPoller
+from buildbot.changes import filter as change_filter
--- End diff --

This two imports seems not used.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] cordova-medic pull request: Medic Refactor

2015-03-11 Thread dmitriy-barkalov
Github user dmitriy-barkalov commented on a diff in the pull request:

https://github.com/apache/cordova-medic/pull/37#discussion_r26202824
  
--- Diff: buildbot-conf/cordova.conf ---
@@ -0,0 +1,336 @@
+import os
+import re
+import json
+
+from buildbot.schedulers.basic import SingleBranchScheduler, 
AnyBranchScheduler
+from buildbot.schedulers.forcesched import ForceScheduler
--- End diff --

This two imports seems not used.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] cordova-medic pull request: Medic Refactor

2015-03-11 Thread dmitriy-barkalov
Github user dmitriy-barkalov commented on a diff in the pull request:

https://github.com/apache/cordova-medic/pull/37#discussion_r26202687
  
--- Diff: buildbot-conf/cordova.conf ---
@@ -0,0 +1,336 @@
+import os
+import re
+import json
+
+from buildbot.schedulers.basic import SingleBranchScheduler, 
AnyBranchScheduler
+from buildbot.schedulers.forcesched import ForceScheduler
+from buildbot.schedulers.timed import Nightly
+
+from buildbot.changes.gitpoller import GitPoller
+from buildbot.changes import filter as change_filter
+
+from buildbot.process.factory import BuildFactory
+from buildbot.config import BuilderConfig
+
+from buildbot.process.properties import renderer
+from buildbot.process.properties import Property as P
+from buildbot.process.properties import Interpolate as I
+
+from buildbot.steps.source.git import Git
+from buildbot.steps.transfer import FileDownload
+from buildbot.steps.shell import ShellCommand
+from buildbot.steps.master import SetProperty
+
+from buildbot.status.results import SUCCESS
+
+# config
+MEDIC_CONFIG_FILE= os.path.join(FP, 'cordova-config.json')
+PROJECTS_CONFIG_FILE = os.path.join(FP, 'cordova-repos.json')
+
+def parse_config_file(file_name):
+with open(file_name, 'r') as config_file:
+return json.load(config_file)
+
+medic_config= parse_config_file(MEDIC_CONFIG_FILE)
+projects_config = parse_config_file(PROJECTS_CONFIG_FILE)
+
+# constants
+DEFAULT_REPO_NAME = 'src'
+BASE_WORKDIR  = '.'
+TEST_APP_NAME = 'mobilespec'
+
+OSX = 'osx'
+LINUX   = 'linux'
+WINDOWS = 'windows'
+
+# patterns
+CORDOVA_REPO_PATTERN = r'^.*(cordova-[^\.]+)\.git$'
+
+# interpretation of every byte-sized return code as success
+ALWAYS_SUCCESS = {i: SUCCESS for i in range(0, 256)}
+
+### UTILITIES
+
+# helper functions
+def cordova_builders():
+return [b.name for b in c['builders'] if b.name.startswith('cordova-')]
+
+def repo_name_from_url(url):
+match = re.match(CORDOVA_REPO_PATTERN, url)
+if match is not None:
+return match.group(1)
+return DEFAULT_REPO_NAME
+
+def repo_codebase_from_name(name):
+repo  = projects_config[name]
+codebase_name = repo['codebase']
+return repo['codebases'][codebase_name]
+
+def repo_url_from_name(name):
+return repo_codebase_from_name(name)['repo']
+
+def repo_branch_from_name(name):
+return repo_codebase_from_name(name)['branch']
+
+def slugify(string):
+return string.replace(' ', '-')
+
+def running_tasks_on_platform(platform_name, os_name):
+"""
+Return the names of tasks possibly started by
+builds on the given platform and OS.
+"""
+if platform_name == 'windows':
+return ['WWAHost.exe']
+elif platform_name == 'wp8':
+return ['Xde.exe']
+elif platform_name == 'ios':
+return ['iOS Simulator']
+return []
+
+def can_find_running_tasks(step):
+"""
+Return true if an OS and a platform is specified. Those are the
+criteria for finding a task because running_tasks_on_platform uses
+those properties to determine which tasks could be running.
+"""
+return (
+(step.build.getProperty('slaveos') is not None) and
+(step.build.getProperty('platform') is not None)
+)
+
+# renderers
+@renderer
+def render_repo_name(props):
+repo_url = props.getProperty('repository')
+return repo_name_from_url(repo_url)
+
+@renderer
+def render_task_kill_command(props):
+
+os_name   = props.getProperty('slaveos')
+platform_name = props.getProperty('platform')
+running_tasks = running_tasks_on_platform(platform_name, os_name)
+
+if not running_tasks:
+return ['echo', 'No tasks to kill known.']
+
+if os_name == WINDOWS:
+command = ['taskkill', '/F']
+for task in running_tasks:
+command.append('/IM')
+command.append(task)
+
+else:
+command = ['killall']
+command.extend(running_tasks)
+
+return command
+
+@renderer
+def render_run_args(props):
+platform = props.getProperty('platform')
+if platform == 'windows':
+return '--win'
+return ''
+
+# step wrappers
+def DescribedStep(step_class, description, haltOnFailure=True, **kwargs):
+return step_class(description=description, 
descriptionDone=description, name=slugify(description), 
haltOnFailure=haltOnFailure, **kwargs)
--- End diff --

There is always duplication of

[GitHub] cordova-medic pull request: Medic Refactor

2015-03-11 Thread dmitriy-barkalov
Github user dmitriy-barkalov commented on a diff in the pull request:

https://github.com/apache/cordova-medic/pull/37#discussion_r26201989
  
--- Diff: buildbot-conf/cordova.conf ---
@@ -0,0 +1,336 @@
+import os
+import re
+import json
+
+from buildbot.schedulers.basic import SingleBranchScheduler, 
AnyBranchScheduler
+from buildbot.schedulers.forcesched import ForceScheduler
+from buildbot.schedulers.timed import Nightly
+
+from buildbot.changes.gitpoller import GitPoller
+from buildbot.changes import filter as change_filter
+
+from buildbot.process.factory import BuildFactory
+from buildbot.config import BuilderConfig
+
+from buildbot.process.properties import renderer
+from buildbot.process.properties import Property as P
+from buildbot.process.properties import Interpolate as I
+
+from buildbot.steps.source.git import Git
+from buildbot.steps.transfer import FileDownload
+from buildbot.steps.shell import ShellCommand
+from buildbot.steps.master import SetProperty
+
+from buildbot.status.results import SUCCESS
+
+# config
+MEDIC_CONFIG_FILE= os.path.join(FP, 'cordova-config.json')
+PROJECTS_CONFIG_FILE = os.path.join(FP, 'cordova-repos.json')
+
+def parse_config_file(file_name):
+with open(file_name, 'r') as config_file:
+return json.load(config_file)
+
+medic_config= parse_config_file(MEDIC_CONFIG_FILE)
+projects_config = parse_config_file(PROJECTS_CONFIG_FILE)
+
+# constants
+DEFAULT_REPO_NAME = 'src'
+BASE_WORKDIR  = '.'
+TEST_APP_NAME = 'mobilespec'
+
+OSX = 'osx'
+LINUX   = 'linux'
+WINDOWS = 'windows'
+
+# patterns
+CORDOVA_REPO_PATTERN = r'^.*(cordova-[^\.]+)\.git$'
+
+# interpretation of every byte-sized return code as success
+ALWAYS_SUCCESS = {i: SUCCESS for i in range(0, 256)}
+
+### UTILITIES
+
+# helper functions
+def cordova_builders():
+return [b.name for b in c['builders'] if b.name.startswith('cordova-')]
+
+def repo_name_from_url(url):
+match = re.match(CORDOVA_REPO_PATTERN, url)
+if match is not None:
+return match.group(1)
+return DEFAULT_REPO_NAME
+
+def repo_codebase_from_name(name):
+repo  = projects_config[name]
+codebase_name = repo['codebase']
+return repo['codebases'][codebase_name]
+
+def repo_url_from_name(name):
+return repo_codebase_from_name(name)['repo']
+
+def repo_branch_from_name(name):
+return repo_codebase_from_name(name)['branch']
+
+def slugify(string):
+return string.replace(' ', '-')
+
+def running_tasks_on_platform(platform_name, os_name):
+"""
+Return the names of tasks possibly started by
+builds on the given platform and OS.
+"""
+if platform_name == 'windows':
+return ['WWAHost.exe']
+elif platform_name == 'wp8':
+return ['Xde.exe']
+elif platform_name == 'ios':
+return ['iOS Simulator']
+return []
+
+def can_find_running_tasks(step):
+"""
+Return true if an OS and a platform is specified. Those are the
+criteria for finding a task because running_tasks_on_platform uses
+those properties to determine which tasks could be running.
+"""
+return (
+(step.build.getProperty('slaveos') is not None) and
+(step.build.getProperty('platform') is not None)
+)
+
+# renderers
+@renderer
+def render_repo_name(props):
+repo_url = props.getProperty('repository')
+return repo_name_from_url(repo_url)
+
+@renderer
+def render_task_kill_command(props):
+
+os_name   = props.getProperty('slaveos')
+platform_name = props.getProperty('platform')
+running_tasks = running_tasks_on_platform(platform_name, os_name)
+
+if not running_tasks:
+return ['echo', 'No tasks to kill known.']
+
+if os_name == WINDOWS:
+command = ['taskkill', '/F']
+for task in running_tasks:
+command.append('/IM')
+command.append(task)
+
+else:
+command = ['killall']
+command.extend(running_tasks)
+
+return command
+
+@renderer
+def render_run_args(props):
--- End diff --

Seems it is not using anywhere 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-

[GitHub] cordova-cli pull request: CB-8634 `cordova platform add git_url` s...

2015-03-11 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/cordova-cli/pull/210


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] cordova-lib pull request: CB-8634 : `cordova platform add git_url#...

2015-03-11 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/cordova-lib/pull/180


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] cordova-lib pull request: CB-8633 BugFix: Support for urls to tarb...

2015-03-11 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/cordova-lib/pull/179


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] cordova-medic pull request: Medic Refactor

2015-03-11 Thread dmitriy-barkalov
Github user dmitriy-barkalov commented on a diff in the pull request:

https://github.com/apache/cordova-medic/pull/37#discussion_r26200013
  
--- Diff: buildbot-conf/cordova-internal.conf ---
@@ -0,0 +1,101 @@
+import os
+import json
+
+from buildbot.changes.gitpoller import GitPoller
+from buildbot.schedulers.forcesched import ForceScheduler
+
+# config
+MEDIC_CONFIG_FILE= os.path.join(FP, 'cordova-config.json')
+PROJECTS_CONFIG_FILE = os.path.join(FP, 'cordova-repos.json')
+
+def parse_config_file(file_name):
+with open(file_name, 'r') as config_file:
+return json.load(config_file)
+
+medic_config= parse_config_file(MEDIC_CONFIG_FILE)
+projects_config = parse_config_file(PROJECTS_CONFIG_FILE)
+
+# constants
+GIT_BIN   = 'git' if os.name != 'nt' else 'C:\Program Files 
(x86)\Git\cmd\git.exe'
+GITPOLLER_DIR = 'gitpoller-workdir'
+
+POLLED_PROJECT_PATTERNS = [
+'cordova-mobile-spec',
+'cordova-lib',
+'cordova-js',
+'cordova-cli',
+'cordova-medic',
+'cordova-plugman',
+'cordova-windows',
+'cordova-android',
+]
+
+### UTILITIES
+
+# helpers
+def cordova_builders():
+return [b.name for b in c['builders'] if b.name.startswith('cordova-')]
+
+def is_polled_project(project_name):
+return True if any(pattern in project_name for pattern in 
POLLED_PROJECT_PATTERNS) else False
+
+def get_polled_projects():
+return (project for project_name, project in projects_config.items() 
if is_polled_project(project_name))
+
+def make_git_poller(repo_uri):
+# NOTE:
+#  branches=True means watching all branches
+return GitPoller(repo_uri, workdir=GITPOLLER_DIR, branches=True, 
pollinterval=120, gitbin=GIT_BIN)
--- End diff --

Some unrelated builds could start using this logic. E.g. start build of 
Windows platform on commit to Android platform. Seems this functionality is not 
ready yet. I propose to exclude it from this PR. Current medic also doesn't 
have builds by commit.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] cordova-medic pull request: Medic Refactor

2015-03-11 Thread dmitriy-barkalov
Github user dmitriy-barkalov commented on a diff in the pull request:

https://github.com/apache/cordova-medic/pull/37#discussion_r26199487
  
--- Diff: buildbot-conf/cordova-internal.conf ---
@@ -0,0 +1,101 @@
+import os
+import json
+
+from buildbot.changes.gitpoller import GitPoller
+from buildbot.schedulers.forcesched import ForceScheduler
+
+# config
+MEDIC_CONFIG_FILE= os.path.join(FP, 'cordova-config.json')
+PROJECTS_CONFIG_FILE = os.path.join(FP, 'cordova-repos.json')
+
+def parse_config_file(file_name):
+with open(file_name, 'r') as config_file:
+return json.load(config_file)
+
+medic_config= parse_config_file(MEDIC_CONFIG_FILE)
+projects_config = parse_config_file(PROJECTS_CONFIG_FILE)
+
+# constants
+GIT_BIN   = 'git' if os.name != 'nt' else 'C:\Program Files 
(x86)\Git\cmd\git.exe'
+GITPOLLER_DIR = 'gitpoller-workdir'
+
+POLLED_PROJECT_PATTERNS = [
+'cordova-mobile-spec',
+'cordova-lib',
+'cordova-js',
+'cordova-cli',
+'cordova-medic',
+'cordova-plugman',
+'cordova-windows',
+'cordova-android',
+]
--- End diff --

I assume core plugins projects should be in this list also.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] cordova-medic pull request: Medic Refactor

2015-03-11 Thread dmitriy-barkalov
Github user dmitriy-barkalov commented on a diff in the pull request:

https://github.com/apache/cordova-medic/pull/37#discussion_r26199140
  
--- Diff: buildbot-conf/cordova-config.json.sample ---
@@ -0,0 +1,43 @@
+{
+"couchdb": {
+"uri":  "http://localhost:5984";
+},
+"dashboard": {
+"port": 8088
+},
+"app": {
+"entry":   "autotest/pages/all.html",
+"release": "master",
+"timeout": 600
--- End diff --

Can we have `platforms` parameter back? So people could filter platforms / 
builders they want to run on medic.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] cordova-medic pull request: Medic Refactor

2015-03-11 Thread dmitriy-barkalov
Github user dmitriy-barkalov commented on a diff in the pull request:

https://github.com/apache/cordova-medic/pull/37#discussion_r26198995
  
--- Diff: buildbot-conf/cordova-config.json.sample ---
@@ -0,0 +1,43 @@
+{
+"couchdb": {
+"uri":  "http://localhost:5984";
+},
+"dashboard": {
+"port": 8088
+},
+"app": {
+"entry":   "autotest/pages/all.html",
+"release": "master",
--- End diff --

Seems this parameter is not using anymore.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] cordova-medic pull request: Medic Refactor

2015-03-11 Thread dmitriy-barkalov
Github user dmitriy-barkalov commented on a diff in the pull request:

https://github.com/apache/cordova-medic/pull/37#discussion_r26198876
  
--- Diff: buildbot-conf/cordova-config.json.sample ---
@@ -0,0 +1,43 @@
+{
+"couchdb": {
+"uri":  "http://localhost:5984";
+},
+"dashboard": {
+"port": 8088
+},
+"app": {
+"entry":   "autotest/pages/all.html",
--- End diff --

Seems this path is out of date. Please change it to `cdvtests/index.html`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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