-
Hello Cordova android community, First thank you for all the effort in the android platform! I have a question, is there a way to add properties to the
But what if some other property needs to be added how would we do that? For example if i wanna ignore jetifying the
Can this somehow be added in the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
There's nothing like But you can configure an The config would look something like: <widget ...>
...
<platform name="android">
...
<hook type="after_prepare" src="scripts/configureJetifierIgnore.js" />
</platform>
</widget> And inside const FS = require('fs');
const Path = require('path');
module.exports = function(context) {
const propertiesPath = Path.resolve(process.cwd(), 'platforms/android/gradle.properties');
let properties = FS.readFileSync(propertiesPath, {
encoding: 'utf-8'
});
// Replace any lines that begin with android.jetifier.ignoreList
properties = properties.replace(/^android\.jetifier\.ignorelist.+/m, '');
// Append a new ignoreList directive on a new line:
properties += '\r\nandroid.jetifier.ignoreList = jackson-core';
// Finally write the file back out
FS.writeFileSync(propertiesPath, properties);
}; Notes:
|
Beta Was this translation helpful? Give feedback.
There's nothing like
<edit-config>
or<config-file>
(which only operates on XML files) for the gradle properties file.But you can configure an
after_prepare
hook to run a NodeJS script to manipulate thegradle.properties
The config would look something like:
And inside
scripts/configureJetifierIgnore.js
: