about summary refs log tree commit diff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/withAndroidNoJitpackPlugin.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/plugins/withAndroidNoJitpackPlugin.js b/plugins/withAndroidNoJitpackPlugin.js
new file mode 100644
index 000000000..959eb1028
--- /dev/null
+++ b/plugins/withAndroidNoJitpackPlugin.js
@@ -0,0 +1,20 @@
+const {withProjectBuildGradle} = require('@expo/config-plugins')
+
+const jitpackRepository = "maven { url 'https://www.jitpack.io' }"
+
+module.exports = function withAndroidNoJitpackPlugin(config) {
+  return withProjectBuildGradle(config, config => {
+    if (!config.modResults.contents.includes(jitpackRepository)) {
+      throw Error(
+        'Expected to find the jitpack string in the config. ' +
+          'You MUST verify whether it was actually removed upstream, ' +
+          'or if the format has changed and this plugin no longer recognizes it.',
+      )
+    }
+    config.modResults.contents = config.modResults.contents.replaceAll(
+      jitpackRepository,
+      '',
+    )
+    return config
+  })
+}