-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathapp.plugin.js
More file actions
25 lines (22 loc) · 892 Bytes
/
app.plugin.js
File metadata and controls
25 lines (22 loc) · 892 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
const { withAppBuildGradle } = require('@expo/config-plugins');
function replace(contents, match, replace) {
if (!contents.includes(match)) {
return contents;
}
return contents.replace(match, replace);
}
const withLocalAAR = (config) => {
return withAppBuildGradle(config, (config) => {
if (config.modResults.language === 'groovy') {
config.modResults.contents = replace(
config.modResults.contents,
`implementation("com.facebook.react:react-android")`,
`implementation("com.facebook.react:react-android")\n implementation files('../../node_modules/react-native-sunmi-cloud-printer/android/libs/externalprinterlibrary2-1.0.13-release.aar')`
);
} else {
throw new Error("Can't enable APK optimizations because it's not groovy");
}
return config;
});
};
module.exports = (config, props) => withLocalAAR(config, []);