Update to Cordova Android 7.1.2
This commit is contained in:
parent
9a02daa626
commit
dad8eed809
29 changed files with 240 additions and 227 deletions
|
@ -98,6 +98,6 @@
|
|||
<variable name="ANDROID_SUPPORT_VERSION" value="27.+" />
|
||||
</plugin>
|
||||
<plugin name="cordova-plugin-filepath" spec="^1.3.0" />
|
||||
<engine name="android" spec="7.1.0" />
|
||||
<plugin name="cordova-sqlite-storage" spec="2.5.1" />
|
||||
<engine name="android" spec="~7.1.2" />
|
||||
</widget>
|
||||
|
|
117
package-lock.json
generated
117
package-lock.json
generated
|
@ -2017,9 +2017,9 @@
|
|||
"integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU="
|
||||
},
|
||||
"com-darryncampbell-cordova-plugin-intent": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/com-darryncampbell-cordova-plugin-intent/-/com-darryncampbell-cordova-plugin-intent-1.1.0.tgz",
|
||||
"integrity": "sha512-KPyU4RlOl1ofliMSyHms3eyyzIAvRCEpGda5T8j3XXmYeU0YdLG7UeHat84eJWByjv8K7XhMbVu841DnipPrLg=="
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/com-darryncampbell-cordova-plugin-intent/-/com-darryncampbell-cordova-plugin-intent-1.1.1.tgz",
|
||||
"integrity": "sha512-h+V54+qCFY1h5csX8lAKTxBn5DdbP/8/sm7vS6X0WZPI+OTKycxeoJC+oGtPHhlvTh4gSEVW5/MkDqANRcmaug=="
|
||||
},
|
||||
"combined-stream": {
|
||||
"version": "1.0.6",
|
||||
|
@ -2139,17 +2139,40 @@
|
|||
"dev": true
|
||||
},
|
||||
"cordova-android": {
|
||||
"version": "7.1.0",
|
||||
"resolved": "http://registry.npmjs.org/cordova-android/-/cordova-android-7.1.0.tgz",
|
||||
"integrity": "sha1-HNNu57nRm61Q0+mEK3Mf5ZCSTdU=",
|
||||
"version": "7.1.2",
|
||||
"resolved": "https://registry.npmjs.org/cordova-android/-/cordova-android-7.1.2.tgz",
|
||||
"integrity": "sha512-w28HJGtfAZCT96hVH9BMppWMnmDTZplKu2NRQZN2dCr5e9r7aHpay41MYy9IBkh8+7E7lMo/jZkRwBDNr4VnEg==",
|
||||
"requires": {
|
||||
"abbrev": "1.1.1",
|
||||
"android-versions": "1.3.0",
|
||||
"cordova-common": "2.2.1",
|
||||
"ansi": "0.3.1",
|
||||
"balanced-match": "1.0.0",
|
||||
"base64-js": "1.2.0",
|
||||
"big-integer": "1.6.32",
|
||||
"bplist-parser": "0.1.1",
|
||||
"brace-expansion": "1.1.11",
|
||||
"concat-map": "0.0.1",
|
||||
"cordova-common": "2.2.5",
|
||||
"cordova-registry-mapper": "1.1.15",
|
||||
"elementtree": "0.1.6",
|
||||
"nopt": "3.0.6",
|
||||
"glob": "5.0.15",
|
||||
"inflight": "1.0.6",
|
||||
"inherits": "2.0.3",
|
||||
"minimatch": "3.0.4",
|
||||
"nopt": "3.0.1",
|
||||
"once": "1.4.0",
|
||||
"path-is-absolute": "1.0.1",
|
||||
"plist": "2.1.0",
|
||||
"properties-parser": "0.2.3",
|
||||
"q": "1.5.1",
|
||||
"shelljs": "0.5.3"
|
||||
"q": "1.4.1",
|
||||
"sax": "0.3.5",
|
||||
"semver": "5.5.0",
|
||||
"shelljs": "0.5.3",
|
||||
"underscore": "1.9.1",
|
||||
"unorm": "1.4.1",
|
||||
"wrappy": "1.0.2",
|
||||
"xmlbuilder": "8.2.2",
|
||||
"xmldom": "0.1.27"
|
||||
},
|
||||
"dependencies": {
|
||||
"abbrev": {
|
||||
|
@ -2172,18 +2195,18 @@
|
|||
"bundled": true
|
||||
},
|
||||
"base64-js": {
|
||||
"version": "0.0.8",
|
||||
"version": "1.2.0",
|
||||
"bundled": true
|
||||
},
|
||||
"big-integer": {
|
||||
"version": "1.6.26",
|
||||
"version": "1.6.32",
|
||||
"bundled": true
|
||||
},
|
||||
"bplist-parser": {
|
||||
"version": "0.1.1",
|
||||
"bundled": true,
|
||||
"requires": {
|
||||
"big-integer": "1.6.26"
|
||||
"big-integer": "1.6.32"
|
||||
}
|
||||
},
|
||||
"brace-expansion": {
|
||||
|
@ -2199,7 +2222,7 @@
|
|||
"bundled": true
|
||||
},
|
||||
"cordova-common": {
|
||||
"version": "2.2.1",
|
||||
"version": "2.2.5",
|
||||
"bundled": true,
|
||||
"requires": {
|
||||
"ansi": "0.3.1",
|
||||
|
@ -2208,12 +2231,10 @@
|
|||
"elementtree": "0.1.6",
|
||||
"glob": "5.0.15",
|
||||
"minimatch": "3.0.4",
|
||||
"osenv": "0.1.5",
|
||||
"plist": "1.2.0",
|
||||
"q": "1.5.1",
|
||||
"semver": "5.5.0",
|
||||
"plist": "2.1.0",
|
||||
"q": "1.4.1",
|
||||
"shelljs": "0.5.3",
|
||||
"underscore": "1.8.3",
|
||||
"underscore": "1.9.1",
|
||||
"unorm": "1.4.1"
|
||||
}
|
||||
},
|
||||
|
@ -2251,10 +2272,6 @@
|
|||
"version": "2.0.3",
|
||||
"bundled": true
|
||||
},
|
||||
"lodash": {
|
||||
"version": "3.10.1",
|
||||
"bundled": true
|
||||
},
|
||||
"minimatch": {
|
||||
"version": "3.0.4",
|
||||
"bundled": true,
|
||||
|
@ -2263,7 +2280,7 @@
|
|||
}
|
||||
},
|
||||
"nopt": {
|
||||
"version": "3.0.6",
|
||||
"version": "3.0.1",
|
||||
"bundled": true,
|
||||
"requires": {
|
||||
"abbrev": "1.1.1"
|
||||
|
@ -2276,33 +2293,16 @@
|
|||
"wrappy": "1.0.2"
|
||||
}
|
||||
},
|
||||
"os-homedir": {
|
||||
"version": "1.0.2",
|
||||
"bundled": true
|
||||
},
|
||||
"os-tmpdir": {
|
||||
"version": "1.0.2",
|
||||
"bundled": true
|
||||
},
|
||||
"osenv": {
|
||||
"version": "0.1.5",
|
||||
"bundled": true,
|
||||
"requires": {
|
||||
"os-homedir": "1.0.2",
|
||||
"os-tmpdir": "1.0.2"
|
||||
}
|
||||
},
|
||||
"path-is-absolute": {
|
||||
"version": "1.0.1",
|
||||
"bundled": true
|
||||
},
|
||||
"plist": {
|
||||
"version": "1.2.0",
|
||||
"version": "2.1.0",
|
||||
"bundled": true,
|
||||
"requires": {
|
||||
"base64-js": "0.0.8",
|
||||
"util-deprecate": "1.0.2",
|
||||
"xmlbuilder": "4.0.0",
|
||||
"base64-js": "1.2.0",
|
||||
"xmlbuilder": "8.2.2",
|
||||
"xmldom": "0.1.27"
|
||||
}
|
||||
},
|
||||
|
@ -2311,7 +2311,7 @@
|
|||
"bundled": true
|
||||
},
|
||||
"q": {
|
||||
"version": "1.5.1",
|
||||
"version": "1.4.1",
|
||||
"bundled": true
|
||||
},
|
||||
"sax": {
|
||||
|
@ -2327,27 +2327,20 @@
|
|||
"bundled": true
|
||||
},
|
||||
"underscore": {
|
||||
"version": "1.8.3",
|
||||
"version": "1.9.1",
|
||||
"bundled": true
|
||||
},
|
||||
"unorm": {
|
||||
"version": "1.4.1",
|
||||
"bundled": true
|
||||
},
|
||||
"util-deprecate": {
|
||||
"version": "1.0.2",
|
||||
"bundled": true
|
||||
},
|
||||
"wrappy": {
|
||||
"version": "1.0.2",
|
||||
"bundled": true
|
||||
},
|
||||
"xmlbuilder": {
|
||||
"version": "4.0.0",
|
||||
"bundled": true,
|
||||
"requires": {
|
||||
"lodash": "3.10.1"
|
||||
}
|
||||
"version": "8.2.2",
|
||||
"bundled": true
|
||||
},
|
||||
"xmldom": {
|
||||
"version": "0.1.27",
|
||||
|
@ -2356,11 +2349,19 @@
|
|||
}
|
||||
},
|
||||
"cordova-android-support-gradle-release": {
|
||||
"version": "1.4.4",
|
||||
"resolved": "https://registry.npmjs.org/cordova-android-support-gradle-release/-/cordova-android-support-gradle-release-1.4.4.tgz",
|
||||
"integrity": "sha512-DOwZ+MX0CBoagXV6cHqfQacVjsrDea8z2wuM427AIvi2eAFvojw85o1XMCdJ4kSDMbsUUaNPw12h7uY0m+rcvg==",
|
||||
"version": "1.4.7",
|
||||
"resolved": "https://registry.npmjs.org/cordova-android-support-gradle-release/-/cordova-android-support-gradle-release-1.4.7.tgz",
|
||||
"integrity": "sha512-3hDS3mBjSAEzKM4gZBze8G02/aNQgcww1CyUneuYPOYvleTPk3Q4OYkjmHHuE4FEgr4v9EY6j6bJqoX9pMZHgg==",
|
||||
"requires": {
|
||||
"semver": "5.1.0",
|
||||
"xml2js": "0.4.19"
|
||||
},
|
||||
"dependencies": {
|
||||
"semver": {
|
||||
"version": "5.1.0",
|
||||
"resolved": "http://registry.npmjs.org/semver/-/semver-5.1.0.tgz",
|
||||
"integrity": "sha1-hfLPhVBGXE3wAM99hvawVBBqueU="
|
||||
}
|
||||
}
|
||||
},
|
||||
"cordova-plugin-device": {
|
||||
|
|
|
@ -29,9 +29,9 @@
|
|||
"@ionic-native/splash-screen": "4.9.0",
|
||||
"@ionic-native/status-bar": "4.9.0",
|
||||
"@ionic/storage": "2.1.3",
|
||||
"com-darryncampbell-cordova-plugin-intent": "^1.1.0",
|
||||
"cordova-android": "7.1.0",
|
||||
"cordova-android-support-gradle-release": "^1.4.4",
|
||||
"com-darryncampbell-cordova-plugin-intent": "^1.1.1",
|
||||
"cordova-android": "7.1.2",
|
||||
"cordova-android-support-gradle-release": "^1.4.7",
|
||||
"cordova-plugin-device": "^2.0.2",
|
||||
"cordova-plugin-file": "^6.0.1",
|
||||
"cordova-plugin-file-transfer": "^1.7.1",
|
||||
|
@ -42,7 +42,7 @@
|
|||
"cordova-plugin-splashscreen": "^5.0.2",
|
||||
"cordova-plugin-telerik-imagepicker": "^2.1.8",
|
||||
"cordova-plugin-whitelist": "^1.3.3",
|
||||
"cordova-sqlite-storage": "2.5.1",
|
||||
"cordova-sqlite-storage": "^2.5.1",
|
||||
"ionic-angular": "3.9.2",
|
||||
"ionicons": "4.2.4",
|
||||
"moment": "^2.18.1",
|
||||
|
|
|
@ -24,10 +24,10 @@ ext {
|
|||
|
||||
buildscript {
|
||||
repositories {
|
||||
jcenter()
|
||||
maven {
|
||||
url "https://maven.google.com"
|
||||
}
|
||||
jcenter()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
@ -42,7 +42,7 @@ apply plugin: 'com.github.dcendents.android-maven'
|
|||
apply plugin: 'com.jfrog.bintray'
|
||||
|
||||
group = 'org.apache.cordova'
|
||||
version = '7.1.0'
|
||||
version = '7.1.2'
|
||||
|
||||
android {
|
||||
compileSdkVersion cdvCompileSdkVersion
|
||||
|
@ -129,9 +129,9 @@ bintray {
|
|||
licenses = ['Apache-2.0']
|
||||
labels = ['android', 'cordova', 'phonegap']
|
||||
version {
|
||||
name = '7.1.0'
|
||||
name = '7.1.2'
|
||||
released = new Date()
|
||||
vcsTag = '7.1.0'
|
||||
vcsTag = '7.1.2'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -263,6 +263,7 @@ public class CordovaResourceApi {
|
|||
} catch (FileNotFoundException e) {
|
||||
// Will occur if the file is compressed.
|
||||
inputStream = assetManager.open(assetPath);
|
||||
length = inputStream.available();
|
||||
}
|
||||
String mimeType = getMimeTypeFromPath(assetPath);
|
||||
return new OpenForReadResult(uri, inputStream, mimeType, length, assetFd);
|
||||
|
|
|
@ -31,7 +31,7 @@ import android.webkit.WebChromeClient.CustomViewCallback;
|
|||
* are not expected to implement it.
|
||||
*/
|
||||
public interface CordovaWebView {
|
||||
public static final String CORDOVA_VERSION = "7.1.0";
|
||||
public static final String CORDOVA_VERSION = "7.1.2";
|
||||
|
||||
void init(CordovaInterface cordova, List<PluginEntry> pluginEntries, CordovaPreferences preferences);
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@
|
|||
],
|
||||
"/manifest/application": [
|
||||
{
|
||||
"xml": "<provider android:authorities=\"${applicationId}.provider\" android:exported=\"false\" android:grantUriPermissions=\"true\" android:name=\"android.support.v4.content.FileProvider\"><meta-data android:name=\"android.support.FILE_PROVIDER_PATHS\" android:resource=\"@xml/provider_paths\" /></provider>",
|
||||
"xml": "<provider android:authorities=\"${applicationId}.darryncampbell.cordova.plugin.intent.fileprovider\" android:exported=\"false\" android:grantUriPermissions=\"true\" android:name=\"android.support.v4.content.FileProvider\"><meta-data android:name=\"android.support.FILE_PROVIDER_PATHS\" android:resource=\"@xml/provider_paths\" /></provider>",
|
||||
"count": 1
|
||||
}
|
||||
]
|
||||
|
@ -406,12 +406,12 @@
|
|||
"cordova-plugin-share-content": "1.0.0",
|
||||
"cordova-plugin-file": "6.0.1",
|
||||
"cordova-plugin-file-transfer": "1.7.1",
|
||||
"com-darryncampbell-cordova-plugin-intent": "1.1.0",
|
||||
"com-darryncampbell-cordova-plugin-intent": "1.1.1",
|
||||
"cordova-plugin-inappbrowser": "3.0.0",
|
||||
"cordova-plugin-whitelist": "1.3.3",
|
||||
"cordova-plugin-splashscreen": "5.0.2",
|
||||
"cordova-plugin-device": "2.0.2",
|
||||
"cordova-android-support-gradle-release": "1.4.4",
|
||||
"cordova-android-support-gradle-release": "1.4.7",
|
||||
"cordova-plugin-filepath": "1.4.2",
|
||||
"cordova-sqlite-storage": "2.5.1"
|
||||
}
|
||||
|
|
|
@ -22,10 +22,10 @@ apply plugin: 'com.android.application'
|
|||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
jcenter()
|
||||
maven {
|
||||
url "https://maven.google.com"
|
||||
}
|
||||
jcenter()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
@ -91,7 +91,6 @@ ext {
|
|||
}
|
||||
|
||||
// PLUGIN GRADLE EXTENSIONS START
|
||||
apply from: "../cordova-android-support-gradle-release/goober_m-cordova-android-support-gradle-release.gradle"
|
||||
// PLUGIN GRADLE EXTENSIONS END
|
||||
|
||||
def hasBuildExtras = file('build-extras.gradle').exists()
|
||||
|
@ -260,9 +259,9 @@ dependencies {
|
|||
implementation fileTree(dir: 'libs', include: '*.jar')
|
||||
// SUB-PROJECT DEPENDENCIES START
|
||||
implementation(project(path: ":CordovaLib"))
|
||||
compile "com.android.support:support-v4:27.1.0"
|
||||
compile "com.android.support:support-v4:25.+"
|
||||
compile "com.android.support:appcompat-v7:25.+"
|
||||
compile "com.android.support:support-v4:27.+"
|
||||
compile "com.android.support:support-v4:27.+"
|
||||
compile "com.android.support:appcompat-v7:27.+"
|
||||
// SUB-PROJECT DEPENDENCIES END
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<provider android:authorities="${applicationId}.provider" android:exported="false" android:grantUriPermissions="true" android:name="android.support.v4.content.FileProvider">
|
||||
<provider android:authorities="${applicationId}.darryncampbell.cordova.plugin.intent.fileprovider" android:exported="false" android:grantUriPermissions="true" android:name="android.support.v4.content.FileProvider">
|
||||
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/provider_paths" />
|
||||
</provider>
|
||||
</application>
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
repositories{
|
||||
// Google APIs are now hosted at Maven
|
||||
maven {
|
||||
url 'https://maven.google.com'
|
||||
}
|
||||
}
|
||||
|
||||
def PLUGIN_NAME = "cordova-android-support-gradle-release"
|
||||
|
||||
// Fetch ANDROID_SUPPORT_VERSION var from properties.gradle
|
||||
apply from: PLUGIN_NAME + '/properties.gradle'
|
||||
|
||||
// List of libs to search for.
|
||||
def LIBS = [
|
||||
'com.android.support'
|
||||
]
|
||||
|
||||
def IGNORED = [
|
||||
'multidex',
|
||||
'multidex-instrumentation'
|
||||
]
|
||||
|
||||
println("+-----------------------------------------------------------------");
|
||||
println("| " + PLUGIN_NAME + ": " + ANDROID_SUPPORT_VERSION);
|
||||
println("+-----------------------------------------------------------------");
|
||||
|
||||
configurations.all {
|
||||
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
|
||||
if (details.requested.group in LIBS && !(details.requested.name in IGNORED)) { details.useVersion ANDROID_SUPPORT_VERSION }
|
||||
}
|
||||
}
|
|
@ -250,8 +250,15 @@ public class IntentShim extends CordovaPlugin {
|
|||
JSONArray extraNames = extras.names();
|
||||
for (int i = 0; i < extraNames.length(); i++) {
|
||||
String key = extraNames.getString(i);
|
||||
String value = extras.getString(key);
|
||||
result.putExtra(key, value);
|
||||
Object extrasObj = extras.get(key);
|
||||
if (extrasObj instanceof JSONObject) {
|
||||
// The extra is a bundle
|
||||
Bundle bundle = toBundle((JSONObject) extras.get(key));
|
||||
result.putExtra(key, bundle);
|
||||
} else {
|
||||
String value = extras.getString(key);
|
||||
result.putExtra(key, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -309,7 +316,7 @@ public class IntentShim extends CordovaPlugin {
|
|||
callbackContext.error("File not found: " + uriAsFile.toString());
|
||||
return null;
|
||||
}
|
||||
String PACKAGE_NAME = this.cordova.getActivity().getPackageName() + ".provider";
|
||||
String PACKAGE_NAME = this.cordova.getActivity().getPackageName() + ".darryncampbell.cordova.plugin.intent.fileprovider";
|
||||
Uri uri = FileProvider.getUriForFile(this.cordova.getActivity().getApplicationContext(), PACKAGE_NAME, uriAsFile);
|
||||
return uri;
|
||||
}
|
||||
|
@ -607,7 +614,7 @@ public class IntentShim extends CordovaPlugin {
|
|||
|
||||
/**
|
||||
* Sends the provided Intent to the onNewIntentCallbackContext.
|
||||
*
|
||||
*
|
||||
* @param intent This is the intent to send to the JS layer.
|
||||
*/
|
||||
private void fireOnNewIntent(Intent intent) {
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
<name>Goober</name>
|
||||
<description>Goober, a mobile app for pnut.io</description>
|
||||
<author email="gilag@monkeystew.com" href="https://monkeystew.org">Morgan McMillian</author>
|
||||
<content original-src="index.html" src="http://192.168.1.72:8100" />
|
||||
<content src="index.html" />
|
||||
<access origin="*" />
|
||||
<allow-navigation href="http://ionic.local/*" />
|
||||
<allow-intent href="http://*/*" />
|
||||
|
@ -52,7 +52,6 @@
|
|||
<allow-intent href="mailto:*" />
|
||||
<allow-intent href="geo:*" />
|
||||
<allow-navigation href="http://10.0.0.212:8100" />
|
||||
<allow-navigation href="http://192.168.1.72:8100" />
|
||||
<allow-intent href="market:*" />
|
||||
<icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" />
|
||||
<icon density="mdpi" src="resources/android/icon/drawable-mdpi-icon.png" />
|
||||
|
|
|
@ -20,10 +20,10 @@
|
|||
|
||||
buildscript {
|
||||
repositories {
|
||||
jcenter()
|
||||
maven {
|
||||
url "https://maven.google.com"
|
||||
}
|
||||
jcenter()
|
||||
}
|
||||
dependencies {
|
||||
|
||||
|
@ -35,10 +35,10 @@ buildscript {
|
|||
|
||||
allprojects {
|
||||
repositories {
|
||||
jcenter()
|
||||
maven {
|
||||
url "https://maven.google.com"
|
||||
}
|
||||
jcenter()
|
||||
}
|
||||
//This replaces project.properties w.r.t. build settings
|
||||
project.ext {
|
||||
|
|
2
platforms/android/cordova/Api.js
vendored
2
platforms/android/cordova/Api.js
vendored
|
@ -248,7 +248,7 @@ Api.prototype.addPlugin = function (plugin, installOptions) {
|
|||
}).then(function () {
|
||||
if (plugin.getFrameworks(this.platform).length === 0) return;
|
||||
selfEvents.emit('verbose', 'Updating build files since android plugin contained <framework>');
|
||||
// This should pick the correct builder, not just get gradle
|
||||
// This should pick the correct builder, not just get gradle
|
||||
require('./lib/builders/builders').getBuilder(this.builder).prepBuildFiles();
|
||||
}.bind(this))
|
||||
// CB-11022 Return truthy value to prevent running prepare after
|
||||
|
|
33
platforms/android/cordova/lib/AndroidStudio.js
vendored
33
platforms/android/cordova/lib/AndroidStudio.js
vendored
|
@ -6,37 +6,6 @@
|
|||
|
||||
/* jshint esnext: false */
|
||||
|
||||
var path = require('path');
|
||||
var fs = require('fs');
|
||||
var CordovaError = require('cordova-common').CordovaError;
|
||||
|
||||
module.exports.isAndroidStudioProject = function isAndroidStudioProject (root) {
|
||||
var eclipseFiles = ['AndroidManifest.xml', 'libs', 'res'];
|
||||
var androidStudioFiles = ['app', 'app/src/main'];
|
||||
|
||||
// assume it is an AS project and not an Eclipse project
|
||||
var isEclipse = false;
|
||||
var isAS = true;
|
||||
|
||||
if (!fs.existsSync(root)) {
|
||||
throw new CordovaError('AndroidStudio.js:inAndroidStudioProject root does not exist: ' + root);
|
||||
}
|
||||
|
||||
// if any of the following exists, then we are not an ASProj
|
||||
eclipseFiles.forEach(function (file) {
|
||||
if (fs.existsSync(path.join(root, file))) {
|
||||
isEclipse = true;
|
||||
}
|
||||
});
|
||||
|
||||
// if it is NOT an eclipse project, check that all required files exist
|
||||
if (!isEclipse) {
|
||||
androidStudioFiles.forEach(function (file) {
|
||||
if (!fs.existsSync(path.join(root, file))) {
|
||||
console.log('missing file :: ' + file);
|
||||
isAS = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
return (!isEclipse && isAS);
|
||||
return true;
|
||||
};
|
||||
|
|
|
@ -24,6 +24,7 @@ var path = require('path');
|
|||
var shell = require('shelljs');
|
||||
var superspawn = require('cordova-common').superspawn;
|
||||
var CordovaError = require('cordova-common').CordovaError;
|
||||
var events = require('cordova-common').events;
|
||||
var check_reqs = require('../check_reqs');
|
||||
|
||||
var GenericBuilder = require('./GenericBuilder');
|
||||
|
@ -178,7 +179,7 @@ GradleBuilder.prototype.prepBuildFiles = function () {
|
|||
};
|
||||
|
||||
subProjects.forEach(function (p) {
|
||||
console.log('Subproject Path: ' + p);
|
||||
events.emit('log', 'Subproject Path: ' + p);
|
||||
var libName = p.replace(/[/\\]/g, ':').replace(name + '-', '');
|
||||
depsList += ' implementation(project(path: "' + libName + '"))';
|
||||
insertExclude(p);
|
||||
|
|
|
@ -23,6 +23,7 @@ var util = require('util');
|
|||
var path = require('path');
|
||||
var shell = require('shelljs');
|
||||
var spawn = require('cordova-common').superspawn.spawn;
|
||||
var events = require('cordova-common').events;
|
||||
var CordovaError = require('cordova-common').CordovaError;
|
||||
var check_reqs = require('../check_reqs');
|
||||
|
||||
|
@ -167,7 +168,7 @@ StudioBuilder.prototype.prepBuildFiles = function () {
|
|||
}
|
||||
};
|
||||
subProjects.forEach(function (p) {
|
||||
console.log('Subproject Path: ' + p);
|
||||
events.emit('log', 'Subproject Path: ' + p);
|
||||
var libName = p.replace(/[/\\]/g, ':').replace(name + '-', '');
|
||||
if (libName !== 'app') {
|
||||
depsList += ' implementation(project(path: ":' + libName + '"))';
|
||||
|
@ -214,28 +215,28 @@ StudioBuilder.prototype.prepBuildFiles = function () {
|
|||
StudioBuilder.prototype.prepEnv = function (opts) {
|
||||
var self = this;
|
||||
return check_reqs.check_gradle()
|
||||
.then(function (gradlePath) {
|
||||
return self.runGradleWrapper(gradlePath);
|
||||
}).then(function () {
|
||||
return self.prepBuildFiles();
|
||||
}).then(function () {
|
||||
// If the gradle distribution URL is set, make sure it points to version we want.
|
||||
// If it's not set, do nothing, assuming that we're using a future version of gradle that we don't want to mess with.
|
||||
// For some reason, using ^ and $ don't work. This does the job, though.
|
||||
var distributionUrlRegex = /distributionUrl.*zip/;
|
||||
var distributionUrl = process.env['CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL'] || 'https\\://services.gradle.org/distributions/gradle-4.1-all.zip';
|
||||
var gradleWrapperPropertiesPath = path.join(self.root, 'gradle', 'wrapper', 'gradle-wrapper.properties');
|
||||
shell.chmod('u+w', gradleWrapperPropertiesPath);
|
||||
shell.sed('-i', distributionUrlRegex, 'distributionUrl=' + distributionUrl, gradleWrapperPropertiesPath);
|
||||
.then(function (gradlePath) {
|
||||
return self.runGradleWrapper(gradlePath);
|
||||
}).then(function () {
|
||||
return self.prepBuildFiles();
|
||||
}).then(function () {
|
||||
// If the gradle distribution URL is set, make sure it points to version we want.
|
||||
// If it's not set, do nothing, assuming that we're using a future version of gradle that we don't want to mess with.
|
||||
// For some reason, using ^ and $ don't work. This does the job, though.
|
||||
var distributionUrlRegex = /distributionUrl.*zip/;
|
||||
var distributionUrl = process.env['CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL'] || 'https\\://services.gradle.org/distributions/gradle-4.1-all.zip';
|
||||
var gradleWrapperPropertiesPath = path.join(self.root, 'gradle', 'wrapper', 'gradle-wrapper.properties');
|
||||
shell.chmod('u+w', gradleWrapperPropertiesPath);
|
||||
shell.sed('-i', distributionUrlRegex, 'distributionUrl=' + distributionUrl, gradleWrapperPropertiesPath);
|
||||
|
||||
var propertiesFile = opts.buildType + SIGNING_PROPERTIES;
|
||||
var propertiesFilePath = path.join(self.root, propertiesFile);
|
||||
if (opts.packageInfo) {
|
||||
fs.writeFileSync(propertiesFilePath, TEMPLATE + opts.packageInfo.toProperties());
|
||||
} else if (isAutoGenerated(propertiesFilePath)) {
|
||||
shell.rm('-f', propertiesFilePath);
|
||||
}
|
||||
});
|
||||
var propertiesFile = opts.buildType + SIGNING_PROPERTIES;
|
||||
var propertiesFilePath = path.join(self.root, propertiesFile);
|
||||
if (opts.packageInfo) {
|
||||
fs.writeFileSync(propertiesFilePath, TEMPLATE + opts.packageInfo.toProperties());
|
||||
} else if (isAutoGenerated(propertiesFilePath)) {
|
||||
shell.rm('-f', propertiesFilePath);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -247,33 +248,33 @@ StudioBuilder.prototype.build = function (opts) {
|
|||
var args = this.getArgs(opts.buildType === 'debug' ? 'debug' : 'release', opts);
|
||||
|
||||
return spawn(wrapper, args, {stdio: 'pipe'})
|
||||
.progress(function (stdio) {
|
||||
if (stdio.stderr) {
|
||||
/*
|
||||
* Workaround for the issue with Java printing some unwanted information to
|
||||
* stderr instead of stdout.
|
||||
* This function suppresses 'Picked up _JAVA_OPTIONS' message from being
|
||||
* printed to stderr. See https://issues.apache.org/jira/browse/CB-9971 for
|
||||
* explanation.
|
||||
*/
|
||||
var suppressThisLine = /^Picked up _JAVA_OPTIONS: /i.test(stdio.stderr.toString());
|
||||
if (suppressThisLine) {
|
||||
return;
|
||||
.progress(function (stdio) {
|
||||
if (stdio.stderr) {
|
||||
/*
|
||||
* Workaround for the issue with Java printing some unwanted information to
|
||||
* stderr instead of stdout.
|
||||
* This function suppresses 'Picked up _JAVA_OPTIONS' message from being
|
||||
* printed to stderr. See https://issues.apache.org/jira/browse/CB-9971 for
|
||||
* explanation.
|
||||
*/
|
||||
var suppressThisLine = /^Picked up _JAVA_OPTIONS: /i.test(stdio.stderr.toString());
|
||||
if (suppressThisLine) {
|
||||
return;
|
||||
}
|
||||
process.stderr.write(stdio.stderr);
|
||||
} else {
|
||||
process.stdout.write(stdio.stdout);
|
||||
}
|
||||
process.stderr.write(stdio.stderr);
|
||||
} else {
|
||||
process.stdout.write(stdio.stdout);
|
||||
}
|
||||
}).catch(function (error) {
|
||||
if (error.toString().indexOf('failed to find target with hash string') >= 0) {
|
||||
return check_reqs.check_android_target(error).then(function () {
|
||||
// If due to some odd reason - check_android_target succeeds
|
||||
// we should still fail here.
|
||||
return Q.reject(error);
|
||||
});
|
||||
}
|
||||
return Q.reject(error);
|
||||
});
|
||||
}).catch(function (error) {
|
||||
if (error.toString().indexOf('failed to find target with hash string') >= 0) {
|
||||
return check_reqs.check_android_target(error).then(function () {
|
||||
// If due to some odd reason - check_android_target succeeds
|
||||
// we should still fail here.
|
||||
return Q.reject(error);
|
||||
});
|
||||
}
|
||||
return Q.reject(error);
|
||||
});
|
||||
};
|
||||
|
||||
StudioBuilder.prototype.clean = function (opts) {
|
||||
|
@ -283,16 +284,16 @@ StudioBuilder.prototype.clean = function (opts) {
|
|||
return Q().then(function () {
|
||||
return spawn(wrapper, args, {stdio: 'inherit'});
|
||||
})
|
||||
.then(function () {
|
||||
shell.rm('-rf', path.join(builder.root, 'out'));
|
||||
.then(function () {
|
||||
shell.rm('-rf', path.join(builder.root, 'out'));
|
||||
|
||||
['debug', 'release'].forEach(function (config) {
|
||||
var propertiesFilePath = path.join(builder.root, config + SIGNING_PROPERTIES);
|
||||
if (isAutoGenerated(propertiesFilePath)) {
|
||||
shell.rm('-f', propertiesFilePath);
|
||||
}
|
||||
['debug', 'release'].forEach(function (config) {
|
||||
var propertiesFilePath = path.join(builder.root, config + SIGNING_PROPERTIES);
|
||||
if (isAutoGenerated(propertiesFilePath)) {
|
||||
shell.rm('-f', propertiesFilePath);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
module.exports = StudioBuilder;
|
||||
|
|
44
platforms/android/cordova/lib/check_reqs.js
vendored
44
platforms/android/cordova/lib/check_reqs.js
vendored
|
@ -41,17 +41,6 @@ function forgivingWhichSync (cmd) {
|
|||
}
|
||||
}
|
||||
|
||||
function tryCommand (cmd, errMsg, catchStderr) {
|
||||
var d = Q.defer();
|
||||
child_process.exec(cmd, function (err, stdout, stderr) {
|
||||
if (err) d.reject(new CordovaError(errMsg));
|
||||
// Sometimes it is necessary to return an stderr instead of stdout in case of success, since
|
||||
// some commands prints theirs output to stderr instead of stdout. 'javac' is the example
|
||||
else d.resolve((catchStderr ? stderr : stdout).trim());
|
||||
});
|
||||
return d.promise;
|
||||
}
|
||||
|
||||
module.exports.isWindows = function () {
|
||||
return (os.platform() === 'win32');
|
||||
};
|
||||
|
@ -207,19 +196,22 @@ module.exports.check_java = function () {
|
|||
}
|
||||
}
|
||||
}).then(function () {
|
||||
var msg =
|
||||
'Failed to run "javac -version", make sure that you have a JDK installed.\n' +
|
||||
'You can get it from: http://www.oracle.com/technetwork/java/javase/downloads.\n';
|
||||
if (process.env['JAVA_HOME']) {
|
||||
msg += 'Your JAVA_HOME is invalid: ' + process.env['JAVA_HOME'] + '\n';
|
||||
}
|
||||
// We use tryCommand with catchStderr = true, because
|
||||
// javac writes version info to stderr instead of stdout
|
||||
return tryCommand('javac -version', msg, true).then(function (output) {
|
||||
// Let's check for at least Java 8, and keep it future proof so we can support Java 10
|
||||
var match = /javac ((?:1\.)(?:[8-9]\.)(?:\d+))|((?:1\.)(?:[1-9]\d+\.)(?:\d+))/i.exec(output);
|
||||
return match && match[1];
|
||||
});
|
||||
return Q.denodeify(child_process.exec)('javac -version')
|
||||
.then(outputs => {
|
||||
// outputs contains two entries: stdout and stderr
|
||||
// Java <= 8 writes version info to stderr, Java >= 9 to stdout
|
||||
const output = outputs.join('').trim();
|
||||
const match = /javac\s+([\d.]+)/i.exec(output);
|
||||
return match && match[1];
|
||||
}, () => {
|
||||
var msg =
|
||||
'Failed to run "javac -version", make sure that you have a JDK installed.\n' +
|
||||
'You can get it from: http://www.oracle.com/technetwork/java/javase/downloads.\n';
|
||||
if (process.env['JAVA_HOME']) {
|
||||
msg += 'Your JAVA_HOME is invalid: ' + process.env['JAVA_HOME'] + '\n';
|
||||
}
|
||||
throw new CordovaError(msg);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -366,8 +358,8 @@ module.exports.run = function () {
|
|||
console.log('ANDROID_HOME=' + process.env['ANDROID_HOME']);
|
||||
console.log('JAVA_HOME=' + process.env['JAVA_HOME']);
|
||||
|
||||
if (!values[0]) {
|
||||
throw new CordovaError('Requirements check failed for JDK 1.8 or greater');
|
||||
if (!String(values[0]).startsWith('1.8.')) {
|
||||
throw new CordovaError('Requirements check failed for JDK 1.8');
|
||||
}
|
||||
|
||||
if (!values[1]) {
|
||||
|
|
3
platforms/android/cordova/lib/emulator.js
vendored
3
platforms/android/cordova/lib/emulator.js
vendored
|
@ -344,7 +344,8 @@ module.exports.wait_for_emulator = function (port) {
|
|||
}, function (error) {
|
||||
if ((error && error.message &&
|
||||
(error.message.indexOf('not found') > -1)) ||
|
||||
(error.message.indexOf('device offline') > -1)) {
|
||||
(error.message.indexOf('device offline') > -1) ||
|
||||
(error.message.indexOf('device still connecting') > -1)) {
|
||||
// emulator not yet started, continue waiting
|
||||
return self.wait_for_emulator(port);
|
||||
} else {
|
||||
|
|
|
@ -20,10 +20,10 @@
|
|||
|
||||
buildscript {
|
||||
repositories {
|
||||
jcenter()
|
||||
maven {
|
||||
url "https://maven.google.com"
|
||||
}
|
||||
jcenter()
|
||||
}
|
||||
|
||||
// Switch the Android Gradle plugin version requirement depending on the
|
||||
|
|
33
platforms/android/cordova/lib/pluginHandlers.js
vendored
33
platforms/android/cordova/lib/pluginHandlers.js
vendored
|
@ -34,15 +34,7 @@ var handlers = {
|
|||
// a later plugins release. This is for legacy plugins to work with Cordova.
|
||||
|
||||
if (options && options.android_studio === true) {
|
||||
// If a Java file is using the new directory structure, don't penalize it
|
||||
if (!obj.targetDir.includes('app/src/main')) {
|
||||
if (obj.src.endsWith('.java')) {
|
||||
dest = path.join('app/src/main/java', obj.targetDir.substring(4), path.basename(obj.src));
|
||||
} else if (obj.src.endsWith('.xml')) {
|
||||
// We are making a huge assumption here that XML files will be going to res/xml or values/xml
|
||||
dest = path.join('app/src/main', obj.targetDir, path.basename(obj.src));
|
||||
}
|
||||
}
|
||||
dest = studioPathRemap(obj);
|
||||
}
|
||||
|
||||
if (options && options.force) {
|
||||
|
@ -55,10 +47,16 @@ var handlers = {
|
|||
var dest = path.join(obj.targetDir, path.basename(obj.src));
|
||||
|
||||
if (options && options.android_studio === true) {
|
||||
dest = path.join('app/src/main/java', obj.targetDir.substring(4), path.basename(obj.src));
|
||||
dest = studioPathRemap(obj);
|
||||
}
|
||||
|
||||
deleteJava(project.projectDir, dest);
|
||||
// TODO: Add Koltin extension to uninstall, since they are handled like Java files
|
||||
if (obj.src.endsWith('java')) {
|
||||
deleteJava(project.projectDir, dest);
|
||||
} else {
|
||||
// Just remove the file, not the whole parent directory
|
||||
removeFile(project.projectDir, dest);
|
||||
}
|
||||
}
|
||||
},
|
||||
'lib-file': {
|
||||
|
@ -318,3 +316,16 @@ function removeFileAndParents (baseDir, destFile, stopper) {
|
|||
function generateAttributeError (attribute, element, id) {
|
||||
return 'Required attribute "' + attribute + '" not specified in <' + element + '> element from plugin: ' + id;
|
||||
}
|
||||
|
||||
function studioPathRemap (obj) {
|
||||
// If a Java file is using the new directory structure, don't penalize it
|
||||
if (!obj.targetDir.includes('app/src/main')) {
|
||||
if (obj.src.endsWith('.java')) {
|
||||
return path.join('app/src/main/java', obj.targetDir.substring(4), path.basename(obj.src));
|
||||
} else {
|
||||
// For all other files, add 'app/src/main' to the targetDir if it didn't have it already
|
||||
return path.join('app/src/main', obj.targetDir, path.basename(obj.src));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
2
platforms/android/cordova/lib/run.js
vendored
2
platforms/android/cordova/lib/run.js
vendored
|
@ -108,7 +108,7 @@ module.exports.run = function (runOptions) {
|
|||
// format than emulator.install expects.
|
||||
// TODO: Update emulator/device.install to handle this change
|
||||
return build.run.call(self, runOptions, resolvedTarget).then(function (buildResults) {
|
||||
if (resolvedTarget.isEmulator) {
|
||||
if (resolvedTarget && resolvedTarget.isEmulator) {
|
||||
return emulator.wait_for_boot(resolvedTarget.target).then(function () {
|
||||
return emulator.install(resolvedTarget, buildResults);
|
||||
});
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
*/
|
||||
|
||||
// Coho updates this line:
|
||||
var VERSION = "7.1.0";
|
||||
var VERSION = "7.1.2";
|
||||
|
||||
module.exports.version = VERSION;
|
||||
|
||||
|
|
17
platforms/android/platform_www/cordova.js
vendored
17
platforms/android/platform_www/cordova.js
vendored
|
@ -1,5 +1,5 @@
|
|||
// Platform: android
|
||||
// 4450a4cea50616e080a82e8ede9e3d6a1fe3c3ec
|
||||
// 9e8e1b716252c4a08abcd31a13013b868d6f4141
|
||||
/*
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
|
@ -19,7 +19,7 @@
|
|||
under the License.
|
||||
*/
|
||||
;(function() {
|
||||
var PLATFORM_VERSION_BUILD_LABEL = '7.1.0';
|
||||
var PLATFORM_VERSION_BUILD_LABEL = '7.1.2';
|
||||
// file: src/scripts/require.js
|
||||
|
||||
/* jshint -W079 */
|
||||
|
@ -307,6 +307,7 @@ var cordova = {
|
|||
} catch (err) {
|
||||
var msg = 'Error in ' + (isSuccess ? 'Success' : 'Error') + ' callbackId: ' + callbackId + ' : ' + err;
|
||||
console && console.log && console.log(msg);
|
||||
console && console.log && err.stack && console.log(err.stack);
|
||||
cordova.fireWindowEvent('cordovacallbackerror', { 'message': msg });
|
||||
throw err;
|
||||
}
|
||||
|
@ -326,7 +327,7 @@ module.exports = cordova;
|
|||
|
||||
});
|
||||
|
||||
// file: /Users/steveng/repo/cordova/cordova-android/cordova-js-src/android/nativeapiprovider.js
|
||||
// file: /Users/brodybits/Documents/cordova/cordova-android/cordova-js-src/android/nativeapiprovider.js
|
||||
define("cordova/android/nativeapiprovider", function(require, exports, module) {
|
||||
|
||||
/**
|
||||
|
@ -349,7 +350,7 @@ module.exports = {
|
|||
|
||||
});
|
||||
|
||||
// file: /Users/steveng/repo/cordova/cordova-android/cordova-js-src/android/promptbasednativeapi.js
|
||||
// file: /Users/brodybits/Documents/cordova/cordova-android/cordova-js-src/android/promptbasednativeapi.js
|
||||
define("cordova/android/promptbasednativeapi", function(require, exports, module) {
|
||||
|
||||
/**
|
||||
|
@ -881,7 +882,7 @@ module.exports = channel;
|
|||
|
||||
});
|
||||
|
||||
// file: /Users/steveng/repo/cordova/cordova-android/cordova-js-src/exec.js
|
||||
// file: /Users/brodybits/Documents/cordova/cordova-android/cordova-js-src/exec.js
|
||||
define("cordova/exec", function(require, exports, module) {
|
||||
|
||||
/**
|
||||
|
@ -1639,7 +1640,7 @@ exports.reset();
|
|||
|
||||
});
|
||||
|
||||
// file: /Users/steveng/repo/cordova/cordova-android/cordova-js-src/platform.js
|
||||
// file: /Users/brodybits/Documents/cordova/cordova-android/cordova-js-src/platform.js
|
||||
define("cordova/platform", function(require, exports, module) {
|
||||
|
||||
// The last resume event that was received that had the result of a plugin call.
|
||||
|
@ -1749,7 +1750,7 @@ function onMessageFromNative(msg) {
|
|||
|
||||
});
|
||||
|
||||
// file: /Users/steveng/repo/cordova/cordova-android/cordova-js-src/plugin/android/app.js
|
||||
// file: /Users/brodybits/Documents/cordova/cordova-android/cordova-js-src/plugin/android/app.js
|
||||
define("cordova/plugin/android/app", function(require, exports, module) {
|
||||
|
||||
var exec = require('cordova/exec');
|
||||
|
@ -2185,4 +2186,4 @@ window.cordova = require('cordova');
|
|||
|
||||
require('cordova/init');
|
||||
|
||||
})();
|
||||
})();
|
||||
|
|
|
@ -262,12 +262,12 @@ module.exports.metadata =
|
|||
"cordova-plugin-share-content": "1.0.0",
|
||||
"cordova-plugin-file": "6.0.1",
|
||||
"cordova-plugin-file-transfer": "1.7.1",
|
||||
"com-darryncampbell-cordova-plugin-intent": "1.1.0",
|
||||
"com-darryncampbell-cordova-plugin-intent": "1.1.1",
|
||||
"cordova-plugin-inappbrowser": "3.0.0",
|
||||
"cordova-plugin-whitelist": "1.3.3",
|
||||
"cordova-plugin-splashscreen": "5.0.2",
|
||||
"cordova-plugin-device": "2.0.2",
|
||||
"cordova-android-support-gradle-release": "1.4.4",
|
||||
"cordova-android-support-gradle-release": "1.4.7",
|
||||
"cordova-plugin-filepath": "1.4.2",
|
||||
"cordova-sqlite-storage": "2.5.1"
|
||||
};
|
||||
|
|
|
@ -12,6 +12,5 @@ target=android-27
|
|||
android.library.reference.1=CordovaLib
|
||||
android.library.reference.2=app
|
||||
cordova.system.library.1=com.android.support:support-v4:27.1.0
|
||||
cordova.gradle.include.1=cordova-android-support-gradle-release/goober_m-cordova-android-support-gradle-release.gradle
|
||||
cordova.system.library.2=com.android.support:support-v4:25.+
|
||||
cordova.system.library.3=com.android.support:appcompat-v7:25.+
|
Reference in a new issue