-
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.
Merge pull request #952 from e-mission/maint_upgrade_2023
Native code updates for early 2023
- Loading branch information
Showing
24 changed files
with
233 additions
and
969 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
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
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
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
48 changes: 48 additions & 0 deletions
48
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,48 @@ | ||
/* | ||
* 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 LOG_NAME = "Changing compile to implementation "; | ||
|
||
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); | ||
} 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,26 @@ | ||
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;x86_64 | ||
system-images;android-32;google_apis_playstore;x86_64 | ||
system-images;android-33;google_apis;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
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
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
Oops, something went wrong.