diff --git a/package.json b/package.json index 810ae94..64ccca5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cordova-plugin-abi-filter", - "version": "1.1.2", + "version": "1.1.3", "description": "Specify supported platform ABIs for your android build", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" diff --git a/plugin.xml b/plugin.xml index b833d43..63373e6 100644 --- a/plugin.xml +++ b/plugin.xml @@ -1,5 +1,5 @@ - + cordova-plugin-abi-filter Filter desired platform ABIs from your project build. Apache 2.0 License diff --git a/scripts/apply.js b/scripts/apply.js index e0d84cf..320a93f 100644 --- a/scripts/apply.js +++ b/scripts/apply.js @@ -13,6 +13,26 @@ module.exports = context => { return new Promise((resolve, reject) => { + //helper funcs + function searchFilesByFilterRecursive(startPath, filter, callback) { + + if (!fs.existsSync(startPath)) { + console.log("no dir ", startPath); + deferral.reject(new Error("folder " + startPath + " does not exist")) + } + + var files = fs.readdirSync(startPath); + for (var i = 0; i < files.length; i++) { + var filename = path.join(startPath, files[i]); + var stat = fs.lstatSync(filename); + if (stat.isDirectory()) { + searchFilesByFilterRecursive(filename, filter, callback) //recurse + } else if (filter.test(filename)) { + callback(filename); + } + } + } + console.log('ABI Filter applying changes...'); const projectRoot = context.opts.projectRoot; @@ -102,22 +122,3 @@ module.exports = context => { }; -//helper funcs -function searchFilesByFilterRecursive(startPath, filter, callback) { - - if (!fs.existsSync(startPath)) { - console.log("no dir ", startPath); - deferral.reject(new Error("folder " + startPath + " does not exist")) - } - - var files = fs.readdirSync(startPath); - for (var i = 0; i < files.length; i++) { - var filename = path.join(startPath, files[i]); - var stat = fs.lstatSync(filename); - if (stat.isDirectory()) { - searchFilesByFilterRecursive(filename, filter, callback) //recurse - } else if (filter.test(filename)) { - callback(filename); - } - } -} \ No newline at end of file