Skip to content

Commit

Permalink
Merge pull request #100 from wordpress-mobile/maven-mirror
Browse files Browse the repository at this point in the history
Use Bintray mirror of RN when building in Jitpack
  • Loading branch information
hypest committed Dec 19, 2018
2 parents 2fd1d34 + 0a7348a commit ff70a7b
Show file tree
Hide file tree
Showing 3 changed files with 281 additions and 462 deletions.
21 changes: 11 additions & 10 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,11 @@ repositories {
maven { url "https://jitpack.io" }

if (project == rootProject) {
// if we are the root project, use a remote RN maven repo so jitpack can build this lib without local RN setup
def rnVersion = readReactNativeVersion('../package.json', 'peerDependencies')
def npmCdnUrl = "https://cdn.jsdelivr.net/npm/react-native@${rnVersion}/android"
println "Will use the jsdelivr.net exposed RN maven repo at ${npmCdnUrl}"
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url npmCdnUrl
}
}
// if we are the root project, use a remote RN maven repo so jitpack can build this lib without local RN setup
def reactNativeRepo = 'https://dl.bintray.com/wordpress-mobile/react-native-mirror/'
println "Will use the RN maven repo at ${reactNativeRepo}"
maven { url reactNativeRepo }
}
}

dependencies {
Expand All @@ -107,5 +103,10 @@ dependencies {
implementation "com.android.support:appcompat-v7:$supportLibVersion"
implementation "com.android.support:recyclerview-v7:$supportLibVersion"

implementation "com.facebook.react:react-native:+" // From node_modules.
if (project == rootProject) {
def rnVersion = readReactNativeVersion('../package.json', 'peerDependencies')
implementation "com.facebook.react:react-native:${rnVersion}" // From Maven repo
} else {
implementation "com.facebook.react:react-native:+" // From node_modules.
}
}
4 changes: 2 additions & 2 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
"clean:install": "yarn clean && yarn install"
},
"dependencies": {
"react": "16.5.0",
"react-native": "0.57.1"
"react": "16.6.1",
"react-native": "0.57.5"
},
"devDependencies": {
"metro-react-native-babel-preset": "^0.45.5",
Expand Down
Loading

0 comments on commit ff70a7b

Please sign in to comment.