build.gradle 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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. maven {
  64. url 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
  65. }
  66. }
  67. dependencies {
  68. compileOnly fileTree(include: ['*.jar','*.aar'], dir: 'libs')
  69. implementation "com.facebook.react:react-native:+"
  70. api "com.compdf:compdfkit:2.1.3"
  71. api "com.compdf:compdfkit-ui:2.1.3"
  72. api "com.compdf:compdfkit-tools:2.1.3"
  73. api 'com.github.bumptech.glide:glide:4.15.1'
  74. annotationProcessor 'com.github.bumptech.glide:compiler:4.15.1'
  75. api 'androidx.documentfile:documentfile:1.0.1'
  76. api 'androidx.appcompat:appcompat:1.6.1'
  77. api 'com.google.android.material:material:1.8.0'
  78. api 'androidx.constraintlayout:constraintlayout:2.1.4'
  79. }