Skip to content

Commit

Permalink
Merge pull request #339 from wordpress-mobile/feature/prioritize-jitp…
Browse files Browse the repository at this point in the history
…ack-over-unpkg

Prioritize JitPack over the NPM CDN and wait on all RN subprojects
  • Loading branch information
hypest authored Dec 10, 2018
2 parents 9c9fd8c + 686dc60 commit 771db65
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions react-native-gutenberg-bridge/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -59,17 +59,17 @@ 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')
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")
}

maven { url "https://jitpack.io" }
}

dependencies {
Expand All @@ -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:+'
}

0 comments on commit 771db65

Please sign in to comment.