build.gradle 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. apply plugin: "com.android.application"
  2. apply plugin: "com.facebook.react"
  3. /**
  4. * This is the configuration block to customize your React Native Android app.
  5. * By default you don't need to apply any configuration, just uncomment the lines you need.
  6. */
  7. react {
  8. /* Folders */
  9. // The root of your project, i.e. where "package.json" lives. Default is '..'
  10. // root = file("../")
  11. // The folder where the react-native NPM package is. Default is ../node_modules/react-native
  12. // reactNativeDir = file("../node_modules/react-native")
  13. // The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen
  14. // codegenDir = file("../node_modules/@react-native/codegen")
  15. // The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
  16. // cliFile = file("../node_modules/react-native/cli.js")
  17. /* Variants */
  18. // The list of variants to that are debuggable. For those we're going to
  19. // skip the bundling of the JS bundle and the assets. By default is just 'debug'.
  20. // If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.
  21. // debuggableVariants = ["liteDebug", "prodDebug"]
  22. /* Bundling */
  23. // A list containing the node command and its flags. Default is just 'node'.
  24. // nodeExecutableAndArgs = ["node"]
  25. //
  26. // The command to run when bundling. By default is 'bundle'
  27. // bundleCommand = "ram-bundle"
  28. //
  29. // The path to the CLI configuration file. Default is empty.
  30. // bundleConfig = file(../rn-cli.config.js)
  31. //
  32. // The name of the generated asset file containing your JS bundle
  33. // bundleAssetName = "MyApplication.android.bundle"
  34. //
  35. // The entry file for bundle generation. Default is 'index.android.js' or 'index.js'
  36. // entryFile = file("../js/MyApplication.android.js")
  37. //
  38. // A list of extra flags to pass to the 'bundle' commands.
  39. // See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle
  40. // extraPackagerArgs = []
  41. /* Hermes Commands */
  42. // The hermes compiler command to run. By default it is 'hermesc'
  43. // hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc"
  44. //
  45. // The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
  46. // hermesFlags = ["-O", "-output-source-map"]
  47. }
  48. /**
  49. * Set this to true to Run Proguard on Release builds to minify the Java bytecode.
  50. */
  51. def enableProguardInReleaseBuilds = true
  52. /**
  53. * The preferred build flavor of JavaScriptCore (JSC)
  54. *
  55. * For example, to use the international variant, you can use:
  56. * `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
  57. *
  58. * The international variant includes ICU i18n library and necessary data
  59. * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
  60. * give correct results when using with locales other than en-US. Note that
  61. * this variant is about 6MiB larger per architecture than default.
  62. */
  63. def jscFlavor = 'org.webkit:android-jsc:+'
  64. android {
  65. ndkVersion rootProject.ext.ndkVersion
  66. compileSdkVersion rootProject.ext.compileSdkVersion
  67. namespace "com.compdfkit.pdfviewer"
  68. defaultConfig {
  69. applicationId "com.compdfkit.pdfviewer"
  70. minSdkVersion rootProject.ext.minSdkVersion
  71. targetSdkVersion rootProject.ext.targetSdkVersion
  72. versionCode 4
  73. versionName "1.13.0"
  74. }
  75. signingConfigs {
  76. debug {
  77. storeFile file('debug.keystore')
  78. storePassword 'android'
  79. keyAlias 'androiddebugkey'
  80. keyPassword 'android'
  81. }
  82. }
  83. buildTypes {
  84. debug {
  85. signingConfig signingConfigs.debug
  86. }
  87. release {
  88. // Caution! In production, you need to generate your own keystore file.
  89. // see https://reactnative.dev/docs/signed-apk-android.
  90. signingConfig signingConfigs.debug
  91. minifyEnabled enableProguardInReleaseBuilds
  92. proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
  93. }
  94. }
  95. }
  96. dependencies {
  97. implementation fileTree(dir: "libs", include: ["*.jar","*.aar"])
  98. // The version of react-native is set by the React Native Gradle Plugin
  99. implementation("com.facebook.react:react-android")
  100. //noinspection GradleDynamicVersion
  101. implementation "com.facebook.react:react-native:+" // From node_modules
  102. implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
  103. api 'com.compdf:compdfkit:1.13.0'
  104. api 'com.compdf:compdfkit-ui:1.13.0'
  105. api 'com.compdf:compdfkit-tools:1.13.0'
  106. api 'com.github.bumptech.glide:glide:4.15.1'
  107. annotationProcessor 'com.github.bumptech.glide:compiler:4.15.1'
  108. implementation 'androidx.documentfile:documentfile:1.0.1'
  109. implementation 'androidx.appcompat:appcompat:1.6.1'
  110. implementation 'com.google.android.material:material:1.8.0'
  111. debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
  112. debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
  113. exclude group:'com.squareup.okhttp3', module:'okhttp'
  114. }
  115. debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}")
  116. if (hermesEnabled.toBoolean()) {
  117. implementation("com.facebook.react:hermes-android")
  118. } else {
  119. implementation jscFlavor
  120. }
  121. }
  122. apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)