mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-22 00:32:55 +08:00
Merge branch 'master' into StudioProjectCompat
Fixing conflict caused by merging #417 into master
This commit is contained in:
commit
43956c1bc8
@ -57,6 +57,14 @@ GenericBuilder.prototype.findOutputApks = function (build_type, arch) {
|
|||||||
module.exports = GenericBuilder;
|
module.exports = GenericBuilder;
|
||||||
|
|
||||||
function apkSorter (fileA, fileB) {
|
function apkSorter (fileA, fileB) {
|
||||||
|
// De-prioritize arch specific builds
|
||||||
|
var archSpecificRE = /-x86|-arm/;
|
||||||
|
if (archSpecificRE.exec(fileA)) {
|
||||||
|
return 1;
|
||||||
|
} else if (archSpecificRE.exec(fileB)) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
// De-prioritize unsigned builds
|
// De-prioritize unsigned builds
|
||||||
var unsignedRE = /-unsigned/;
|
var unsignedRE = /-unsigned/;
|
||||||
if (unsignedRE.exec(fileA)) {
|
if (unsignedRE.exec(fileA)) {
|
||||||
@ -65,7 +73,7 @@ function apkSorter (fileA, fileB) {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
var timeDiff = fs.statSync(fileA).mtime - fs.statSync(fileB).mtime;
|
var timeDiff = fs.statSync(fileB).mtime - fs.statSync(fileA).mtime;
|
||||||
return timeDiff === 0 ? fileA.length - fileB.length : timeDiff;
|
return timeDiff === 0 ? fileA.length - fileB.length : timeDiff;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,7 +81,14 @@ function findOutputApksHelper (dir, build_type, arch) {
|
|||||||
var shellSilent = shell.config.silent;
|
var shellSilent = shell.config.silent;
|
||||||
shell.config.silent = true;
|
shell.config.silent = true;
|
||||||
|
|
||||||
var ret = shell.ls(path.join(dir, build_type, '*.apk')).filter(function (candidate) {
|
// list directory recursively
|
||||||
|
var ret = shell.ls('-R', dir).map(function (file) {
|
||||||
|
// ls does not include base directory
|
||||||
|
return path.join(dir, file);
|
||||||
|
}).filter(function (file) {
|
||||||
|
// find all APKs
|
||||||
|
return file.match(/\.apk?$/i);
|
||||||
|
}).filter(function (candidate) {
|
||||||
var apkName = path.basename(candidate);
|
var apkName = path.basename(candidate);
|
||||||
// Need to choose between release and debug .apk.
|
// Need to choose between release and debug .apk.
|
||||||
if (build_type === 'debug') {
|
if (build_type === 'debug') {
|
||||||
|
@ -174,6 +174,8 @@ android {
|
|||||||
//ignore this chunk of code, and your version codes will be respected.
|
//ignore this chunk of code, and your version codes will be respected.
|
||||||
|
|
||||||
if (Boolean.valueOf(cdvBuildMultipleApks)) {
|
if (Boolean.valueOf(cdvBuildMultipleApks)) {
|
||||||
|
flavorDimensions "default"
|
||||||
|
|
||||||
productFlavors {
|
productFlavors {
|
||||||
armv7 {
|
armv7 {
|
||||||
versionCode defaultConfig.versionCode*10 + 2
|
versionCode defaultConfig.versionCode*10 + 2
|
||||||
|
Loading…
Reference in New Issue
Block a user