12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. def safeExtGet(prop, fallback) {
  2. rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
  3. }
  4. buildscript {
  5. /* In case of submodule usage, do not try to apply own repositories and plugins,
  6. root project is responsible for that. */
  7. if (rootProject.buildDir == project.buildDir) {
  8. repositories {
  9. google()
  10. jcenter()
  11. }
  12. dependencies {
  13. classpath 'com.android.tools.build:gradle:3.4.1'
  14. }
  15. }
  16. }
  17. apply plugin: 'com.android.library'
  18. android {
  19. compileSdkVersion safeExtGet('compileSdkVersion', 28)
  20. buildToolsVersion safeExtGet('buildToolsVersion', '28.0.3')
  21. defaultConfig {
  22. minSdkVersion safeExtGet('minSdkVersion', 16)
  23. targetSdkVersion safeExtGet('targetSdkVersion', 28)
  24. versionCode 1
  25. versionName "1.0"
  26. }
  27. lintOptions {
  28. abortOnError false
  29. }
  30. }
  31. repositories {
  32. google()
  33. jcenter()
  34. mavenLocal()
  35. maven {
  36. // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
  37. url "$rootDir/../node_modules/react-native/android"
  38. }
  39. }
  40. dependencies {
  41. implementation "com.android.support:support-v4:${safeExtGet('supportLibVersion', '27.+')}"
  42. api "com.facebook.react:react-native:${rootProject.ext.reactNative}"
  43. }