-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp.plugin.js
More file actions
43 lines (36 loc) · 1.47 KB
/
app.plugin.js
File metadata and controls
43 lines (36 loc) · 1.47 KB
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
const { withProjectBuildGradle, withPlugins } = require("expo/config-plugins");
// const ONO_SDK_VERSION = "1.23.6"
// const YOCO_DEVICE_MODULES = [
// "com.yoco.ono.common:kozen-android:" + ONO_SDK_VERSION,
// "com.yoco.ono.android:kozenAndroid:" + ONO_SDK_VERSION,
// "com.yoco.ono.common:dspread-android:" + ONO_SDK_VERSION,
// "com.yoco.ono.common:miura-android:" + ONO_SDK_VERSION,
// "com.yoco.ono.common:datecs-android:" + ONO_SDK_VERSION,
// "com.yoco.ono.android:dspreadAndroid:" + ONO_SDK_VERSION,
// "com.yoco.ono.android:miuraAndroid:" + ONO_SDK_VERSION,
// "com.yoco.ono.android:datecsAndroid:" + ONO_SDK_VERSION,
// ]
/**
*
* @param {import("@expo/config-types").ExpoConfig} config
* @param {"default" | "device"} buildType
*/
const androidPlugin = (config) => {
return withProjectBuildGradle(config, (config) => {
const allProjectsRepositoriesPattern =
/allprojects\s*{(?:\s|\S)*?repositories(?:\s|\S){\s/;
const yocoDependenciesUrlString =
"maven { url 'https://yocotechnologies.jfrog.io/artifactory/public/' }\n";
if (!config.modResults.contents.includes(yocoDependenciesUrlString)) {
config.modResults.contents = config.modResults.contents.replace(
allProjectsRepositoriesPattern,
(match) => `${match}${" ".repeat(2 * 4)}${yocoDependenciesUrlString}\n`
);
}
return config;
});
};
const withYocoSDK = (config) => {
return withPlugins(config, [androidPlugin]);
};
module.exports = withYocoSDK;