-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump up versions of the dev chain and all other plugins
- android CLI version to the latest - android sdk packages to the latest - cordova, ionic and bower to the latest - all non-OpenPATH plugins to the latest versions Some of these (`cordova-plugin-badge`/`phonegap-plugin-barcodescanner`) ran into an issue with using `compile` when they actually needed `implementation` for the new gradle. The badge is a dependency of the local notification plugin, so I migrated from `timkellypa` to `levanax` who has some commits that have fixed it and some other issues. This fixes it for the local notification plugin but not for the `cordova-plugin-badge` which is pulled in as a dependency from elsewere I fixed that and the barcodescanner by adding a new hook that renames `compile` to `implementation` before build. Testing done: builds
- Loading branch information
Showing
5 changed files
with
76 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
hooks/before_build/android/android_change_compile_implementation.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
* A hook to change provider in order to match with the application name. | ||
*/ | ||
|
||
var fs = require('fs'); | ||
var path = require('path'); | ||
var et = require('elementtree'); | ||
|
||
const PROVIDER = "edu.berkeley.eecs.emission.provider"; | ||
const ACCOUNT_TYPE = "eecs.berkeley.edu"; | ||
const LOG_NAME = "Changing Providers: "; | ||
|
||
var changeCompileToImplementation = function (file) { | ||
if (fs.existsSync(file)) { | ||
fs.readFile(file, 'utf8', function (err, data) { | ||
var result = data.replace("compile", "implementation"); | ||
fs.writeFile(file, result, 'utf8', function (err) { | ||
if (err) throw new Error(LOG_NAME + 'Unable to write into ' + file + ': ' + err); | ||
console.log(LOG_NAME + "" + file + " updated...") | ||
}); | ||
}); | ||
} else { | ||
console.error("Could not find file "+file+" skipping compile -> implementation change"); | ||
} | ||
} | ||
|
||
module.exports = function (context) { | ||
// If Android platform is not installed, don't even execute | ||
if (!context.opts.platforms.includes('android')) return; | ||
|
||
var config_xml = path.join(context.opts.projectRoot, 'config.xml'); | ||
var data = fs.readFileSync(config_xml).toString(); | ||
// If no data then no config.xml | ||
if (data) { | ||
var etree = et.parse(data); | ||
console.log(LOG_NAME + "Retrieving application name...") | ||
var applicationName = etree._root.attrib.id; | ||
console.info(LOG_NAME + "Your application is " + applicationName); | ||
const splitParts = applicationName.split(".") | ||
var lastApplicationPart = splitParts[splitParts.length - 1]; | ||
|
||
var platformRoot = path.join(context.opts.projectRoot, 'platforms/android/') | ||
|
||
console.log(LOG_NAME + "Updating barcode scanner gradle..."); | ||
var gradleFile = path.join(platformRoot, 'phonegap-plugin-barcodescanner/'+lastApplicationPart+'-barcodescanner.gradle'); | ||
changeCompileToImplementation(gradleFile); | ||
|
||
console.log(LOG_NAME + "Updating badge gradle..."); | ||
var gradleFile = path.join(platformRoot, 'cordova-plugin-badge/'+lastApplicationPart+'-badge.gradle'); | ||
changeCompileToImplementation(gradleFile); | ||
} else { | ||
throw new Error(LOG_NAME + "Could not retrieve application name."); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,24 @@ | ||
build-tools;30.0.1 | ||
build-tools;30.0.2 | ||
build-tools;30.0.3 | ||
build-tools;31.0.0 | ||
build-tools;32.0.0 | ||
build-tools;33.0.2 | ||
emulator | ||
extras;google;google_play_services | ||
extras;intel;Hardware_Accelerated_Execution_Manager | ||
patcher;v4 | ||
platform-tools | ||
platforms;android-30 | ||
platforms;android-31 | ||
platforms;android-32 | ||
platforms;android-33 | ||
system-images;android-22;google_apis;x86_64 | ||
system-images;android-23;google_apis;x86_64 | ||
system-images;android-24;google_apis_playstore;x86 | ||
system-images;android-25;google_apis_playstore;x86 | ||
system-images;android-26;google_apis_playstore;x86 | ||
system-images;android-27;google_apis_playstore;x86 | ||
system-images;android-28;google_apis_playstore;x86_64 | ||
system-images;android-29;google_apis_playstore;x86 | ||
system-images;android-29;google_apis_playstore;x86_64 | ||
system-images;android-30;google_apis_playstore;x86 | ||
system-images;android-30;google_apis_playstore;x86_64 | ||
system-images;android-31;google_apis_playstore;x86_64 | ||
system-images;android-32;google_apis_playstore;x86_64 | ||
system-images;android-33;google_apis_playstore;x86_64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters