build.gradle 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. buildscript {
  2. repositories {
  3. google()
  4. mavenCentral()
  5. maven {
  6. url 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
  7. }
  8. }
  9. dependencies {
  10. classpath "com.android.tools.build:gradle:7.2.1"
  11. }
  12. }
  13. def isNewArchitectureEnabled() {
  14. return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
  15. }
  16. apply plugin: "com.android.library"
  17. if (isNewArchitectureEnabled()) {
  18. apply plugin: "com.facebook.react"
  19. }
  20. def getExtOrDefault(name) {
  21. return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["CompdfkitPdf_" + name]
  22. }
  23. def getExtOrIntegerDefault(name) {
  24. return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["CompdfkitPdf_" + name]).toInteger()
  25. }
  26. def supportsNamespace() {
  27. def parsed = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')
  28. def major = parsed[0].toInteger()
  29. def minor = parsed[1].toInteger()
  30. // Namespace support was added in 7.3.0
  31. return (major == 7 && minor >= 3) || major >= 8
  32. }
  33. android {
  34. if (supportsNamespace()) {
  35. namespace "com.compdfkitpdf"
  36. sourceSets {
  37. main {
  38. manifest.srcFile "src/main/AndroidManifestNew.xml"
  39. }
  40. }
  41. }
  42. compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
  43. defaultConfig {
  44. minSdkVersion getExtOrIntegerDefault("minSdkVersion")
  45. targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
  46. }
  47. buildTypes {
  48. release {
  49. minifyEnabled false
  50. }
  51. }
  52. lintOptions {
  53. disable "GradleCompatible"
  54. }
  55. compileOptions {
  56. sourceCompatibility JavaVersion.VERSION_1_8
  57. targetCompatibility JavaVersion.VERSION_1_8
  58. }
  59. }
  60. repositories {
  61. mavenCentral()
  62. google()
  63. mavenLocal()
  64. }
  65. dependencies {
  66. compileOnly fileTree(include: ['*.jar','*.aar'], dir: 'libs')
  67. implementation "com.facebook.react:react-native:+"
  68. api "com.compdf:compdfkit-tools:2.2.1"
  69. api 'com.github.bumptech.glide:glide:4.15.1'
  70. annotationProcessor 'com.github.bumptech.glide:compiler:4.15.1'
  71. api 'androidx.documentfile:documentfile:1.0.1'
  72. api 'androidx.appcompat:appcompat:1.6.1'
  73. api 'com.google.android.material:material:1.8.0'
  74. api 'androidx.constraintlayout:constraintlayout:2.1.4'
  75. }