Skip to content
Snippets Groups Projects
Commit 0c1b50d9 authored by Benoit Lavenier's avatar Benoit Lavenier
Browse files

[fix] Fix android 10 error, in secure storage

[enh] Enable compat with Android SDK 29 (use AndroidX instead of support-v4)
parent d79b69dd
No related branches found
No related tags found
No related merge requests found
<?xml version='1.0' encoding='utf-8'?> <?xml version='1.0' encoding='utf-8'?>
<widget android-versionCode="106012" id="fr.duniter.cesium" ios-CFBundleIdentifier="org.duniter.cesium" version="1.6.2-alpha" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> <widget android-versionCode="106012" id="fr.duniter.cesium" ios-CFBundleIdentifier="org.duniter.cesium" version="1.6.2" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>Cesium</name> <name>Cesium</name>
<description> <description>
An simple App for Duniter wallet An simple App for Duniter wallet
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<preference name="xwalkVersion" value="19" /> <preference name="xwalkVersion" value="19" />
<preference name="xwalkMultipleApk" value="false" /> <preference name="xwalkMultipleApk" value="false" />
<preference name="android-minSdkVersion" value="16" /> <preference name="android-minSdkVersion" value="16" />
<preference name="android-targetSdkVersion" value="28" /> <preference name="android-targetSdkVersion" value="29" />
<preference name="StatusBarOverlaysWebView" value="false" /> <preference name="StatusBarOverlaysWebView" value="false" />
<preference name="StatusBarBackgroundColor" value="#000" /> <preference name="StatusBarBackgroundColor" value="#000" />
<preference name="StatusBarStyle" value="lightcontent" /> <preference name="StatusBarStyle" value="lightcontent" />
...@@ -122,15 +122,20 @@ ...@@ -122,15 +122,20 @@
<icon height="512" src="resources/osx/icon-512.png" width="512" /> <icon height="512" src="resources/osx/icon-512.png" width="512" />
<icon height="1024" src="resources/osx/icon-1024.png" width="1024" /> <icon height="1024" src="resources/osx/icon-1024.png" width="1024" />
</platform> </platform>
<engine name="android" spec="^6.4.0" /> <plugin name="cordova-plugin-camera" spec="^4.1.0">
<engine name="ios" spec="git+https://github.com/duniter-cesium/cordova-ios.git#5.1.0" /> <variable name="ANDROID_SUPPORT_V4_VERSION" value="28.+" />
<plugin name="cordova-plugin-camera" spec="^4.1.0" /> </plugin>
<plugin name="cordova-plugin-ionic-webview" spec="^4.1.3">
<variable name="ANDROID_SUPPORT_ANNOTATIONS_VERSION" value="28.+" />
</plugin>
<plugin name="cordova-plugin-console" spec="^1.1.0" /> <plugin name="cordova-plugin-console" spec="^1.1.0" />
<plugin name="cordova-plugin-device" spec="^2.0.3" /> <plugin name="cordova-plugin-device" spec="^2.0.3" />
<plugin name="cordova-plugin-dialogs" spec="^2.0.2" /> <plugin name="cordova-plugin-dialogs" spec="^2.0.2" />
<plugin name="cordova-plugin-secure-storage-android10" spec="git+https://github.com/duniter-cesium/cordova-plugin-secure-storage-android10#6.0.3" /> <plugin name="cordova-clipboard" spec="^1.3.0" />
<plugin name="cordova-plugin-secure-storage-android10" spec="git+https://github.com/duniter-cesium/cordova-plugin-secure-storage-android10#6.0.4" />
<plugin name="cordova-plugin-splashscreen" spec="^5.0.3" /> <plugin name="cordova-plugin-splashscreen" spec="^5.0.3" />
<plugin name="cordova-plugin-statusbar" spec="^2.4.3" /> <plugin name="cordova-plugin-statusbar" spec="^2.4.3" />
<plugin name="cordova-plugin-file" spec="^6.0.2" />
<plugin name="cordova-plugin-vibration" spec="^3.1.1" /> <plugin name="cordova-plugin-vibration" spec="^3.1.1" />
<plugin name="cordova-plugin-websocket" spec="^0.12.2" /> <plugin name="cordova-plugin-websocket" spec="^0.12.2" />
<plugin name="cordova-plugin-whitelist" spec="^1.3.4" /> <plugin name="cordova-plugin-whitelist" spec="^1.3.4" />
...@@ -139,5 +144,9 @@ ...@@ -139,5 +144,9 @@
<plugin name="cordova-plugin-minisodium" spec="git+https://github.com/duniter-cesium/cordova-plugin-minisodium.git#v1.0.1" /> <plugin name="cordova-plugin-minisodium" spec="git+https://github.com/duniter-cesium/cordova-plugin-minisodium.git#v1.0.1" />
<plugin name="phonegap-plugin-barcodescanner" spec="^8.1.0"> <plugin name="phonegap-plugin-barcodescanner" spec="^8.1.0">
<variable name="CAMERA_USAGE_DESCRIPTION" value="To scan QRCode" /> <variable name="CAMERA_USAGE_DESCRIPTION" value="To scan QRCode" />
<variable name="ANDROID_SUPPORT_V4_VERSION" value="28.+" />
</plugin> </plugin>
<engine name="ios" spec="git+https://github.com/duniter-cesium/cordova-ios.git#5.1.0" />
<engine name="osx" spec="^5.0.0" />
<engine name="android" spec="^8.1.0" />
</widget> </widget>
...@@ -15,7 +15,7 @@ if (rootdir) { ...@@ -15,7 +15,7 @@ if (rootdir) {
let platform = platforms[x].trim().toLowerCase(); let platform = platforms[x].trim().toLowerCase();
if(platform == 'android') { if(platform = 'android') {
let platformPath = path.join(rootdir, 'platforms', platform); let platformPath = path.join(rootdir, 'platforms', platform);
let androidManifestFile = path.join(platformPath, 'AndroidManifest.xml'); let androidManifestFile = path.join(platformPath, 'AndroidManifest.xml');
...@@ -27,11 +27,16 @@ if (rootdir) { ...@@ -27,11 +27,16 @@ if (rootdir) {
// Add 'tools' namespace to root tag // Add 'tools' namespace to root tag
.pipe(replace(/(xmlns:android="http:\/\/schemas.android.com\/apk\/res\/android")\s*>/g, '$1 xmlns:tools="http://schemas.android.com/tools">')) .pipe(replace(/(xmlns:android="http:\/\/schemas.android.com\/apk\/res\/android")\s*>/g, '$1 xmlns:tools="http://schemas.android.com/tools">'))
// Add <application> (replace 'targetSdkversion' and add tools:overrideLibrary)
.pipe(replace(/\s+tools:replace="android:appComponentFactory"/, ''))
.pipe(replace(/\s+android:appComponentFactory="[^"]+"/, ''))
.pipe(replace(/(\s*<application)\s*/, '$1 tools:replace="android:appComponentFactory" android:appComponentFactory="androidx.core.app.CoreComponentFactory" '))
// remove all <uses-sdk> // remove all <uses-sdk>
.pipe(replace(/<uses-sdk [^>]+\/>/g, '')) .pipe(replace(/<uses-sdk [^>]+\/>/g, ''))
// add <uses-sdk> (replace 'targetSdkversion' and add tools:overrideLibrary) // add <uses-sdk> (replace 'targetSdkversion' and add tools:overrideLibrary)
.pipe(replace(/(<\/manifest>)/, ' <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="28" tools:overrideLibrary="org.kaliumjni.lib" />\n$1')) .pipe(replace(/(<\/manifest>)/, ' <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="29" tools:overrideLibrary="org.kaliumjni.lib" />\n$1'))
.pipe(gulp.dest(platformPath)); .pipe(gulp.dest(platformPath));
......
...@@ -2,7 +2,35 @@ ...@@ -2,7 +2,35 @@
"use strict"; "use strict";
const fs = require('fs'), const fs = require('fs'),
glob = require('glob'), glob = require('glob'),
path = require('path'); path = require('path'),
log = require('fancy-log'),
colors = require('ansi-colors');
function mkdirp(dir) {
const parent = path.dirname(dir);
if (!fs.existsSync(parent)){
mkdirp(parent);
}
if (!fs.existsSync(dir)){
fs.mkdirSync(dir);
}
}
function copyFiles(src_dir, dest_dir) {
glob(src_dir + '/**/*.*', null, function(er, files) {
files.forEach(function(file) {
log(colors.grey(' Copy file ' + file + ' to ' + dest_dir));
const dest_file = file.replace(src_dir, dest_dir);
mkdirp(path.dirname(dest_file));
fs.copyFile(file, dest_file, (err) => {
if (err) {
log(colors.red(' ERROR: ' + err));
throw err;
}
});
});
});
}
// See: https://stackoverflow.com/questions/49162538/running-cordova-build-android-unable-to-find-attribute-androidfontvariation // See: https://stackoverflow.com/questions/49162538/running-cordova-build-android-unable-to-find-attribute-androidfontvariation
...@@ -17,47 +45,34 @@ if (rootdir) { ...@@ -17,47 +45,34 @@ if (rootdir) {
const platform = platforms[x].trim().toLowerCase(); const platform = platforms[x].trim().toLowerCase();
if (platform === 'android') { if (platform === 'android') {
const gradle_dir = rootdir + '/gradle';
const build_dir = rootdir + '/resources/android/build'; const build_dir = rootdir + '/resources/android/build';
const android_dir = rootdir + '/platforms/android'; const android_dir = rootdir + '/platforms/android';
const build_files = build_dir + '/**/*.*';
console.log('-----------------------------------------'); // Copy gradle files
if (fs.existsSync(android_dir) && fs.existsSync(build_dir)) { if (fs.existsSync(gradle_dir)) {
copyFiles(gradle_dir, android_dir + '/gradle')
}
const mkdirp = function(dir) { if (fs.existsSync(android_dir) && fs.existsSync(build_dir)) {
const parent = path.dirname(dir);
if (!fs.existsSync(parent)){
mkdirp(parent);
}
if (!fs.existsSync(dir)){
fs.mkdirSync(dir);
}
};
glob(build_files, null, function(er, files) { // Copy resources files
files.forEach(function(file) { copyFiles(build_dir, android_dir);
console.log(' Copy ' + file + ' to ' + android_dir);
const dest_file = file.replace(build_dir, android_dir);
mkdirp(path.dirname(dest_file));
fs.createReadStream(file).pipe(fs.createWriteStream(dest_file));
});
});
const gradle_file = build_dir + '/build-extras.gradle'; const gradle_file = build_dir + '/build-extras.gradle';
if (!fs.existsSync(gradle_file)) { if (!fs.existsSync(gradle_file)) {
console.log( ' File ' + gradle_file + ' not found. Skipping copy to /platforms/android'); log(colors.red(' File ' + gradle_file + 'not found. Skipping copy to ' + android_dir));
} }
const signing_file = build_dir + '/release-signing.properties'; const signing_file = build_dir + '/release-signing.properties';
if (!fs.existsSync(signing_file)) { if (!fs.existsSync(signing_file)) {
console.log( ' File ' + signing_file + ' not found. Skipping copy to /platforms/android'); log(colors.red(' File ' + signing_file + 'not found. Skipping copy to ' + android_dir));
console.log( ' WARNING: Release APK files will not be signed !'); log(colors.red(' WARNING: Release APK files will not be signed !'));
} }
} else { } else {
console.log( ' Directory ' + build_dir + ' not found. Skipping copy to /platforms/android'); log(colors.orange(' Directory ' + build_dir + 'not found. Skipping copy to ' + android_dir));
} }
console.log('-----------------------------------------');
} }
} catch (e) { } catch (e) {
process.stdout.write(e); process.stdout.write(e);
......
...@@ -9,82 +9,95 @@ const fs = require('fs'), ...@@ -9,82 +9,95 @@ const fs = require('fs'),
glob = require("glob"); glob = require("glob");
// Get folders, from files
const jsFolders = glob.sync("www/**/*.js", {nonull: true})
// Map to file's folder
.map(file => file.substring(0, file.lastIndexOf('/')))
// Reduce to a map of folders
.reduce((res, folder) => {
if (folder.indexOf('www/dist/') !== -1 || // Exclude dist js
folder.indexOf('/plugins/rml') !== -1 || // Exclude plugin tutorial
folder.indexOf('www/js/vendor') !== -1 || // exclude vendor libs
folder.indexOf('www/lib') !== -1 // exclude www/lib
) {
return res;
}
res[folder] = res[folder] || true;
return res;
}, {});
// Process each folder with Js file
Object.keys(jsFolders).forEach(folder => processFiles(folder));
function processFiles(dir) { function processFiles(dir) {
let errorCount = 0; let errorCount = 0;
log(colors.grey('Processing folder ' + dir + '...')); log(colors.grey('Processing folder ' + dir + '...'));
fs.readdir(dir, function(err, list) { fs.readdir(dir, function(err, list) {
if (err) { if (err) {
log(colors.red('processFiles err: ' + err)); log(colors.red('processFiles err: ' + err));
return; return;
} }
async.eachSeries(list, function(file, innercallback) { async.eachSeries(list, function(file, innercallback) {
file = dir + '/' + file; file = dir + '/' + file;
log(colors.grey('Processing file ./' + file + '...')); log(colors.grey('Processing file ./' + file + '...'));
fs.stat(file, function(err, stat) { fs.stat(file, function(err, stat) {
if(!stat.isDirectory()) { if(!stat.isDirectory()) {
if(path.extname(file) === ".js") { if(path.extname(file) === ".js") {
lintFile(file, function(hasError) { lintFile(file, function(hasError) {
if(hasError) { if(hasError) {
errorCount++; errorCount++;
} }
innercallback(); innercallback();
});
} else {
innercallback();
}
} else {
innercallback();
}
}); });
}, function(error) { } else {
if(errorCount > 0) { innercallback();
log(colors.red('JS Error detected (see below)')); }
process.exit(1); } else {
} innercallback();
else { }
//log(colors.red('OK NO Error ')); });
} }, function(error) {
}); if(errorCount > 0) {
throw error;
}
}); });
});
} }
function lintFile(file, callback) { function lintFile(file, callback) {
//log(colors.grey(`Linting ${colors.bold(file)}...`)); //log(colors.grey(`Linting ${colors.bold(file)}...`));
fs.readFile(file, (err, data) => { fs.readFile(file, (err, data) => {
if(err) { if(err) {
log(colors.red('Error: ' + err)); log(colors.red('Error: ' + err));
return; return;
} }
if(jshint(data.toString())) { if(jshint(data.toString())) {
callback(false); callback(false);
} else { } else {
const out = jshint.data(), const out = jshint.data(),
errors = out.errors; errors = out.errors;
for(let j = 0; j < errors.length; j++) { for(let j = 0; j < errors.length; j++) {
log(colors.red(`${colors.bold(file + ':' + errors[j].line + ':0' )} -> ${colors.bold(errors[j].evidence.trim())}`)); log(colors.red(`${colors.bold(file + ':' + errors[j].line + ':0' )} -> ${colors.bold(errors[j].evidence.trim())}`));
log(colors.red(` ${errors[j].reason}`)); log(colors.red(` ${errors[j].reason}`));
} }
log('-----------------------------------------'); log('-----------------------------------------');
callback(true); callback(true);
} }
}); });
}
function getJSFolder() {
// Get folders, from files
const jsFolders = glob.sync("www/**/*.js", {nonull: true})
// Map to file's folder
.map(file => file.substring(0, file.lastIndexOf('/')))
// Reduce to a map of folders
.reduce((res, folder) => {
if (folder.indexOf('www/dist/') !== -1 || // Exclude dist js
folder.indexOf('/plugins/rml') !== -1 || // Exclude plugin tutorial
folder.indexOf('www/js/vendor') !== -1 || // exclude vendor libs
folder.indexOf('www/lib') !== -1 // exclude www/lib
) {
return res;
}
res[folder] = res[folder] || true;
return res;
}, {});
return Object.keys(jsFolders);
}
// Process each folder with Js file
const errors = [];
getJSFolder().forEach(folder => {
try {
processFiles(folder)
} catch(err) {
errors.push(err);
}
});
if (errors.length) {
log(colors.red(`Some JS files have errors`));
process.exit(1);
} }
...@@ -39,10 +39,10 @@ ...@@ -39,10 +39,10 @@
"@bower_components/aes-js": "ricmoo/aes-js#v3.1.2", "@bower_components/aes-js": "ricmoo/aes-js#v3.1.2",
"@bower_components/angular": "angular/bower-angular#v1.5.11", "@bower_components/angular": "angular/bower-angular#v1.5.11",
"@bower_components/angular-animate": "angular/bower-angular-animate#v1.5.11", "@bower_components/angular-animate": "angular/bower-angular-animate#v1.5.11",
"@bower_components/angular-expose-api": "duniter-cesium/angular-expose-api#0.3.1",
"@bower_components/angular-bind-notifier": "aeisenberg/angular-bind-notifier#v1.1.11", "@bower_components/angular-bind-notifier": "aeisenberg/angular-bind-notifier#v1.1.11",
"@bower_components/angular-cache": "jmdobry/angular-cache#4.6.0", "@bower_components/angular-cache": "jmdobry/angular-cache#4.6.0",
"@bower_components/angular-chart.js": "jtblin/angular-chart#1.1.1", "@bower_components/angular-chart.js": "jtblin/angular-chart#1.1.1",
"@bower_components/angular-expose-api": "duniter-cesium/angular-expose-api#0.3.1",
"@bower_components/angular-file-saver": "alferov/angular-file-saver#1.1.3", "@bower_components/angular-file-saver": "alferov/angular-file-saver#1.1.3",
"@bower_components/angular-fullscreen-toggle": "duniter-cesium/angular-fullscreen-toggle#1.0.4", "@bower_components/angular-fullscreen-toggle": "duniter-cesium/angular-fullscreen-toggle#1.0.4",
"@bower_components/angular-image-crop": "duniter-cesium/angular-image-crop#v2.0.2", "@bower_components/angular-image-crop": "duniter-cesium/angular-image-crop#v2.0.2",
...@@ -77,19 +77,23 @@ ...@@ -77,19 +77,23 @@
"@bower_components/socket.io-client": "socketio/socket.io-client#^1.7.4", "@bower_components/socket.io-client": "socketio/socket.io-client#^1.7.4",
"@bower_components/ui-leaflet": "angular-ui/ui-leaflet#v2.0.0", "@bower_components/ui-leaflet": "angular-ui/ui-leaflet#v2.0.0",
"@bower_components/underscore": "jashkenas/underscore#1.10.2", "@bower_components/underscore": "jashkenas/underscore#1.10.2",
"cordova": "^9.0.0", "cordova": "^8.1.2",
"cordova-android": "^8.1.0", "cordova-android": "^8.1.0",
"cordova-clipboard": "^1.3.0", "cordova-clipboard": "^1.3.0",
"cordova-ios": "git+https://github.com/duniter-cesium/cordova-ios.git#5.1.0", "cordova-ios": "git+https://github.com/duniter-cesium/cordova-ios.git#5.1.0",
"cordova-osx": "^5.0.0", "cordova-osx": "^5.0.0",
"cordova-plugin-androidx": "^1.0.2",
"cordova-plugin-androidx-adapter": "^1.1.0",
"cordova-plugin-camera": "^4.1.0", "cordova-plugin-camera": "^4.1.0",
"cordova-plugin-compat": "^1.2.0", "cordova-plugin-compat": "^1.2.0",
"cordova-plugin-console": "^1.1.0",
"cordova-plugin-device": "^2.0.3", "cordova-plugin-device": "^2.0.3",
"cordova-plugin-dialogs": "^2.0.2", "cordova-plugin-dialogs": "^2.0.2",
"cordova-plugin-file": "^6.0.2",
"cordova-plugin-ionic-keyboard": "^2.2.0", "cordova-plugin-ionic-keyboard": "^2.2.0",
"cordova-plugin-ionic-webview": "^4.1.3", "cordova-plugin-ionic-webview": "^4.1.3",
"cordova-plugin-minisodium": "git+https://github.com/duniter-cesium/cordova-plugin-minisodium#v1.0.1", "cordova-plugin-minisodium": "git+https://github.com/duniter-cesium/cordova-plugin-minisodium#v1.0.1",
"cordova-plugin-secure-storage-android10": "git+https://github.com/duniter-cesium/cordova-plugin-secure-storage-android10#6.0.3", "cordova-plugin-secure-storage-android10": "git+https://github.com/duniter-cesium/cordova-plugin-secure-storage-android10.git#6.0.4",
"cordova-plugin-splashscreen": "^5.0.3", "cordova-plugin-splashscreen": "^5.0.3",
"cordova-plugin-statusbar": "^2.4.3", "cordova-plugin-statusbar": "^2.4.3",
"cordova-plugin-vibration": "^3.1.1", "cordova-plugin-vibration": "^3.1.1",
...@@ -146,8 +150,8 @@ ...@@ -146,8 +150,8 @@
"yargs": "^5.0.0" "yargs": "^5.0.0"
}, },
"peerDependencies": { "peerDependencies": {
"nopt": "4.0.1", "leaflet": "Leaflet/Leaflet#v0.7.7",
"leaflet": "Leaflet/Leaflet#v0.7.7" "nopt": "4.0.1"
}, },
"cordovaPlugins": [ "cordovaPlugins": [
"cordova-plugin-whitelist", "cordova-plugin-whitelist",
...@@ -197,14 +201,18 @@ ...@@ -197,14 +201,18 @@
"cordova-plugin-x-toast": {}, "cordova-plugin-x-toast": {},
"cordova-plugin-ionic-keyboard": {}, "cordova-plugin-ionic-keyboard": {},
"phonegap-plugin-barcodescanner": { "phonegap-plugin-barcodescanner": {
"CAMERA_USAGE_DESCRIPTION": "To scan QRCode" "CAMERA_USAGE_DESCRIPTION": "To scan QRCode",
"ANDROID_SUPPORT_V4_VERSION": "28.+"
}, },
"ionic-plugin-keyboard": {}, "ionic-plugin-keyboard": {},
"cordova-clipboard": {}, "cordova-clipboard": {},
"cordova-plugin-ionic-webview": { "cordova-plugin-ionic-webview": {
"ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+" "ANDROID_SUPPORT_ANNOTATIONS_VERSION": "28.+"
}, },
"cordova-plugin-console": {} "cordova-plugin-console": {},
"cordova-plugin-file": {},
"cordova-plugin-androidx": {},
"cordova-plugin-androidx-adapter": {}
}, },
"platforms": [ "platforms": [
"ios", "ios",
...@@ -215,4 +223,4 @@ ...@@ -215,4 +223,4 @@
"engines": { "engines": {
"yarn": ">= 1.0.0" "yarn": ">= 1.0.0"
} }
} }
\ No newline at end of file
configurations.all { configurations.all {
resolutionStrategy { resolutionStrategy {
force 'com.android.support:support-v4:27.1.0' force 'androidx.legacy:legacy-support-v4:1.0.0'
force 'androidx.appcompat:appcompat:1.0.0'
} }
} }
dependencies {
implementation(project(path: "CordovaLib")) {
exclude group: 'com.android.support', module:'support-v4'
}
}
// Overrides the value of minSdkVersion set in AndroidManifest.xml. Useful when creating multiple APKs based on SDK version
ext.cdvMinSdkVersion=16
// Overrides the automatically detected android.compileSdkVersion value
ext.cdvCompileSdkVersion=29
// Overrides the automatically detected android.buildToolsVersion value
ext.cdvBuildToolsVersion='29.0.2'
//ext.cdvBuildToolsVersion = '30.0.0-rc2'
distributionUrl=https://services.gradle.org/distributions/gradle-4.10.3-all.zip
...@@ -40,7 +40,7 @@ WEB_EXT_ID="{6f9922f7-a054-4609-94ce-d269993246a5}" ...@@ -40,7 +40,7 @@ WEB_EXT_ID="{6f9922f7-a054-4609-94ce-d269993246a5}"
GRADLE_VERSION=4.10.3 GRADLE_VERSION=4.10.3
GRADLE_HOME=${HOME}/.gradle/${GRADLE_VERSION} GRADLE_HOME=${HOME}/.gradle/${GRADLE_VERSION}
CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL=https\://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-all.zip CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL=https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-all.zip
# Override with a local file, if any # Override with a local file, if any
...@@ -96,7 +96,7 @@ if [[ ! -d "${ANDROID_SDK_ROOT}" ]]; then ...@@ -96,7 +96,7 @@ if [[ ! -d "${ANDROID_SDK_ROOT}" ]]; then
fi fi
# Export Android SDK tools to path # Export Android SDK tools to path
ANDROID_SDK_TOOLS_ROOT=${ANDROID_SDK_ROOT}/tools too=${ANDROID_SDK_ROOT}/tools
PATH=${ANDROID_SDK_TOOLS_ROOT}/bin:${GRADLE_HOME}/bin:$PATH PATH=${ANDROID_SDK_TOOLS_ROOT}/bin:${GRADLE_HOME}/bin:$PATH
# Export useful variables # Export useful variables
...@@ -133,21 +133,18 @@ fi ...@@ -133,21 +133,18 @@ fi
# Install global dependencies # Install global dependencies
IONIC_PATH=`which ionic` IONIC_PATH=`which ionic`
CORDOVA_PATH=`which cordova` CORDOVA_PATH=`which cordova`
if [[ "_" == "_${IONIC_PATH}" || "_" == "_${CORDOVA_PATH}" ]]; then CORDOVA_RES_PATH=`which cordova-res`
echo "Installing global dependencies..."
npm install -g cordova ionic native-run yarn
if [[ $? -ne 0 ]]; then
exit 1
fi
fi
NATIVE_RUN_PATH=`which native-run` NATIVE_RUN_PATH=`which native-run`
if [[ "_" == "_${NATIVE_RUN_PATH}" ]]; then WEB_EXT_PATH=`which web-ext`
if [[ "_" == "_${IONIC_PATH}" || "_" == "_${CORDOVA_PATH}" || "_" == "_${CORDOVA_RES_PATH}" || "_" == "_${NATIVE_RUN_PATH}" || "_" == "_${WEB_EXT_PATH}" ]]; then
echo "Installing global dependencies..." echo "Installing global dependencies..."
npm install -g native-run npm install -g cordova cordova-res @ionic/cli web-ext native-run yarn
if [[ $? -ne 0 ]]; then if [[ $? -ne 0 ]]; then
exit 1 exit 1
fi fi
# Make sure Ionic use yarn
ionic config set -g yarn true
fi fi
# Install project dependencies # Install project dependencies
......
File added
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment