[jira] [Comment Edited] (CB-8401) Android permissions don't merge nicely when maxSdkVersion is set

2017-07-12 Thread Ctibor Laky (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-8401?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16085235#comment-16085235
 ] 

Ctibor Laky edited comment on CB-8401 at 7/13/17 6:05 AM:
--

[~johnvh] How did you fix your issue? I came into same problem. I need solution 
which can be committed to git with project and solved for everyone in a team. 
Thanks


was (Author: luckylooke):
[~johnvh] How did you fix your issue, I came into same problem. I need solution 
which can be committed to git with project and solved for everyone in a team. 
Thanks

> Android permissions don't merge nicely when maxSdkVersion is set
> 
>
> Key: CB-8401
> URL: https://issues.apache.org/jira/browse/CB-8401
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: cordova-plugman
> Environment: Android
>Reporter: Eddy Verbruggen
>
> If two plugins request the same permission they are nicely merged into one 
> line in AndroidManifest.xml.
> However, if one of those two has 'android:maxSdkVersion="18"', both lines 
> show up in the resulting AndroidManifest.xml which is not allowed, so the 
> Android build fails.
> As an example you can create a Cordova CLI project with the core File plugin 
> and SocialSharing (the latter has the maxSdkVersion set):
> cordova create duplicatepermissiontest
> cd duplicatepermissiontest
> cordova platform add android
> cordova plugin add org.apache.cordova.file
> cordova plugin add nl.x-services.plugins.socialsharing
> cordova prepare
> The AndroidManifest.xml now has the duplicate permission.
> I think what you'd want is the broader permission to 'win' this fight, so I'd 
> expect the manifest to contain only ' android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>'.
> Note that I added the maxSdkVersion restriction because according to Google 
> SDK 19+ no longer requires the permission in my case and the permission tends 
> to scare off people using apps with this plugin installed.
> I hope you will consider creating something clever to merge these duplicate 
> permissions.
> This issue was first reported here: 
> https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin/issues/295
> Best,
> Eddy



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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



[jira] [Commented] (CB-8401) Android permissions don't merge nicely when maxSdkVersion is set

2017-07-12 Thread Ctibor Laky (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-8401?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16085235#comment-16085235
 ] 

Ctibor Laky commented on CB-8401:
-

[~johnvh] How did you fix your issue, I came into same problem. I need solution 
which can be committed to git with project and solved for everyone in a team. 
Thanks

> Android permissions don't merge nicely when maxSdkVersion is set
> 
>
> Key: CB-8401
> URL: https://issues.apache.org/jira/browse/CB-8401
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: cordova-plugman
> Environment: Android
>Reporter: Eddy Verbruggen
>
> If two plugins request the same permission they are nicely merged into one 
> line in AndroidManifest.xml.
> However, if one of those two has 'android:maxSdkVersion="18"', both lines 
> show up in the resulting AndroidManifest.xml which is not allowed, so the 
> Android build fails.
> As an example you can create a Cordova CLI project with the core File plugin 
> and SocialSharing (the latter has the maxSdkVersion set):
> cordova create duplicatepermissiontest
> cd duplicatepermissiontest
> cordova platform add android
> cordova plugin add org.apache.cordova.file
> cordova plugin add nl.x-services.plugins.socialsharing
> cordova prepare
> The AndroidManifest.xml now has the duplicate permission.
> I think what you'd want is the broader permission to 'win' this fight, so I'd 
> expect the manifest to contain only ' android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>'.
> Note that I added the maxSdkVersion restriction because according to Google 
> SDK 19+ no longer requires the permission in my case and the permission tends 
> to scare off people using apps with this plugin installed.
> I hope you will consider creating something clever to merge these duplicate 
> permissions.
> This issue was first reported here: 
> https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin/issues/295
> Best,
> Eddy



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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



[jira] [Commented] (CB-12361) Speed up cordova-lib tests

2017-07-12 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-12361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16085024#comment-16085024
 ] 

ASF GitHub Bot commented on CB-12361:
-

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

https://github.com/apache/cordova-lib/pull/573#discussion_r127110528
  
--- Diff: spec/cordova/platform/addHelper.spec.js ---
@@ -16,34 +16,439 @@
 */
 /* eslint-env jasmine */
 
+var path = require('path');
+var fs = require('fs');
+var Q = require('q');
+var shell = require('shelljs');
+var events = require('cordova-common').events;
+var rewire = require('rewire');
+var platform_addHelper = rewire('../../../src/cordova/platform/addHelper');
+var platform_module = require('../../../src/cordova/platform');
+var platform_metadata = require('../../../src/cordova/platform_metadata');
+var cordova_util = require('../../../src/cordova/util');
+var cordova_config = require('../../../src/cordova/config');
+var plugman = require('../../../src/plugman/plugman');
+var fetch_metadata = require('../../../src/plugman/util/metadata');
+var lazy_load = require('../../../src/cordova/lazy_load');
+var prepare = require('../../../src/cordova/prepare');
+var gitclone = require('../../../src/gitclone');
+var fail;
+
 describe('cordova/platform/addHelper', function () {
+var projectRoot = '/some/path';
+// These _mock and _revert_mock objects use rewire as the modules 
these mocks replace
+// during testing all return functions, which we cannot spy on using 
jasmine.
+// Thus, we replace these modules inside the scope of addHelper.js 
using rewire, and shim
+// in these _mock test dummies. The test dummies themselves are 
constructed using
+// jasmine.createSpy inside the first beforeEach.
+var cfg_parser_mock = function () {};
+var cfg_parser_revert_mock;
+var hooks_mock;
+var platform_api_mock;
+var fetch_mock;
+var fetch_revert_mock;
+var prepare_mock;
+var prepare_revert_mock;
+var fake_platform = {
+'platform': 'atari'
+};
+var package_json_mock;
+package_json_mock = jasmine.createSpyObj('package json mock', 
['cordova', 'dependencies']);
+package_json_mock.dependencies = {};
+package_json_mock.cordova = {};
+
+beforeEach(function () {
+hooks_mock = jasmine.createSpyObj('hooksRunner mock', ['fire']);
+hooks_mock.fire.and.returnValue(Q());
+cfg_parser_mock.prototype = jasmine.createSpyObj('config parser 
mock', ['write', 'removeEngine', 'addEngine', 'getHookScripts']);
+cfg_parser_revert_mock = 
platform_addHelper.__set__('ConfigParser', cfg_parser_mock);
+fetch_mock = jasmine.createSpy('fetch mock').and.returnValue(Q());
+fetch_revert_mock = platform_addHelper.__set__('fetch', 
fetch_mock);
+prepare_mock = jasmine.createSpy('prepare 
mock').and.returnValue(Q());
+prepare_mock.preparePlatforms = 
jasmine.createSpy('preparePlatforms mock').and.returnValue(Q());
+prepare_revert_mock = platform_addHelper.__set__('prepare', 
prepare_mock);
+spyOn(shell, 'mkdir');
+spyOn(fs, 'existsSync').and.returnValue(false);
+spyOn(fs, 'writeFileSync');
+spyOn(cordova_util, 
'projectConfig').and.returnValue(path.join(projectRoot, 'config.xml'));
+spyOn(cordova_util, 'isDirectory').and.returnValue(false);
+spyOn(cordova_util, 'fixRelativePath').and.callFake(function 
(input) { return input; });
+spyOn(cordova_util, 'isUrl').and.returnValue(false);
+spyOn(cordova_util, 'hostSupports').and.returnValue(true);
+spyOn(cordova_util, 'removePlatformPluginsJson');
+spyOn(cordova_config, 'read').and.returnValue({});
+spyOn(events, 'emit');
+// Fake platform details we will use for our mocks, returned by 
either
+// getPlatfromDetailsFromDir (in the local-directory case), or
+// downloadPlatform (in every other case)
+spyOn(platform_module, 
'getPlatformDetailsFromDir').and.returnValue(Q(fake_platform));
+spyOn(platform_addHelper, 
'downloadPlatform').and.returnValue(Q(fake_platform));
+spyOn(platform_addHelper, 
'getVersionFromConfigFile').and.returnValue(false);
+spyOn(platform_addHelper, 
'installPluginsForNewPlatform').and.returnValue(Q());
+platform_api_mock = jasmine.createSpyObj('platform api mock', 
['createPlatform', 'updatePlatform']);
+platform_api_mock.createPlatform.and.returnValue(Q());
+platform_api_mock.updatePlatform.and.returnValue(Q());
+spyOn(cordova_util, 
'getPlatformApiFunction'

[jira] [Updated] (CB-13018) cordova build failed for both android and ios

2017-07-12 Thread oscar peng (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-13018?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

oscar peng updated CB-13018:

Description: 
Following http://cordova.apache.org/docs/en/latest/guide/cli/index.html, Create 
your first Cordova app.

h1. cordova requirements

 - Requirements check results for android:
Java JDK: installed 1.8.0
Android SDK: installed true
Android target: installed 
android-26,android-25,android-24,android-N,android-23,Google Inc.:Google 
APIs:23,android-22,android-21,android-20,android-19,android-18,android-17,android-16,android-15,android-14
Gradle: installed /Applications/Android Studio 3.0 
Preview.app/Contents/gradle/gradle-4.1-milestone-1/bin/gradle

  -  Requirements check results for ios:
Apple OS X: installed darwin
Xcode: installed 8.3.3
ios-deploy: not installed
ios-deploy was not found. Please download, build and install version 1.9.0 or 
greater from https://github.com/phonegap/ios-deploy into your path, or do 'npm 
install -g ios-deploy'
CocoaPods: installed
Error: Some of requirements check failed

h1. sudo npm install -g ios-deploy --unsafe-perm=true

h1. cordova requirements
Requirements check results for android:
Java JDK: installed 1.8.0
Android SDK: installed true
Android target: installed 
android-26,android-25,android-24,android-N,android-23,Google Inc.:Google 
APIs:23,android-22,android-21,android-20,android-19,android-18,android-17,android-16,android-15,android-14
Gradle: installed /Applications/Android Studio 3.0 
Preview.app/Contents/gradle/gradle-4.1-milestone-1/bin/gradle

Requirements check results for ios:
Apple OS X: installed darwin
Xcode: installed 8.3.3
ios-deploy: installed 1.9.1
CocoaPods: installed

h1. cordova build (or cordova build android)
ANDROID_HOME=/Users/open/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home
Error: spawn EACCES

h1. cordova build ios
** BUILD FAILED **
The following build commands failed:
PhaseScriptExecution Copy\ www\ directory 
/Users/open/Library/Developer/Xcode/DerivedData/HelloWorld-fqxzydxnjuyjjobwofitkplrpyef/Build/Intermediates/HelloWorld.build/Debug-iphonesimulator/HelloWorld.build/Script-304B58A110DAC018002A0835.sh
(1 failure)
Error: Error code 65 for command: xcodebuild with args: 
-xcconfig,/Users/open/NodeProjects/cordova-projects/hello/platforms/ios/cordova/build-debug.xcconfig,-workspace,HelloWorld.xcworkspace,-scheme,HelloWorld,-configuration,Debug,-sdk,iphonesimulator,-destination,platform=iOS
 Simulator,name=iPhone 
SE,build,CONFIGURATION_BUILD_DIR=/Users/open/NodeProjects/cordova-projects/hello/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/open/NodeProjects/cordova-projects/hello/platforms/ios/build/sharedpch




  was:
Following http://cordova.apache.org/docs/en/latest/guide/cli/index.html, Create 
your first Cordova app.

h1. cordova requirements

 - Requirements check results for android:
Java JDK: installed 1.8.0
Android SDK: installed true
Android target: installed 
android-26,android-25,android-24,android-N,android-23,Google Inc.:Google 
APIs:23,android-22,android-21,android-20,android-19,android-18,android-17,android-16,android-15,android-14
Gradle: installed /Applications/Android Studio 3.0 
Preview.app/Contents/gradle/gradle-4.1-milestone-1/bin/gradle

  -  Requirements check results for ios:
Apple OS X: installed darwin
Xcode: installed 8.3.3
ios-deploy: not installed
ios-deploy was not found. Please download, build and install version 1.9.0 or 
greater from https://github.com/phonegap/ios-deploy into your path, or do 'npm 
install -g ios-deploy'
CocoaPods: installed
Error: Some of requirements check failed

h1. sudo npm install -g iso-deploy --unsafe-perm=true

h1. cordova requirements
Requirements check results for android:
Java JDK: installed 1.8.0
Android SDK: installed true
Android target: installed 
android-26,android-25,android-24,android-N,android-23,Google Inc.:Google 
APIs:23,android-22,android-21,android-20,android-19,android-18,android-17,android-16,android-15,android-14
Gradle: installed /Applications/Android Studio 3.0 
Preview.app/Contents/gradle/gradle-4.1-milestone-1/bin/gradle

Requirements check results for ios:
Apple OS X: installed darwin
Xcode: installed 8.3.3
ios-deploy: installed 1.9.1
CocoaPods: installed

h1. cordova build (or cordova build android)
ANDROID_HOME=/Users/open/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home
Error: spawn EACCES

h1. cordova build ios
** BUILD FAILED **
The following build commands failed:
PhaseScriptExecution Copy\ www\ directory 
/Users/open/Library/Developer/Xcode/DerivedData/HelloWorld-fqxzydxnjuyjjobwofitkplrpyef/Build/Intermediates/HelloWorld.build/Debug-iphonesimulator/HelloWorld.build/Script-304B58A110DAC018002A0835.sh
(1 failure)
Error: Error code 65 for command: xcodebuild with args: 
-xcconfig,/Users/open/NodeProjects/cordova-projects/hello/platfo

[jira] [Created] (CB-13018) cordova build failed for both android and ios

2017-07-12 Thread oscar peng (JIRA)
oscar peng created CB-13018:
---

 Summary: cordova build failed for both android and ios
 Key: CB-13018
 URL: https://issues.apache.org/jira/browse/CB-13018
 Project: Apache Cordova
  Issue Type: Bug
  Components: cordova-android, cordova-ios
Affects Versions: cordova-ios@4.4.0, cordova-android@5.2.2, 7.0.1
 Environment: (1)MacOS: 10.12.5
(2)node: v8.1.4
(3)cordova: 7.0.1
(4)*cordova platform ls*
android 6.2.3
ios 4.4.0

Reporter: oscar peng
Assignee: Joe Bowser


Following http://cordova.apache.org/docs/en/latest/guide/cli/index.html, Create 
your first Cordova app.

h1. cordova requirements

 - Requirements check results for android:
Java JDK: installed 1.8.0
Android SDK: installed true
Android target: installed 
android-26,android-25,android-24,android-N,android-23,Google Inc.:Google 
APIs:23,android-22,android-21,android-20,android-19,android-18,android-17,android-16,android-15,android-14
Gradle: installed /Applications/Android Studio 3.0 
Preview.app/Contents/gradle/gradle-4.1-milestone-1/bin/gradle

  -  Requirements check results for ios:
Apple OS X: installed darwin
Xcode: installed 8.3.3
ios-deploy: not installed
ios-deploy was not found. Please download, build and install version 1.9.0 or 
greater from https://github.com/phonegap/ios-deploy into your path, or do 'npm 
install -g ios-deploy'
CocoaPods: installed
Error: Some of requirements check failed

h1. sudo nom install -g iso-deploy --unsafe-perm=true

h1. cordova requirements
Requirements check results for android:
Java JDK: installed 1.8.0
Android SDK: installed true
Android target: installed 
android-26,android-25,android-24,android-N,android-23,Google Inc.:Google 
APIs:23,android-22,android-21,android-20,android-19,android-18,android-17,android-16,android-15,android-14
Gradle: installed /Applications/Android Studio 3.0 
Preview.app/Contents/gradle/gradle-4.1-milestone-1/bin/gradle

Requirements check results for ios:
Apple OS X: installed darwin
Xcode: installed 8.3.3
ios-deploy: installed 1.9.1
CocoaPods: installed

h1. cordova build (or cordova build android)
ANDROID_HOME=/Users/open/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home
Error: spawn EACCES

h1. cordova build ios
** BUILD FAILED **
The following build commands failed:
PhaseScriptExecution Copy\ www\ directory 
/Users/open/Library/Developer/Xcode/DerivedData/HelloWorld-fqxzydxnjuyjjobwofitkplrpyef/Build/Intermediates/HelloWorld.build/Debug-iphonesimulator/HelloWorld.build/Script-304B58A110DAC018002A0835.sh
(1 failure)
Error: Error code 65 for command: xcodebuild with args: 
-xcconfig,/Users/open/NodeProjects/cordova-projects/hello/platforms/ios/cordova/build-debug.xcconfig,-workspace,HelloWorld.xcworkspace,-scheme,HelloWorld,-configuration,Debug,-sdk,iphonesimulator,-destination,platform=iOS
 Simulator,name=iPhone 
SE,build,CONFIGURATION_BUILD_DIR=/Users/open/NodeProjects/cordova-projects/hello/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/open/NodeProjects/cordova-projects/hello/platforms/ios/build/sharedpch






--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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



[jira] [Updated] (CB-13018) cordova build failed for both android and ios

2017-07-12 Thread oscar peng (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-13018?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

oscar peng updated CB-13018:

Description: 
Following http://cordova.apache.org/docs/en/latest/guide/cli/index.html, Create 
your first Cordova app.

h1. cordova requirements

 - Requirements check results for android:
Java JDK: installed 1.8.0
Android SDK: installed true
Android target: installed 
android-26,android-25,android-24,android-N,android-23,Google Inc.:Google 
APIs:23,android-22,android-21,android-20,android-19,android-18,android-17,android-16,android-15,android-14
Gradle: installed /Applications/Android Studio 3.0 
Preview.app/Contents/gradle/gradle-4.1-milestone-1/bin/gradle

  -  Requirements check results for ios:
Apple OS X: installed darwin
Xcode: installed 8.3.3
ios-deploy: not installed
ios-deploy was not found. Please download, build and install version 1.9.0 or 
greater from https://github.com/phonegap/ios-deploy into your path, or do 'npm 
install -g ios-deploy'
CocoaPods: installed
Error: Some of requirements check failed

h1. sudo npm install -g iso-deploy --unsafe-perm=true

h1. cordova requirements
Requirements check results for android:
Java JDK: installed 1.8.0
Android SDK: installed true
Android target: installed 
android-26,android-25,android-24,android-N,android-23,Google Inc.:Google 
APIs:23,android-22,android-21,android-20,android-19,android-18,android-17,android-16,android-15,android-14
Gradle: installed /Applications/Android Studio 3.0 
Preview.app/Contents/gradle/gradle-4.1-milestone-1/bin/gradle

Requirements check results for ios:
Apple OS X: installed darwin
Xcode: installed 8.3.3
ios-deploy: installed 1.9.1
CocoaPods: installed

h1. cordova build (or cordova build android)
ANDROID_HOME=/Users/open/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home
Error: spawn EACCES

h1. cordova build ios
** BUILD FAILED **
The following build commands failed:
PhaseScriptExecution Copy\ www\ directory 
/Users/open/Library/Developer/Xcode/DerivedData/HelloWorld-fqxzydxnjuyjjobwofitkplrpyef/Build/Intermediates/HelloWorld.build/Debug-iphonesimulator/HelloWorld.build/Script-304B58A110DAC018002A0835.sh
(1 failure)
Error: Error code 65 for command: xcodebuild with args: 
-xcconfig,/Users/open/NodeProjects/cordova-projects/hello/platforms/ios/cordova/build-debug.xcconfig,-workspace,HelloWorld.xcworkspace,-scheme,HelloWorld,-configuration,Debug,-sdk,iphonesimulator,-destination,platform=iOS
 Simulator,name=iPhone 
SE,build,CONFIGURATION_BUILD_DIR=/Users/open/NodeProjects/cordova-projects/hello/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/open/NodeProjects/cordova-projects/hello/platforms/ios/build/sharedpch




  was:
Following http://cordova.apache.org/docs/en/latest/guide/cli/index.html, Create 
your first Cordova app.

h1. cordova requirements

 - Requirements check results for android:
Java JDK: installed 1.8.0
Android SDK: installed true
Android target: installed 
android-26,android-25,android-24,android-N,android-23,Google Inc.:Google 
APIs:23,android-22,android-21,android-20,android-19,android-18,android-17,android-16,android-15,android-14
Gradle: installed /Applications/Android Studio 3.0 
Preview.app/Contents/gradle/gradle-4.1-milestone-1/bin/gradle

  -  Requirements check results for ios:
Apple OS X: installed darwin
Xcode: installed 8.3.3
ios-deploy: not installed
ios-deploy was not found. Please download, build and install version 1.9.0 or 
greater from https://github.com/phonegap/ios-deploy into your path, or do 'npm 
install -g ios-deploy'
CocoaPods: installed
Error: Some of requirements check failed

h1. sudo nom install -g iso-deploy --unsafe-perm=true

h1. cordova requirements
Requirements check results for android:
Java JDK: installed 1.8.0
Android SDK: installed true
Android target: installed 
android-26,android-25,android-24,android-N,android-23,Google Inc.:Google 
APIs:23,android-22,android-21,android-20,android-19,android-18,android-17,android-16,android-15,android-14
Gradle: installed /Applications/Android Studio 3.0 
Preview.app/Contents/gradle/gradle-4.1-milestone-1/bin/gradle

Requirements check results for ios:
Apple OS X: installed darwin
Xcode: installed 8.3.3
ios-deploy: installed 1.9.1
CocoaPods: installed

h1. cordova build (or cordova build android)
ANDROID_HOME=/Users/open/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home
Error: spawn EACCES

h1. cordova build ios
** BUILD FAILED **
The following build commands failed:
PhaseScriptExecution Copy\ www\ directory 
/Users/open/Library/Developer/Xcode/DerivedData/HelloWorld-fqxzydxnjuyjjobwofitkplrpyef/Build/Intermediates/HelloWorld.build/Debug-iphonesimulator/HelloWorld.build/Script-304B58A110DAC018002A0835.sh
(1 failure)
Error: Error code 65 for command: xcodebuild with args: 
-xcconfig,/Users/open/NodeProjects/cordova-projects/hello/platfo

[jira] [Commented] (CB-12361) Speed up cordova-lib tests

2017-07-12 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-12361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16084647#comment-16084647
 ] 

ASF GitHub Bot commented on CB-12361:
-

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

https://github.com/apache/cordova-lib/pull/573#discussion_r127066391
  
--- Diff: spec/cordova/platform/addHelper.spec.js ---
@@ -16,34 +16,439 @@
 */
 /* eslint-env jasmine */
 
+var path = require('path');
+var fs = require('fs');
+var Q = require('q');
+var shell = require('shelljs');
+var events = require('cordova-common').events;
+var rewire = require('rewire');
+var platform_addHelper = rewire('../../../src/cordova/platform/addHelper');
+var platform_module = require('../../../src/cordova/platform');
+var platform_metadata = require('../../../src/cordova/platform_metadata');
+var cordova_util = require('../../../src/cordova/util');
+var cordova_config = require('../../../src/cordova/config');
+var plugman = require('../../../src/plugman/plugman');
+var fetch_metadata = require('../../../src/plugman/util/metadata');
+var lazy_load = require('../../../src/cordova/lazy_load');
+var prepare = require('../../../src/cordova/prepare');
+var gitclone = require('../../../src/gitclone');
+var fail;
+
 describe('cordova/platform/addHelper', function () {
+var projectRoot = '/some/path';
+// These _mock and _revert_mock objects use rewire as the modules 
these mocks replace
+// during testing all return functions, which we cannot spy on using 
jasmine.
+// Thus, we replace these modules inside the scope of addHelper.js 
using rewire, and shim
+// in these _mock test dummies. The test dummies themselves are 
constructed using
+// jasmine.createSpy inside the first beforeEach.
+var cfg_parser_mock = function () {};
+var cfg_parser_revert_mock;
+var hooks_mock;
+var platform_api_mock;
+var fetch_mock;
+var fetch_revert_mock;
+var prepare_mock;
+var prepare_revert_mock;
+var fake_platform = {
+'platform': 'atari'
+};
+var package_json_mock;
+package_json_mock = jasmine.createSpyObj('package json mock', 
['cordova', 'dependencies']);
+package_json_mock.dependencies = {};
+package_json_mock.cordova = {};
+
+beforeEach(function () {
+hooks_mock = jasmine.createSpyObj('hooksRunner mock', ['fire']);
+hooks_mock.fire.and.returnValue(Q());
+cfg_parser_mock.prototype = jasmine.createSpyObj('config parser 
mock', ['write', 'removeEngine', 'addEngine', 'getHookScripts']);
+cfg_parser_revert_mock = 
platform_addHelper.__set__('ConfigParser', cfg_parser_mock);
+fetch_mock = jasmine.createSpy('fetch mock').and.returnValue(Q());
+fetch_revert_mock = platform_addHelper.__set__('fetch', 
fetch_mock);
+prepare_mock = jasmine.createSpy('prepare 
mock').and.returnValue(Q());
+prepare_mock.preparePlatforms = 
jasmine.createSpy('preparePlatforms mock').and.returnValue(Q());
+prepare_revert_mock = platform_addHelper.__set__('prepare', 
prepare_mock);
+spyOn(shell, 'mkdir');
+spyOn(fs, 'existsSync').and.returnValue(false);
+spyOn(fs, 'writeFileSync');
+spyOn(cordova_util, 
'projectConfig').and.returnValue(path.join(projectRoot, 'config.xml'));
+spyOn(cordova_util, 'isDirectory').and.returnValue(false);
+spyOn(cordova_util, 'fixRelativePath').and.callFake(function 
(input) { return input; });
+spyOn(cordova_util, 'isUrl').and.returnValue(false);
+spyOn(cordova_util, 'hostSupports').and.returnValue(true);
+spyOn(cordova_util, 'removePlatformPluginsJson');
+spyOn(cordova_config, 'read').and.returnValue({});
+spyOn(events, 'emit');
+// Fake platform details we will use for our mocks, returned by 
either
+// getPlatfromDetailsFromDir (in the local-directory case), or
+// downloadPlatform (in every other case)
+spyOn(platform_module, 
'getPlatformDetailsFromDir').and.returnValue(Q(fake_platform));
+spyOn(platform_addHelper, 
'downloadPlatform').and.returnValue(Q(fake_platform));
+spyOn(platform_addHelper, 
'getVersionFromConfigFile').and.returnValue(false);
+spyOn(platform_addHelper, 
'installPluginsForNewPlatform').and.returnValue(Q());
+platform_api_mock = jasmine.createSpyObj('platform api mock', 
['createPlatform', 'updatePlatform']);
+platform_api_mock.createPlatform.and.returnValue(Q());
+platform_api_mock.updatePlatform.and.returnValue(Q());
+spyOn(cordova_util, 
'getPlatformApiFunction'

[jira] [Commented] (CB-12361) Speed up cordova-lib tests

2017-07-12 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-12361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16084576#comment-16084576
 ] 

ASF GitHub Bot commented on CB-12361:
-

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

https://github.com/apache/cordova-lib/pull/573#discussion_r127055093
  
--- Diff: spec/cordova/platform/addHelper.spec.js ---
@@ -16,34 +16,439 @@
 */
 /* eslint-env jasmine */
 
+var path = require('path');
+var fs = require('fs');
+var Q = require('q');
+var shell = require('shelljs');
+var events = require('cordova-common').events;
+var rewire = require('rewire');
+var platform_addHelper = rewire('../../../src/cordova/platform/addHelper');
+var platform_module = require('../../../src/cordova/platform');
+var platform_metadata = require('../../../src/cordova/platform_metadata');
+var cordova_util = require('../../../src/cordova/util');
+var cordova_config = require('../../../src/cordova/config');
+var plugman = require('../../../src/plugman/plugman');
+var fetch_metadata = require('../../../src/plugman/util/metadata');
+var lazy_load = require('../../../src/cordova/lazy_load');
+var prepare = require('../../../src/cordova/prepare');
+var gitclone = require('../../../src/gitclone');
+var fail;
+
 describe('cordova/platform/addHelper', function () {
+var projectRoot = '/some/path';
+// These _mock and _revert_mock objects use rewire as the modules 
these mocks replace
+// during testing all return functions, which we cannot spy on using 
jasmine.
+// Thus, we replace these modules inside the scope of addHelper.js 
using rewire, and shim
+// in these _mock test dummies. The test dummies themselves are 
constructed using
+// jasmine.createSpy inside the first beforeEach.
+var cfg_parser_mock = function () {};
+var cfg_parser_revert_mock;
+var hooks_mock;
+var platform_api_mock;
+var fetch_mock;
+var fetch_revert_mock;
+var prepare_mock;
+var prepare_revert_mock;
+var fake_platform = {
+'platform': 'atari'
+};
+var package_json_mock;
+package_json_mock = jasmine.createSpyObj('package json mock', 
['cordova', 'dependencies']);
+package_json_mock.dependencies = {};
+package_json_mock.cordova = {};
+
+beforeEach(function () {
+hooks_mock = jasmine.createSpyObj('hooksRunner mock', ['fire']);
+hooks_mock.fire.and.returnValue(Q());
+cfg_parser_mock.prototype = jasmine.createSpyObj('config parser 
mock', ['write', 'removeEngine', 'addEngine', 'getHookScripts']);
+cfg_parser_revert_mock = 
platform_addHelper.__set__('ConfigParser', cfg_parser_mock);
+fetch_mock = jasmine.createSpy('fetch mock').and.returnValue(Q());
+fetch_revert_mock = platform_addHelper.__set__('fetch', 
fetch_mock);
+prepare_mock = jasmine.createSpy('prepare 
mock').and.returnValue(Q());
+prepare_mock.preparePlatforms = 
jasmine.createSpy('preparePlatforms mock').and.returnValue(Q());
+prepare_revert_mock = platform_addHelper.__set__('prepare', 
prepare_mock);
+spyOn(shell, 'mkdir');
+spyOn(fs, 'existsSync').and.returnValue(false);
+spyOn(fs, 'writeFileSync');
+spyOn(cordova_util, 
'projectConfig').and.returnValue(path.join(projectRoot, 'config.xml'));
+spyOn(cordova_util, 'isDirectory').and.returnValue(false);
+spyOn(cordova_util, 'fixRelativePath').and.callFake(function 
(input) { return input; });
+spyOn(cordova_util, 'isUrl').and.returnValue(false);
+spyOn(cordova_util, 'hostSupports').and.returnValue(true);
+spyOn(cordova_util, 'removePlatformPluginsJson');
+spyOn(cordova_config, 'read').and.returnValue({});
+spyOn(events, 'emit');
+// Fake platform details we will use for our mocks, returned by 
either
+// getPlatfromDetailsFromDir (in the local-directory case), or
+// downloadPlatform (in every other case)
+spyOn(platform_module, 
'getPlatformDetailsFromDir').and.returnValue(Q(fake_platform));
+spyOn(platform_addHelper, 
'downloadPlatform').and.returnValue(Q(fake_platform));
+spyOn(platform_addHelper, 
'getVersionFromConfigFile').and.returnValue(false);
+spyOn(platform_addHelper, 
'installPluginsForNewPlatform').and.returnValue(Q());
+platform_api_mock = jasmine.createSpyObj('platform api mock', 
['createPlatform', 'updatePlatform']);
+platform_api_mock.createPlatform.and.returnValue(Q());
+platform_api_mock.updatePlatform.and.returnValue(Q());
+spyOn(cordova_util, 
'getPlatformApiFunctio

[jira] [Commented] (CB-12361) Speed up cordova-lib tests

2017-07-12 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-12361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16084482#comment-16084482
 ] 

ASF GitHub Bot commented on CB-12361:
-

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

https://github.com/apache/cordova-lib/pull/573#discussion_r127039183
  
--- Diff: spec/cordova/platform/addHelper.spec.js ---
@@ -16,34 +16,439 @@
 */
 /* eslint-env jasmine */
 
+var path = require('path');
+var fs = require('fs');
+var Q = require('q');
+var shell = require('shelljs');
+var events = require('cordova-common').events;
+var rewire = require('rewire');
+var platform_addHelper = rewire('../../../src/cordova/platform/addHelper');
+var platform_module = require('../../../src/cordova/platform');
+var platform_metadata = require('../../../src/cordova/platform_metadata');
+var cordova_util = require('../../../src/cordova/util');
+var cordova_config = require('../../../src/cordova/config');
+var plugman = require('../../../src/plugman/plugman');
+var fetch_metadata = require('../../../src/plugman/util/metadata');
+var lazy_load = require('../../../src/cordova/lazy_load');
+var prepare = require('../../../src/cordova/prepare');
+var gitclone = require('../../../src/gitclone');
+var fail;
+
 describe('cordova/platform/addHelper', function () {
+var projectRoot = '/some/path';
+// These _mock and _revert_mock objects use rewire as the modules 
these mocks replace
+// during testing all return functions, which we cannot spy on using 
jasmine.
+// Thus, we replace these modules inside the scope of addHelper.js 
using rewire, and shim
+// in these _mock test dummies. The test dummies themselves are 
constructed using
+// jasmine.createSpy inside the first beforeEach.
+var cfg_parser_mock = function () {};
+var cfg_parser_revert_mock;
+var hooks_mock;
+var platform_api_mock;
+var fetch_mock;
+var fetch_revert_mock;
+var prepare_mock;
+var prepare_revert_mock;
+var fake_platform = {
+'platform': 'atari'
+};
+var package_json_mock;
+package_json_mock = jasmine.createSpyObj('package json mock', 
['cordova', 'dependencies']);
+package_json_mock.dependencies = {};
+package_json_mock.cordova = {};
+
+beforeEach(function () {
+hooks_mock = jasmine.createSpyObj('hooksRunner mock', ['fire']);
+hooks_mock.fire.and.returnValue(Q());
+cfg_parser_mock.prototype = jasmine.createSpyObj('config parser 
mock', ['write', 'removeEngine', 'addEngine', 'getHookScripts']);
+cfg_parser_revert_mock = 
platform_addHelper.__set__('ConfigParser', cfg_parser_mock);
+fetch_mock = jasmine.createSpy('fetch mock').and.returnValue(Q());
+fetch_revert_mock = platform_addHelper.__set__('fetch', 
fetch_mock);
+prepare_mock = jasmine.createSpy('prepare 
mock').and.returnValue(Q());
+prepare_mock.preparePlatforms = 
jasmine.createSpy('preparePlatforms mock').and.returnValue(Q());
+prepare_revert_mock = platform_addHelper.__set__('prepare', 
prepare_mock);
+spyOn(shell, 'mkdir');
+spyOn(fs, 'existsSync').and.returnValue(false);
+spyOn(fs, 'writeFileSync');
+spyOn(cordova_util, 
'projectConfig').and.returnValue(path.join(projectRoot, 'config.xml'));
+spyOn(cordova_util, 'isDirectory').and.returnValue(false);
+spyOn(cordova_util, 'fixRelativePath').and.callFake(function 
(input) { return input; });
+spyOn(cordova_util, 'isUrl').and.returnValue(false);
+spyOn(cordova_util, 'hostSupports').and.returnValue(true);
+spyOn(cordova_util, 'removePlatformPluginsJson');
+spyOn(cordova_config, 'read').and.returnValue({});
+spyOn(events, 'emit');
+// Fake platform details we will use for our mocks, returned by 
either
+// getPlatfromDetailsFromDir (in the local-directory case), or
+// downloadPlatform (in every other case)
+spyOn(platform_module, 
'getPlatformDetailsFromDir').and.returnValue(Q(fake_platform));
+spyOn(platform_addHelper, 
'downloadPlatform').and.returnValue(Q(fake_platform));
+spyOn(platform_addHelper, 
'getVersionFromConfigFile').and.returnValue(false);
+spyOn(platform_addHelper, 
'installPluginsForNewPlatform').and.returnValue(Q());
+platform_api_mock = jasmine.createSpyObj('platform api mock', 
['createPlatform', 'updatePlatform']);
+platform_api_mock.createPlatform.and.returnValue(Q());
+platform_api_mock.updatePlatform.and.returnValue(Q());
+spyOn(cordova_util, 
'getPlatformApiFunc

[jira] [Commented] (CB-12361) Speed up cordova-lib tests

2017-07-12 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-12361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=1608#comment-1608
 ] 

ASF GitHub Bot commented on CB-12361:
-

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

https://github.com/apache/cordova-lib/pull/573#discussion_r127032404
  
--- Diff: spec/cordova/platform/addHelper.spec.js ---
@@ -16,34 +16,439 @@
 */
 /* eslint-env jasmine */
 
+var path = require('path');
+var fs = require('fs');
+var Q = require('q');
+var shell = require('shelljs');
+var events = require('cordova-common').events;
+var rewire = require('rewire');
+var platform_addHelper = rewire('../../../src/cordova/platform/addHelper');
+var platform_module = require('../../../src/cordova/platform');
+var platform_metadata = require('../../../src/cordova/platform_metadata');
+var cordova_util = require('../../../src/cordova/util');
+var cordova_config = require('../../../src/cordova/config');
+var plugman = require('../../../src/plugman/plugman');
+var fetch_metadata = require('../../../src/plugman/util/metadata');
+var lazy_load = require('../../../src/cordova/lazy_load');
+var prepare = require('../../../src/cordova/prepare');
+var gitclone = require('../../../src/gitclone');
+var fail;
+
 describe('cordova/platform/addHelper', function () {
+var projectRoot = '/some/path';
+// These _mock and _revert_mock objects use rewire as the modules 
these mocks replace
+// during testing all return functions, which we cannot spy on using 
jasmine.
+// Thus, we replace these modules inside the scope of addHelper.js 
using rewire, and shim
+// in these _mock test dummies. The test dummies themselves are 
constructed using
+// jasmine.createSpy inside the first beforeEach.
+var cfg_parser_mock = function () {};
+var cfg_parser_revert_mock;
+var hooks_mock;
+var platform_api_mock;
+var fetch_mock;
+var fetch_revert_mock;
+var prepare_mock;
+var prepare_revert_mock;
+var fake_platform = {
+'platform': 'atari'
+};
+var package_json_mock;
+package_json_mock = jasmine.createSpyObj('package json mock', 
['cordova', 'dependencies']);
+package_json_mock.dependencies = {};
+package_json_mock.cordova = {};
+
+beforeEach(function () {
+hooks_mock = jasmine.createSpyObj('hooksRunner mock', ['fire']);
+hooks_mock.fire.and.returnValue(Q());
+cfg_parser_mock.prototype = jasmine.createSpyObj('config parser 
mock', ['write', 'removeEngine', 'addEngine', 'getHookScripts']);
+cfg_parser_revert_mock = 
platform_addHelper.__set__('ConfigParser', cfg_parser_mock);
+fetch_mock = jasmine.createSpy('fetch mock').and.returnValue(Q());
+fetch_revert_mock = platform_addHelper.__set__('fetch', 
fetch_mock);
+prepare_mock = jasmine.createSpy('prepare 
mock').and.returnValue(Q());
+prepare_mock.preparePlatforms = 
jasmine.createSpy('preparePlatforms mock').and.returnValue(Q());
+prepare_revert_mock = platform_addHelper.__set__('prepare', 
prepare_mock);
+spyOn(shell, 'mkdir');
+spyOn(fs, 'existsSync').and.returnValue(false);
+spyOn(fs, 'writeFileSync');
+spyOn(cordova_util, 
'projectConfig').and.returnValue(path.join(projectRoot, 'config.xml'));
+spyOn(cordova_util, 'isDirectory').and.returnValue(false);
+spyOn(cordova_util, 'fixRelativePath').and.callFake(function 
(input) { return input; });
+spyOn(cordova_util, 'isUrl').and.returnValue(false);
+spyOn(cordova_util, 'hostSupports').and.returnValue(true);
+spyOn(cordova_util, 'removePlatformPluginsJson');
+spyOn(cordova_config, 'read').and.returnValue({});
+spyOn(events, 'emit');
+// Fake platform details we will use for our mocks, returned by 
either
+// getPlatfromDetailsFromDir (in the local-directory case), or
+// downloadPlatform (in every other case)
+spyOn(platform_module, 
'getPlatformDetailsFromDir').and.returnValue(Q(fake_platform));
+spyOn(platform_addHelper, 
'downloadPlatform').and.returnValue(Q(fake_platform));
+spyOn(platform_addHelper, 
'getVersionFromConfigFile').and.returnValue(false);
+spyOn(platform_addHelper, 
'installPluginsForNewPlatform').and.returnValue(Q());
+platform_api_mock = jasmine.createSpyObj('platform api mock', 
['createPlatform', 'updatePlatform']);
+platform_api_mock.createPlatform.and.returnValue(Q());
+platform_api_mock.updatePlatform.and.returnValue(Q());
+spyOn(cordova_util, 
'getPlatformApiFunctio

[jira] [Commented] (CB-12928) Windows UWP shared Local Folder being removed

2017-07-12 Thread Jon Hoffman (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-12928?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16084389#comment-16084389
 ] 

Jon Hoffman commented on CB-12928:
--

I added the one file you mentioned above that was missing.  If you find any 
additional files, please let me know

> Windows UWP shared Local Folder being removed
> -
>
> Key: CB-12928
> URL: https://issues.apache.org/jira/browse/CB-12928
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: cordova-windows
>Affects Versions: 6.5.0
> Environment: When running on a Windows 10 platform
>Reporter: Jon Hoffman
>Assignee: Jesse MacFadyen
>Priority: Critical
>  Labels: windows
>
> We are writing an application using Ionic 2 for Windows 10. The application 
> will need to share data between different users on the same machine therefore 
> we are using the shared local folder to save the data to as described in the 
> “Using Shared Local” section of this page: 
> https://blogs.windows.com/buildingapps/2016/05/24/sharing-your-local-app-data
> This method works great and we made changes to the Cordova-Sqlite-Storage 
> plugin so it will write the database file to the shared local folder. The 
> problem is when we update our application the shared local folder is removed 
> thereby erasing all of the saved data.
> I created a native C# application to see if we had the same behavior when we 
> updated a native application. When we updated the native app the shared local 
> folder was not removed therefore this is an issue specific to our hybrid 
> application.
> My first thought was maybe the Add-AppDevPackage.ps1 scripts were different 
> between the native and Ionic 2 application since that is the script that we 
> used to perform the installation and update. I ran a comparison tool to 
> compare the scripts from the Ionic2 and native applications however the two 
> files are exactly the same.
> I can also verify that the user local folder for the application is not 
> removed when we perform an update however that folder is specific to the 
> individual user and we can not share data from that folder. Does anyone know 
> why the shared local folder is removed when we perform an update of an Ionic 
> 2 application?
> I put a proof of concept application that simply writes a text file to the 
> shared local folder and the application local folder that can be used to see 
> how the shared local folder is removed when we update the app.  The 
> repository is located here: 
> https://github.com/hoffmanjon/Cordova_Windows_UWP_Shared_Local_Folder  and 
> includes a windows plugin to write to the shared local folder.  
> You will need to set a group policy to get the shared local folders working.  
> In the in the “Using Shared Local” section of this page: 
> https://blogs.windows.com/buildingapps/2016/05/24/sharing-your-local-app-data 
>  it describes how to change the policy and which one to change.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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



[jira] [Commented] (CB-11244) Update Android Project Structure to be more compatible with Android Studio

2017-07-12 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-11244?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16084350#comment-16084350
 ] 

ASF GitHub Bot commented on CB-11244:
-

Github user filmaj commented on the issue:

https://github.com/apache/cordova-android/pull/389
  
Yes, seriously, because the code interpolates activity name / package name 
/ etc. into hard-coded paths!


> Update Android Project Structure to be more compatible with Android Studio
> --
>
> Key: CB-11244
> URL: https://issues.apache.org/jira/browse/CB-11244
> Project: Apache Cordova
>  Issue Type: Improvement
>  Components: cordova-android
>Reporter: Joe Bowser
>Assignee: Joe Bowser
>  Labels: CordovaAndroidSix
>
> Currently our existing Android projects have the old Android Project 
> structure created by default, even for new projects, which makes no sense 
> since we no longer support Eclipse as the default project editor and have 
> moved to Android Studio for Android development.
> The main reason for doing this is to clean up dependencies and to allow for 
> projects and dependencies to work more like how modern Android projects work 
> and to remove as much custom Gradle code as possible.  This would also allow 
> us in the future to move towards having Android Plugin code work as Android 
> Libraries with Resources instead of just copying things across, which gives 
> us the ability to add JUnit tests and bundled resources.  This would 
> dramatically increase the quality of plugins such as InAppBrowser, and third 
> party plugins such as the Barcode Scanner.
> This would have to be done on the next major version, and the upgrade would 
> be tricky to do.  However, the benefits at this point would greatly outweigh 
> the costs of maintaining the old project structure.  The old cordova-common 
> code in Cordova-Android 5.0.x would allow for plugins in the short term to 
> work with both projects until we get the new project structure ready.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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



[jira] [Commented] (CB-12361) Speed up cordova-lib tests

2017-07-12 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-12361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16084282#comment-16084282
 ] 

ASF GitHub Bot commented on CB-12361:
-

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

https://github.com/apache/cordova-lib/pull/573#discussion_r127007878
  
--- Diff: spec/cordova/platform/addHelper.spec.js ---
@@ -16,34 +16,439 @@
 */
 /* eslint-env jasmine */
 
+var path = require('path');
+var fs = require('fs');
+var Q = require('q');
+var shell = require('shelljs');
+var events = require('cordova-common').events;
+var rewire = require('rewire');
+var platform_addHelper = rewire('../../../src/cordova/platform/addHelper');
+var platform_module = require('../../../src/cordova/platform');
+var platform_metadata = require('../../../src/cordova/platform_metadata');
+var cordova_util = require('../../../src/cordova/util');
+var cordova_config = require('../../../src/cordova/config');
+var plugman = require('../../../src/plugman/plugman');
+var fetch_metadata = require('../../../src/plugman/util/metadata');
+var lazy_load = require('../../../src/cordova/lazy_load');
+var prepare = require('../../../src/cordova/prepare');
+var gitclone = require('../../../src/gitclone');
+var fail;
+
 describe('cordova/platform/addHelper', function () {
+var projectRoot = '/some/path';
+// These _mock and _revert_mock objects use rewire as the modules 
these mocks replace
+// during testing all return functions, which we cannot spy on using 
jasmine.
+// Thus, we replace these modules inside the scope of addHelper.js 
using rewire, and shim
+// in these _mock test dummies. The test dummies themselves are 
constructed using
+// jasmine.createSpy inside the first beforeEach.
+var cfg_parser_mock = function () {};
+var cfg_parser_revert_mock;
+var hooks_mock;
+var platform_api_mock;
+var fetch_mock;
+var fetch_revert_mock;
+var prepare_mock;
+var prepare_revert_mock;
+var fake_platform = {
+'platform': 'atari'
+};
+var package_json_mock;
+package_json_mock = jasmine.createSpyObj('package json mock', 
['cordova', 'dependencies']);
+package_json_mock.dependencies = {};
+package_json_mock.cordova = {};
+
+beforeEach(function () {
+hooks_mock = jasmine.createSpyObj('hooksRunner mock', ['fire']);
+hooks_mock.fire.and.returnValue(Q());
+cfg_parser_mock.prototype = jasmine.createSpyObj('config parser 
mock', ['write', 'removeEngine', 'addEngine', 'getHookScripts']);
+cfg_parser_revert_mock = 
platform_addHelper.__set__('ConfigParser', cfg_parser_mock);
+fetch_mock = jasmine.createSpy('fetch mock').and.returnValue(Q());
+fetch_revert_mock = platform_addHelper.__set__('fetch', 
fetch_mock);
+prepare_mock = jasmine.createSpy('prepare 
mock').and.returnValue(Q());
+prepare_mock.preparePlatforms = 
jasmine.createSpy('preparePlatforms mock').and.returnValue(Q());
+prepare_revert_mock = platform_addHelper.__set__('prepare', 
prepare_mock);
+spyOn(shell, 'mkdir');
+spyOn(fs, 'existsSync').and.returnValue(false);
+spyOn(fs, 'writeFileSync');
+spyOn(cordova_util, 
'projectConfig').and.returnValue(path.join(projectRoot, 'config.xml'));
+spyOn(cordova_util, 'isDirectory').and.returnValue(false);
+spyOn(cordova_util, 'fixRelativePath').and.callFake(function 
(input) { return input; });
+spyOn(cordova_util, 'isUrl').and.returnValue(false);
+spyOn(cordova_util, 'hostSupports').and.returnValue(true);
+spyOn(cordova_util, 'removePlatformPluginsJson');
+spyOn(cordova_config, 'read').and.returnValue({});
+spyOn(events, 'emit');
+// Fake platform details we will use for our mocks, returned by 
either
+// getPlatfromDetailsFromDir (in the local-directory case), or
+// downloadPlatform (in every other case)
+spyOn(platform_module, 
'getPlatformDetailsFromDir').and.returnValue(Q(fake_platform));
+spyOn(platform_addHelper, 
'downloadPlatform').and.returnValue(Q(fake_platform));
+spyOn(platform_addHelper, 
'getVersionFromConfigFile').and.returnValue(false);
+spyOn(platform_addHelper, 
'installPluginsForNewPlatform').and.returnValue(Q());
+platform_api_mock = jasmine.createSpyObj('platform api mock', 
['createPlatform', 'updatePlatform']);
+platform_api_mock.createPlatform.and.returnValue(Q());
+platform_api_mock.updatePlatform.and.returnValue(Q());
+spyOn(cordova_util, 
'getPlatformApiFunction'

[jira] [Commented] (CB-11244) Update Android Project Structure to be more compatible with Android Studio

2017-07-12 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-11244?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16084303#comment-16084303
 ] 

ASF GitHub Bot commented on CB-11244:
-

Github user infil00p commented on the issue:

https://github.com/apache/cordova-android/pull/389
  
@filmaj Hard copied paths? SRSLY? 


> Update Android Project Structure to be more compatible with Android Studio
> --
>
> Key: CB-11244
> URL: https://issues.apache.org/jira/browse/CB-11244
> Project: Apache Cordova
>  Issue Type: Improvement
>  Components: cordova-android
>Reporter: Joe Bowser
>Assignee: Joe Bowser
>  Labels: CordovaAndroidSix
>
> Currently our existing Android projects have the old Android Project 
> structure created by default, even for new projects, which makes no sense 
> since we no longer support Eclipse as the default project editor and have 
> moved to Android Studio for Android development.
> The main reason for doing this is to clean up dependencies and to allow for 
> projects and dependencies to work more like how modern Android projects work 
> and to remove as much custom Gradle code as possible.  This would also allow 
> us in the future to move towards having Android Plugin code work as Android 
> Libraries with Resources instead of just copying things across, which gives 
> us the ability to add JUnit tests and bundled resources.  This would 
> dramatically increase the quality of plugins such as InAppBrowser, and third 
> party plugins such as the Barcode Scanner.
> This would have to be done on the next major version, and the upgrade would 
> be tricky to do.  However, the benefits at this point would greatly outweigh 
> the costs of maintaining the old project structure.  The old cordova-common 
> code in Cordova-Android 5.0.x would allow for plugins in the short term to 
> work with both projects until we get the new project structure ready.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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



[jira] [Commented] (CB-12361) Speed up cordova-lib tests

2017-07-12 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-12361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16084285#comment-16084285
 ] 

ASF GitHub Bot commented on CB-12361:
-

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

https://github.com/apache/cordova-lib/pull/573#discussion_r127008421
  
--- Diff: spec/cordova/platform/addHelper.spec.js ---
@@ -16,34 +16,439 @@
 */
 /* eslint-env jasmine */
 
+var path = require('path');
+var fs = require('fs');
+var Q = require('q');
+var shell = require('shelljs');
+var events = require('cordova-common').events;
+var rewire = require('rewire');
+var platform_addHelper = rewire('../../../src/cordova/platform/addHelper');
+var platform_module = require('../../../src/cordova/platform');
+var platform_metadata = require('../../../src/cordova/platform_metadata');
+var cordova_util = require('../../../src/cordova/util');
+var cordova_config = require('../../../src/cordova/config');
+var plugman = require('../../../src/plugman/plugman');
+var fetch_metadata = require('../../../src/plugman/util/metadata');
+var lazy_load = require('../../../src/cordova/lazy_load');
+var prepare = require('../../../src/cordova/prepare');
+var gitclone = require('../../../src/gitclone');
+var fail;
+
 describe('cordova/platform/addHelper', function () {
+var projectRoot = '/some/path';
+// These _mock and _revert_mock objects use rewire as the modules 
these mocks replace
+// during testing all return functions, which we cannot spy on using 
jasmine.
+// Thus, we replace these modules inside the scope of addHelper.js 
using rewire, and shim
+// in these _mock test dummies. The test dummies themselves are 
constructed using
+// jasmine.createSpy inside the first beforeEach.
+var cfg_parser_mock = function () {};
+var cfg_parser_revert_mock;
+var hooks_mock;
+var platform_api_mock;
+var fetch_mock;
+var fetch_revert_mock;
+var prepare_mock;
+var prepare_revert_mock;
+var fake_platform = {
+'platform': 'atari'
+};
+var package_json_mock;
+package_json_mock = jasmine.createSpyObj('package json mock', 
['cordova', 'dependencies']);
+package_json_mock.dependencies = {};
+package_json_mock.cordova = {};
+
+beforeEach(function () {
+hooks_mock = jasmine.createSpyObj('hooksRunner mock', ['fire']);
+hooks_mock.fire.and.returnValue(Q());
+cfg_parser_mock.prototype = jasmine.createSpyObj('config parser 
mock', ['write', 'removeEngine', 'addEngine', 'getHookScripts']);
+cfg_parser_revert_mock = 
platform_addHelper.__set__('ConfigParser', cfg_parser_mock);
+fetch_mock = jasmine.createSpy('fetch mock').and.returnValue(Q());
+fetch_revert_mock = platform_addHelper.__set__('fetch', 
fetch_mock);
+prepare_mock = jasmine.createSpy('prepare 
mock').and.returnValue(Q());
+prepare_mock.preparePlatforms = 
jasmine.createSpy('preparePlatforms mock').and.returnValue(Q());
+prepare_revert_mock = platform_addHelper.__set__('prepare', 
prepare_mock);
+spyOn(shell, 'mkdir');
+spyOn(fs, 'existsSync').and.returnValue(false);
+spyOn(fs, 'writeFileSync');
+spyOn(cordova_util, 
'projectConfig').and.returnValue(path.join(projectRoot, 'config.xml'));
+spyOn(cordova_util, 'isDirectory').and.returnValue(false);
+spyOn(cordova_util, 'fixRelativePath').and.callFake(function 
(input) { return input; });
+spyOn(cordova_util, 'isUrl').and.returnValue(false);
+spyOn(cordova_util, 'hostSupports').and.returnValue(true);
+spyOn(cordova_util, 'removePlatformPluginsJson');
+spyOn(cordova_config, 'read').and.returnValue({});
+spyOn(events, 'emit');
+// Fake platform details we will use for our mocks, returned by 
either
+// getPlatfromDetailsFromDir (in the local-directory case), or
+// downloadPlatform (in every other case)
+spyOn(platform_module, 
'getPlatformDetailsFromDir').and.returnValue(Q(fake_platform));
+spyOn(platform_addHelper, 
'downloadPlatform').and.returnValue(Q(fake_platform));
+spyOn(platform_addHelper, 
'getVersionFromConfigFile').and.returnValue(false);
+spyOn(platform_addHelper, 
'installPluginsForNewPlatform').and.returnValue(Q());
+platform_api_mock = jasmine.createSpyObj('platform api mock', 
['createPlatform', 'updatePlatform']);
+platform_api_mock.createPlatform.and.returnValue(Q());
+platform_api_mock.updatePlatform.and.returnValue(Q());
+spyOn(cordova_util, 
'getPlatformApiFunction'

[jira] [Commented] (CB-13017) Download with proxies

2017-07-12 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-13017?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16084178#comment-16084178
 ] 

ASF GitHub Bot commented on CB-13017:
-

GitHub user dracorlll opened a pull request:

https://github.com/apache/cordova-plugin-file-transfer/pull/184

CB-13017 (android) Added proxy option in download method



### Platforms affected
Android

### What does this PR do?
Download files with proxies

### What testing has been done on this change?
on Emulator and Sony Xperia phone it works

### Checklist
- [ ✓] [Reported an 
issue](http://cordova.apache.org/contribute/issues.html) in the JIRA database
- [ ✓] Commit message follows the format: "CB-3232: (android) Fix bug with 
resolving file paths", where CB- is the JIRA ID & "android" is the platform 
affected.
- [ ] Added automated test coverage as appropriate for this change.


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

$ git pull https://github.com/dracorlll/cordova-plugin-file-transfer master

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

https://github.com/apache/cordova-plugin-file-transfer/pull/184.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 #184


commit 2fabde3352ec21cda99d2295c598516f9dee8dbc
Author: Engin Yüksel 
Date:   2017-07-12T15:35:53Z

CB-13017 (android) Added proxy option in download method




> Download with proxies
> -
>
> Key: CB-13017
> URL: https://issues.apache.org/jira/browse/CB-13017
> Project: Apache Cordova
>  Issue Type: Improvement
>  Components: cordova-plugin-file-transfer
>Affects Versions: cordova@7.0.0
>Reporter: Engin Yüksel
>Priority: Minor
>  Labels: android
>
> This changes only affect android platform



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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



[jira] [Created] (CB-13017) Download with proxies

2017-07-12 Thread JIRA
Engin Yüksel created CB-13017:
-

 Summary: Download with proxies
 Key: CB-13017
 URL: https://issues.apache.org/jira/browse/CB-13017
 Project: Apache Cordova
  Issue Type: Improvement
  Components: cordova-plugin-file-transfer
Affects Versions: cordova@7.0.0
Reporter: Engin Yüksel
Priority: Minor


This changes only affect android platform



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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



[jira] [Updated] (CB-13017) Download with proxies

2017-07-12 Thread JIRA

 [ 
https://issues.apache.org/jira/browse/CB-13017?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Engin Yüksel updated CB-13017:
--
Labels: android  (was: )

> Download with proxies
> -
>
> Key: CB-13017
> URL: https://issues.apache.org/jira/browse/CB-13017
> Project: Apache Cordova
>  Issue Type: Improvement
>  Components: cordova-plugin-file-transfer
>Affects Versions: cordova@7.0.0
>Reporter: Engin Yüksel
>Priority: Minor
>  Labels: android
>
> This changes only affect android platform



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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



[jira] [Commented] (CB-12928) Windows UWP shared Local Folder being removed

2017-07-12 Thread Jan Piotrowski (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-12928?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16084083#comment-16084083
 ] 

Jan Piotrowski commented on CB-12928:
-

(Adding the whole plugin code to the first repo would make the reproduction for 
Cordova people a bit easier and more painless)

> Windows UWP shared Local Folder being removed
> -
>
> Key: CB-12928
> URL: https://issues.apache.org/jira/browse/CB-12928
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: cordova-windows
>Affects Versions: 6.5.0
> Environment: When running on a Windows 10 platform
>Reporter: Jon Hoffman
>Assignee: Jesse MacFadyen
>Priority: Critical
>  Labels: windows
>
> We are writing an application using Ionic 2 for Windows 10. The application 
> will need to share data between different users on the same machine therefore 
> we are using the shared local folder to save the data to as described in the 
> “Using Shared Local” section of this page: 
> https://blogs.windows.com/buildingapps/2016/05/24/sharing-your-local-app-data
> This method works great and we made changes to the Cordova-Sqlite-Storage 
> plugin so it will write the database file to the shared local folder. The 
> problem is when we update our application the shared local folder is removed 
> thereby erasing all of the saved data.
> I created a native C# application to see if we had the same behavior when we 
> updated a native application. When we updated the native app the shared local 
> folder was not removed therefore this is an issue specific to our hybrid 
> application.
> My first thought was maybe the Add-AppDevPackage.ps1 scripts were different 
> between the native and Ionic 2 application since that is the script that we 
> used to perform the installation and update. I ran a comparison tool to 
> compare the scripts from the Ionic2 and native applications however the two 
> files are exactly the same.
> I can also verify that the user local folder for the application is not 
> removed when we perform an update however that folder is specific to the 
> individual user and we can not share data from that folder. Does anyone know 
> why the shared local folder is removed when we perform an update of an Ionic 
> 2 application?
> I put a proof of concept application that simply writes a text file to the 
> shared local folder and the application local folder that can be used to see 
> how the shared local folder is removed when we update the app.  The 
> repository is located here: 
> https://github.com/hoffmanjon/Cordova_Windows_UWP_Shared_Local_Folder  and 
> includes a windows plugin to write to the shared local folder.  
> You will need to set a group policy to get the shared local folders working.  
> In the in the “Using Shared Local” section of this page: 
> https://blogs.windows.com/buildingapps/2016/05/24/sharing-your-local-app-data 
>  it describes how to change the policy and which one to change.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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



[jira] [Commented] (CB-13006) Move e2e create tests to unit tests

2017-07-12 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-13006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16084061#comment-16084061
 ] 

ASF subversion and git services commented on CB-13006:
--

Commit 5917d4ef0bd773fb54bc5b232e5ed95d3a073f8b in cordova-android's branch 
refs/heads/master from filmaj
[ https://git-wip-us.apache.org/repos/asf?p=cordova-android.git;h=5917d4e ]

CB-13006: removed create and update end-to-end tests, and instead added more 
unit test coverage. tweaked code coverage invocation so that we get coverage 
details on the create.js module. slight changes to the create.js module so that 
it is slightly easier to test.


> Move e2e create tests to unit tests
> ---
>
> Key: CB-13006
> URL: https://issues.apache.org/jira/browse/CB-13006
> Project: Apache Cordova
>  Issue Type: Improvement
>  Components: cordova-android
>Reporter: Filip Maj
>Assignee: Filip Maj
>
> Instead of having these tests shell out to create (and also compile!) the 
> cordova-android project, we should write up unit tests to ensure that the 
> functionality the tests are trying to cover (support for ascii/unicode/spaces 
> in project names).
> This would really speed up our testing.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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



[jira] [Commented] (CB-13006) Move e2e create tests to unit tests

2017-07-12 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-13006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16084062#comment-16084062
 ] 

ASF GitHub Bot commented on CB-13006:
-

Github user filmaj closed the pull request at:

https://github.com/apache/cordova-android/pull/394


> Move e2e create tests to unit tests
> ---
>
> Key: CB-13006
> URL: https://issues.apache.org/jira/browse/CB-13006
> Project: Apache Cordova
>  Issue Type: Improvement
>  Components: cordova-android
>Reporter: Filip Maj
>Assignee: Filip Maj
>
> Instead of having these tests shell out to create (and also compile!) the 
> cordova-android project, we should write up unit tests to ensure that the 
> functionality the tests are trying to cover (support for ascii/unicode/spaces 
> in project names).
> This would really speed up our testing.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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



[jira] [Resolved] (CB-13006) Move e2e create tests to unit tests

2017-07-12 Thread Filip Maj (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-13006?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Filip Maj resolved CB-13006.

Resolution: Fixed

> Move e2e create tests to unit tests
> ---
>
> Key: CB-13006
> URL: https://issues.apache.org/jira/browse/CB-13006
> Project: Apache Cordova
>  Issue Type: Improvement
>  Components: cordova-android
>Reporter: Filip Maj
>Assignee: Filip Maj
>
> Instead of having these tests shell out to create (and also compile!) the 
> cordova-android project, we should write up unit tests to ensure that the 
> functionality the tests are trying to cover (support for ascii/unicode/spaces 
> in project names).
> This would really speed up our testing.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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



[jira] [Commented] (CB-11784) Memory leak on iOS when opening and closing camera

2017-07-12 Thread Sander Knopper (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-11784?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16083844#comment-16083844
 ] 

Sander Knopper commented on CB-11784:
-

Just a quick note that we were also able to resolve the issue using the 
simplecam-cordova plugin.

One thing that might be interesting though is that we were having this issue 
while using uiwebview. A development version of our application, which is a 
complete rewrite, uses wkwebview and doesn't seem to suffer from this memory 
issue.

> Memory leak on iOS when opening and closing camera
> --
>
> Key: CB-11784
> URL: https://issues.apache.org/jira/browse/CB-11784
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: cordova-plugin-camera
>Affects Versions: 2.2.0
> Environment: Cordova CLI version 6.3.0
> cordova-plugin-camera 2.2.0
> cordova-ios 4.2.0
> iOS 9.3.5
> iPad Mini 1
>Reporter: Christopher McCabe
>
> When opening and closing the camera plugin without taking an image, the 
> memory allocated under 'Other Resources' grows without ever being cleaned up.
> Testing on an iPad mini 1, when I open and close the camera plugin without 
> taking a picture I can crash the app. This usually takes about 130-150 times 
> opening and closing the camera to cause a crash. The leak is present on newer 
> devices but the app is harder to crash due to the much larger device memory.
> Steps to reproduce:
> 1. create an app with the camera plugin
> 2. run the app on an iPad mini 1
> 3. open the camera plugin to take a picture, not from the gallery
> 4. click cancel
> 5. repeat 3 + 4 until the app crashes
> It appears that Jetsam kills the app for not being a good memory citizen.
> EDIT: I've tested this further and it appears on my iPad mini 3 as well 
> although it's harder to trigger. I've included a sample app that can be used 
> to view the problem
> https://github.com/modohash/cordova-camera-leak
> By clicking the 'trigger camera' button and then clicking cancel and 
> repeating the process you can see that while the app memory usage stays 
> steady, the other processes accumulate memory.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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



[jira] [Commented] (CB-12928) Windows UWP shared Local Folder being removed

2017-07-12 Thread Jon Hoffman (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-12928?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16083843#comment-16083843
 ] 

Jon Hoffman commented on CB-12928:
--

I created a separate repository for the plugin that contains all of the code 
for it:  
https://github.com/hoffmanjon/Cordova_Windows_UWP_Shared_Local_Folder_plugin
Please let me know if you need anything else.

> Windows UWP shared Local Folder being removed
> -
>
> Key: CB-12928
> URL: https://issues.apache.org/jira/browse/CB-12928
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: cordova-windows
>Affects Versions: 6.5.0
> Environment: When running on a Windows 10 platform
>Reporter: Jon Hoffman
>Assignee: Jesse MacFadyen
>Priority: Critical
>  Labels: windows
>
> We are writing an application using Ionic 2 for Windows 10. The application 
> will need to share data between different users on the same machine therefore 
> we are using the shared local folder to save the data to as described in the 
> “Using Shared Local” section of this page: 
> https://blogs.windows.com/buildingapps/2016/05/24/sharing-your-local-app-data
> This method works great and we made changes to the Cordova-Sqlite-Storage 
> plugin so it will write the database file to the shared local folder. The 
> problem is when we update our application the shared local folder is removed 
> thereby erasing all of the saved data.
> I created a native C# application to see if we had the same behavior when we 
> updated a native application. When we updated the native app the shared local 
> folder was not removed therefore this is an issue specific to our hybrid 
> application.
> My first thought was maybe the Add-AppDevPackage.ps1 scripts were different 
> between the native and Ionic 2 application since that is the script that we 
> used to perform the installation and update. I ran a comparison tool to 
> compare the scripts from the Ionic2 and native applications however the two 
> files are exactly the same.
> I can also verify that the user local folder for the application is not 
> removed when we perform an update however that folder is specific to the 
> individual user and we can not share data from that folder. Does anyone know 
> why the shared local folder is removed when we perform an update of an Ionic 
> 2 application?
> I put a proof of concept application that simply writes a text file to the 
> shared local folder and the application local folder that can be used to see 
> how the shared local folder is removed when we update the app.  The 
> repository is located here: 
> https://github.com/hoffmanjon/Cordova_Windows_UWP_Shared_Local_Folder  and 
> includes a windows plugin to write to the shared local folder.  
> You will need to set a group policy to get the shared local folders working.  
> In the in the “Using Shared Local” section of this page: 
> https://blogs.windows.com/buildingapps/2016/05/24/sharing-your-local-app-data 
>  it describes how to change the policy and which one to change.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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



[jira] [Closed] (CB-12983) The root detection logic used by Cordova framework is not applicable to API 26 and above

2017-07-12 Thread jcesarmobile (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-12983?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

jcesarmobile closed CB-12983.
-
Resolution: Not A Problem

This is not Cordova code, it's from a 3rd party plugin.
Please, report it on the plugin repo 
https://github.com/trykovyura/cordova-plugin-root-detection/issues

> The root detection logic used by Cordova framework is not applicable to API 
> 26 and above
> 
>
> Key: CB-12983
> URL: https://issues.apache.org/jira/browse/CB-12983
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: cordova-android
>Affects Versions: 6.1.1
> Environment: Android
>Reporter: Priyanka Bhinde
>Assignee: Joe Bowser
> Attachments: Cordova_root_detection_logic.png
>
>
> Cordova framework uses java script to handle most of the application feature. 
> One such feature is root detection. In this feature, the root detection logic 
> is not applicable to API 26 and above. 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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



[jira] [Commented] (CB-12940) Use deployment-target for platform version in Podfile

2017-07-12 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-12940?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16083769#comment-16083769
 ] 

ASF GitHub Bot commented on CB-12940:
-

GitHub user igormartsekha opened a pull request:

https://github.com/apache/cordova-ios/pull/326

CB-12940: [IOS] Use deployment-target from config.xml for platform ve…

…rsion in Podfile



### Platforms affected
IOS

### What does this PR do?
It's generate Podfile using `deployment-target` option from config.xml

### What testing has been done on this change?
I runed test but it failed, because API.js need valid path to config.xml 
file. So I changed test, and set up valid path.

### Checklist
- [x] [Reported an issue](http://cordova.apache.org/contribute/issues.html) 
in the JIRA database
- [x] Commit message follows the format: "CB-3232: (android) Fix bug with 
resolving file paths", where CB- is the JIRA ID & "android" is the platform 
affected.
- [x] Added automated test coverage as appropriate for this change.


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

$ git pull https://github.com/igormartsekha/cordova-ios master

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

https://github.com/apache/cordova-ios/pull/326.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 #326


commit 2997480a21f82198232dfa061f9a42c186996ed2
Author: Igor Martsekha 
Date:   2017-07-12T10:11:57Z

CB-12940: [IOS] Use deployment-target from config.xml for platform version 
in Podfile




> Use deployment-target for platform version in Podfile
> -
>
> Key: CB-12940
> URL: https://issues.apache.org/jira/browse/CB-12940
> Project: Apache Cordova
>  Issue Type: Improvement
>  Components: cordova-ios
>Affects Versions: cordova-ios@4.4.0
>Reporter: Todd Miller
>Assignee: Shazron Abdullah
> Fix For: cordova-ios@4.4.1
>
>
> The current Podfile.js script is hardcoded to set the platform ios version to 
> 8.0. However, there are some pods that require 9.0 or they will fail to 
> install. The deployment-target preference should be honored and used when 
> generating the Podfile.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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



[jira] [Commented] (CB-12940) Use deployment-target for platform version in Podfile

2017-07-12 Thread Igor Martsekha (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-12940?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16083767#comment-16083767
 ] 

Igor Martsekha commented on CB-12940:
-

Added PR: https://github.com/apache/cordova-ios/pull/326

> Use deployment-target for platform version in Podfile
> -
>
> Key: CB-12940
> URL: https://issues.apache.org/jira/browse/CB-12940
> Project: Apache Cordova
>  Issue Type: Improvement
>  Components: cordova-ios
>Affects Versions: cordova-ios@4.4.0
>Reporter: Todd Miller
>Assignee: Shazron Abdullah
> Fix For: cordova-ios@4.4.1
>
>
> The current Podfile.js script is hardcoded to set the platform ios version to 
> 8.0. However, there are some pods that require 9.0 or they will fail to 
> install. The deployment-target preference should be honored and used when 
> generating the Podfile.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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



[jira] [Commented] (CB-13008) Can't record audio

2017-07-12 Thread Mohammed MECHERI (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-13008?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16083677#comment-16083677
 ] 

Mohammed MECHERI commented on CB-13008:
---

Ok so i just changed the targeted android SDK to 22 and i don't have the 
exception when i request the permission, but i still have the exception when i 
start recording.

> Can't record audio
> --
>
> Key: CB-13008
> URL: https://issues.apache.org/jira/browse/CB-13008
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: cordova-android
>Reporter: Mohammed MECHERI
>
> So i have a hard time trying to record audio : 
> My Code :
> var my_media = new Media("toto.3gp",
>   ()=>onSuccess(),
>   (err)=>onError(err),
>   (status)=>mediaStatus(status)
> );
> console.log(my_media); // Media {id: 
> "07053344-6274-09eb-62ca-d63f099f2a4b", src: "toto.3gp", _duration: -1, 
> _position: -1}
> my_media.startRecord();
> console.log(my_media); // Media {id: 
> "07053344-6274-09eb-62ca-d63f099f2a4b", src: "toto.3gp", _duration: -1, 
> _position: -1}
> I made sure that the media object is correctly initialized and it is.
> on Android console i got this:
> 07-10 19:59:20.019 31861-31917/com.phonegap.reacthotloadingtemplate 
> E/MediaRecorder: start failed: -2147483648
> 07-10 19:59:20.019 31861-31917/com.phonegap.reacthotloadingtemplate 
> E/PluginManager: Uncaught exception from plugin
>   
>java.lang.RuntimeException: start failed.
>   
>at android.media.MediaRecorder.start(Native Method)
>   
>at 
> org.apache.cordova.media.AudioPlayer.startRecording(AudioPlayer.java:160)
>   
>at 
> org.apache.cordova.media.AudioHandler.startRecordingAudio(AudioHandler.java:287)
>   
>at 
> org.apache.cordova.media.AudioHandler.promptForRecord(AudioHandler.java:543)
>   
>at 
> org.apache.cordova.media.AudioHandler.execute(AudioHandler.java:118)
>   
>at 
> org.apache.cordova.CordovaPlugin.execute(CordovaPlugin.java:98)
>   
>at 
> org.apache.cordova.PluginManager.exec(PluginManager.java:132)
>   
>at 
> org.apache.cordova.CordovaBridge.jsExec(CordovaBridge.java:57)
>   
>at 
> org.apache.cordova.engine.SystemExposedJsApi.exec(SystemExposedJsApi.java:41)
>   
>at 
> org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method)
>   
>at 
> org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:39)
>   
>at android.os.Handler.dispatchMessage(Handler.java:102)
>   
>at android.os.Looper.loop(Looper.java:154)
>   
>at android.os.HandlerThread.run(HandlerThread.java:61)
> Media Permissions are correctly set by the plugin (Automatically):
>  
>  android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
> 
>  android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
> 
> So what do you think the problem is ?
>   [1]: https://github.com/apache/cordova-plugin-media



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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



[jira] [Created] (CB-13016) Hooks are not fired from "cordova run" command

2017-07-12 Thread Alejandro Liu (JIRA)
Alejandro Liu created CB-13016:
--

 Summary: Hooks are not fired from "cordova run" command
 Key: CB-13016
 URL: https://issues.apache.org/jira/browse/CB-13016
 Project: Apache Cordova
  Issue Type: Bug
  Components: cordova-cli
Affects Versions: 7.0.1
 Environment: I have only tested it on 7.0.1 using the Command Line 
Interface, under Linux.

Reporter: Alejandro Liu


I have created hooks in config.xml as this:








The scripts simply would print 'CORDOVA_HOOK' environment variable.

If I run: cordova run, that triggers the "build" process but this build process 
does not call the build or compile hooks.  Only the "prepare" hooks are called.

I think the build and/or compile hooks should be called.








--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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