mirror of
https://github.com/Ponsen/cordova-plugin-abi-filter.git
synced 2026-07-28 00:00:07 +08:00
added error handling
version bump to 1.0.1
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "cordova-plugin-abi-filter",
|
||||
"version": "1.0.0",
|
||||
"version": "1.0.1",
|
||||
"description": "Specify supported platform ABIs for your android build",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" id="cordova-plugin-abi-filter" version="1.0.0">
|
||||
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" id="cordova-plugin-abi-filter" version="1.0.1">
|
||||
<name>cordova-plugin-abi-filter</name>
|
||||
<description>Filter desired platform ABIs from your project build.</description>
|
||||
<license>Apache 2.0 License</license>
|
||||
|
||||
+19
-15
@@ -48,23 +48,27 @@ module.exports = function (context) {
|
||||
|
||||
//Variables can come from 3 different places
|
||||
|
||||
//plugin.xml
|
||||
//Prio 3 - default if user did not specify cli args or if plugin is just added
|
||||
if (context.opts.plugin.pluginInfo.getPreferences().ABI_FILTER) {
|
||||
abi_values = context.opts.plugin.pluginInfo.getPreferences().ABI_FILTER
|
||||
}
|
||||
try{
|
||||
//plugin.xml
|
||||
//Prio 3 - default if user did not specify cli args or if plugin is just added
|
||||
if (context.opts.plugin.pluginInfo.getPreferences().ABI_FILTER) {
|
||||
abi_values = context.opts.plugin.pluginInfo.getPreferences().ABI_FILTER
|
||||
}
|
||||
|
||||
//CLI Arg
|
||||
//Prio 2 - is present when plugin is added with --variable ABI_FILTER="a|b|c"
|
||||
if (context.opts.cli_variables && context.opts.cli_variables.ABI_FILTER) {
|
||||
abi_values = context.opts.cli_variables.ABI_FILTER
|
||||
}
|
||||
//CLI Arg
|
||||
//Prio 2 - is present when plugin is added with --variable ABI_FILTER="a|b|c"
|
||||
if (context.opts.cli_variables && context.opts.cli_variables.ABI_FILTER) {
|
||||
abi_values = context.opts.cli_variables.ABI_FILTER
|
||||
}
|
||||
|
||||
//config.xml
|
||||
//Prio 1 - plugin was already added or user added key to config.xml manually
|
||||
const configFile = new common.ConfigParser(utils.projectConfig(projectRoot))
|
||||
if (configFile.getPlugin(context.opts.plugin.id).variables.ABI_FILTER) {
|
||||
abi_values = configFile.getPlugin(context.opts.plugin.id).variables.ABI_FILTER
|
||||
//config.xml
|
||||
//Prio 1 - plugin was already added or user added key to config.xml manually
|
||||
const configFile = new common.ConfigParser(utils.projectConfig(projectRoot))
|
||||
if (configFile.getPlugin(context.opts.plugin.id).variables.ABI_FILTER) {
|
||||
abi_values = configFile.getPlugin(context.opts.plugin.id).variables.ABI_FILTER
|
||||
}
|
||||
} catch(error){
|
||||
console.warn("Using defaults: " + abi_values);
|
||||
}
|
||||
|
||||
//parse them values to a gradle readable string
|
||||
|
||||
Reference in New Issue
Block a user