build.gradle 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. def localProperties = new Properties()
  2. def localPropertiesFile = rootProject.file('local.properties')
  3. if (localPropertiesFile.exists()) {
  4. localPropertiesFile.withReader('UTF-8') { reader ->
  5. localProperties.load(reader)
  6. }
  7. }
  8. def flutterRoot = localProperties.getProperty('flutter.sdk')
  9. if (flutterRoot == null) {
  10. throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
  11. }
  12. def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
  13. if (flutterVersionCode == null) {
  14. flutterVersionCode = '1'
  15. }
  16. def flutterVersionName = localProperties.getProperty('flutter.versionName')
  17. if (flutterVersionName == null) {
  18. flutterVersionName = '1.0'
  19. }
  20. apply plugin: 'com.android.application'
  21. apply plugin: 'kotlin-android'
  22. apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
  23. def keystoreProperties = new Properties()
  24. def keystorePropertiesFile = rootProject.file('key.properties')
  25. if (keystorePropertiesFile.exists()) {
  26. keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
  27. }
  28. android {
  29. compileSdkVersion 33
  30. sourceSets {
  31. main.java.srcDirs += 'src/main/kotlin'
  32. }
  33. lintOptions {
  34. disable 'InvalidPackage'
  35. warningsAsErrors false
  36. checkReleaseBuilds false
  37. }
  38. defaultConfig {
  39. applicationId "io.ente.auth"
  40. minSdkVersion 20
  41. targetSdkVersion 33
  42. versionCode flutterVersionCode.toInteger()
  43. versionName flutterVersionName
  44. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  45. multiDexEnabled true
  46. }
  47. signingConfigs {
  48. release {
  49. storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : file(System.getenv("SIGNING_KEY_PATH"))
  50. keyAlias keystoreProperties['keyAlias'] ? keystoreProperties['keyAlias'] : System.getenv("SIGNING_KEY_ALIAS")
  51. keyPassword keystoreProperties['keyPassword'] ? keystoreProperties['keyPassword'] : System.getenv("SIGNING_KEY_PASSWORD")
  52. storePassword keystoreProperties['storePassword'] ? keystoreProperties['storePassword'] : System.getenv("SIGNING_STORE_PASSWORD")
  53. }
  54. }
  55. flavorDimensions "default"
  56. productFlavors {
  57. independent {
  58. dimension "default"
  59. applicationIdSuffix ".independent"
  60. }
  61. playstore {
  62. dimension "default"
  63. }
  64. fdroid {
  65. dimension "default"
  66. }
  67. }
  68. buildTypes {
  69. release {
  70. signingConfig signingConfigs.release
  71. }
  72. debug {
  73. applicationIdSuffix '.debug'
  74. versionNameSuffix "-debug"
  75. externalNativeBuild {
  76. cmake {
  77. arguments "-DANDROID_PACKAGE_NAME=${android.defaultConfig.applicationId}${applicationIdSuffix}"
  78. }
  79. }
  80. }
  81. }
  82. android.applicationVariants.all { variant ->
  83. if (variant.flavorName == "fdroid") {
  84. variant.outputs.all { output ->
  85. output.outputFileName = "app-fdroid-release.apk"
  86. }
  87. }
  88. }
  89. }
  90. flutter {
  91. source '../..'
  92. }
  93. dependencies {
  94. implementation 'io.sentry:sentry-android:2.0.0'
  95. implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
  96. implementation 'com.android.support:multidex:1.0.3'
  97. implementation 'com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava'
  98. testImplementation 'junit:junit:4.12'
  99. androidTestImplementation 'androidx.test:runner:1.1.1'
  100. androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
  101. }