From 03fca796a9e1af5a0ab29715bde49cfd91c85887 Mon Sep 17 00:00:00 2001 From: Stefanos Togkoulidis Date: Mon, 10 Dec 2018 12:51:11 +0200 Subject: [PATCH 1/3] Prioritize Jitpack maven repo over ones in unpkg.com --- react-native-gutenberg-bridge/android/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/react-native-gutenberg-bridge/android/build.gradle b/react-native-gutenberg-bridge/android/build.gradle index fc7a68086d..9cc997323b 100644 --- a/react-native-gutenberg-bridge/android/build.gradle +++ b/react-native-gutenberg-bridge/android/build.gradle @@ -59,6 +59,8 @@ repositories { google() jcenter() + maven { url "https://jitpack.io" } + maven { // All of React Native (JS, Obj-C sources, Android binaries) def rnVersion = readReactNativeVersion('../package.json', 'peerDependencies') @@ -68,8 +70,6 @@ repositories { // Maven repo containing AARs with JSC library built for Android url unpkgOrNodeModules("jsc-android@224109.1.0/dist/", "jsc-android/dist") } - - maven { url "https://jitpack.io" } } dependencies { From 074ae11bc88992e1a001156385604c612ec0ee8c Mon Sep 17 00:00:00 2001 From: Stefanos Togkoulidis Date: Mon, 10 Dec 2018 13:19:33 +0200 Subject: [PATCH 2/3] Use jsdelivr.net as the NPM CDN --- react-native-gutenberg-bridge/android/build.gradle | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/react-native-gutenberg-bridge/android/build.gradle b/react-native-gutenberg-bridge/android/build.gradle index 9cc997323b..05f75b4429 100644 --- a/react-native-gutenberg-bridge/android/build.gradle +++ b/react-native-gutenberg-bridge/android/build.gradle @@ -43,14 +43,14 @@ android { } } -def unpkgOrNodeModules(remotePath, localPath) { +def cdnOrNodeModules(remotePath, localPath) { def url if (rootProject.ext.buildGutenbergFromSource) { url = "${project.buildDir}/../../../node_modules/${localPath}" } else { // if we are the root project, use a remote maven repo so jitpack can build this lib without local RN setup - url = "https://unpkg.com/${remotePath}" - println "Will use the unpkg.com exposed maven repo at ${url}" + url = "https://cdn.jsdelivr.net/npm/${remotePath}" + println "Will use the jsdelivr.net exposed maven repo at ${url}" } return url } @@ -64,11 +64,11 @@ repositories { maven { // All of React Native (JS, Obj-C sources, Android binaries) def rnVersion = readReactNativeVersion('../package.json', 'peerDependencies') - url unpkgOrNodeModules("react-native@${rnVersion}/android", "react-native/android") + url cdnOrNodeModules("react-native@${rnVersion}/android", "react-native/android") } maven { // Maven repo containing AARs with JSC library built for Android - url unpkgOrNodeModules("jsc-android@224109.1.0/dist/", "jsc-android/dist") + url cdnOrNodeModules("jsc-android@224109.1.0/dist/", "jsc-android/dist") } } From 686dc60217b663f401536e8ce00cd4d17808b31a Mon Sep 17 00:00:00 2001 From: Stefanos Togkoulidis Date: Mon, 10 Dec 2018 15:03:51 +0200 Subject: [PATCH 3/3] Wait for JitPack on all RN subprojects --- react-native-gutenberg-bridge/android/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/react-native-gutenberg-bridge/android/build.gradle b/react-native-gutenberg-bridge/android/build.gradle index 05f75b4429..39bfe1e2b7 100644 --- a/react-native-gutenberg-bridge/android/build.gradle +++ b/react-native-gutenberg-bridge/android/build.gradle @@ -79,9 +79,9 @@ dependencies { implementation project(':react-native-aztec') implementation project(':react-native-recyclerview-list') } else { - implementation ('com.github.wordpress-mobile:react-native-svg:faed05be8dca2b0df8957c5f72c40eccef12144d') + implementation (waitJitpack('com.github.wordpress-mobile', 'react-native-svg', 'faed05be8dca2b0df8957c5f72c40eccef12144d')) implementation (waitJitpack('com.github.wordpress-mobile', 'react-native-aztec', submoduleGitHash('../../', 'react-native-aztec'))) - implementation ('com.github.wordpress-mobile:react-native-recyclerview-list:a2e8ca550412504c32218fd473c55f696f18f1f7') + implementation (waitJitpack('com.github.wordpress-mobile', 'react-native-recyclerview-list', 'a2e8ca550412504c32218fd473c55f696f18f1f7')) } implementation 'com.facebook.react:react-native:+' }