Skip to content

Commit d4eb550

Browse files
committed
Fix jitpack not added to sources
1 parent 9bc292f commit d4eb550

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

expo-plugin/src/android/withOpacityProjectBuildGradle.ts

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,27 @@ import {
55

66
export const withOpacityProjectBuildGradle: ConfigPlugin = (config) => {
77
return withProjectBuildGradle(config, async (config) => {
8-
if (!config.modResults.contents.match('maven.mozilla.org')) {
9-
config.modResults.contents = config.modResults.contents.replace(
8+
let { contents } = config.modResults;
9+
10+
// Add Mozilla maven repository if not present
11+
if (!contents.match('maven.mozilla.org')) {
12+
contents = contents.replace(
1013
/mavenCentral\(\)/g,
11-
`
12-
mavenCentral()
14+
`mavenCentral()
1315
maven { url "https://maven.mozilla.org/maven2/" }`
1416
);
1517
}
18+
19+
// Add jitpack repository if not present
20+
if (!contents.match('jitpack.io')) {
21+
contents = contents.replace(
22+
/mavenCentral\(\)/g,
23+
`mavenCentral()
24+
maven { url 'https://jitpack.io' }`
25+
);
26+
}
27+
28+
config.modResults.contents = contents;
1629
return config;
1730
});
1831
};

0 commit comments

Comments
 (0)