Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

build.gradle 1.5 KiB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. // Top-level build file where you can add configuration options common to all sub-projects/modules.
  2. import groovy.json.JsonSlurper
  3. buildscript {
  4. repositories {
  5. google()
  6. jcenter()
  7. }
  8. dependencies {
  9. classpath("com.android.tools.build:gradle:3.5.2")
  10. // NOTE: Do not place your application dependencies here; they belong
  11. // in the individual module build.gradle files
  12. }
  13. }
  14. allprojects {
  15. repositories {
  16. mavenLocal()
  17. maven {
  18. // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
  19. url("$rootDir/../node_modules/react-native/android")
  20. }
  21. maven {
  22. // Android JSC is installed from npm
  23. url("$rootDir/../node_modules/jsc-android/dist")
  24. }
  25. google()
  26. jcenter()
  27. maven { url 'https://www.jitpack.io' }
  28. }
  29. }
  30. ext {
  31. buildToolsVersion = "28.0.3"
  32. minSdkVersion = 21
  33. compileSdkVersion = 28
  34. targetSdkVersion = 28
  35. def npmVersion = getNpmVersionArray()
  36. versionMajor = npmVersion[0]
  37. versionMinor = npmVersion[1]
  38. versionPatch = npmVersion[2]
  39. }
  40. def getNpmVersion() {
  41. def inputFile = new File("../package.json")
  42. def packageJson = new JsonSlurper().parseText(inputFile.text)
  43. return packageJson["version"]
  44. }
  45. def getNpmVersionArray() {
  46. def (major, minor, patch) = getNpmVersion().tokenize('.')
  47. return [Integer.parseInt(major), Integer.parseInt(minor), Integer.parseInt(patch)] as int[]
  48. }