Open-source alternative Instagram client on Android. More maintainers needed!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

206 lines
7.3 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. apply plugin: 'com.android.application'
  2. apply plugin: "androidx.navigation.safeargs"
  3. apply from: 'sentry.gradle'
  4. def getGitHash = { ->
  5. def stdout = new ByteArrayOutputStream()
  6. exec {
  7. commandLine 'git', 'rev-parse', '--short', 'HEAD'
  8. standardOutput = stdout
  9. }
  10. return stdout.toString().trim()
  11. }
  12. android {
  13. compileSdkVersion 29
  14. defaultConfig {
  15. applicationId 'me.austinhuang.instagrabber'
  16. minSdkVersion 21
  17. targetSdkVersion 29
  18. versionCode 60
  19. versionName '19.1.0'
  20. multiDexEnabled true
  21. vectorDrawables.useSupportLibrary = true
  22. vectorDrawables.generatedDensities = []
  23. javaCompileOptions {
  24. annotationProcessorOptions {
  25. arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
  26. }
  27. }
  28. }
  29. compileOptions {
  30. // Flag to enable support for the new language APIs
  31. coreLibraryDesugaringEnabled true
  32. targetCompatibility JavaVersion.VERSION_1_8
  33. sourceCompatibility JavaVersion.VERSION_1_8
  34. }
  35. buildFeatures { viewBinding true }
  36. aaptOptions { additionalParameters '--no-version-vectors' }
  37. buildTypes {
  38. debug {
  39. minifyEnabled true
  40. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  41. }
  42. release {
  43. minifyEnabled true
  44. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  45. }
  46. }
  47. flavorDimensions "repo"
  48. productFlavors {
  49. github {
  50. dimension "repo"
  51. // versionNameSuffix "-github" // appended in assemble task
  52. buildConfigField("String", "dsn", SENTRY_DSN)
  53. buildConfigField("boolean", "isPre", "false")
  54. }
  55. fdroid {
  56. dimension "repo"
  57. versionNameSuffix "-fdroid"
  58. buildConfigField("boolean", "isPre", "false")
  59. }
  60. }
  61. splits {
  62. // Configures multiple APKs based on ABI.
  63. abi {
  64. // Enables building multiple APKs per ABI.
  65. enable !project.hasProperty("noAbiSplits") && gradle.startParameter.taskNames.contains("Release")
  66. // By default all ABIs are included, so use reset() and include to specify that we only
  67. // want APKs for x86 and x86_64.
  68. // Resets the list of ABIs that Gradle should create APKs for to none.
  69. reset()
  70. // Specifies a list of ABIs that Gradle should create APKs for.
  71. include "x86", "x86_64", "arm64-v8a", "armeabi-v7a"
  72. // Specifies that we want to also generate a universal APK that includes all ABIs.
  73. universalApk true
  74. }
  75. }
  76. android.applicationVariants.all { variant ->
  77. if (variant.flavorName != "github") return
  78. variant.outputs.all { output ->
  79. def builtType = variant.buildType.name
  80. def versionName = variant.versionName
  81. // def versionCode = variant.versionCode
  82. def flavor = variant.flavorName
  83. def flavorBuiltType = "${flavor}_${builtType}"
  84. def suffix
  85. // For x86 and x86_64, the versionNames are already overridden
  86. if (versionName.contains(flavorBuiltType)) {
  87. suffix = "${versionName}"
  88. } else {
  89. suffix = "${versionName}-${flavorBuiltType}" // eg. 19.1.0-github_debug or release
  90. }
  91. if (builtType.toString() == 'release' && project.hasProperty("pre")) {
  92. buildConfigField("boolean", "isPre", "true")
  93. flavorBuiltType = "${getGitHash()}-${flavor}"
  94. // For x86 and x86_64, the versionNames are already overridden
  95. if (versionName.contains(flavorBuiltType)) {
  96. suffix = "${versionName}"
  97. } else {
  98. // append latest commit short hash for pre-release
  99. suffix = "${versionName}.${flavorBuiltType}" // eg. 19.1.0.b123456-github
  100. }
  101. }
  102. output.versionNameOverride = suffix
  103. def abi = output.getFilter(com.android.build.OutputFile.ABI)
  104. // println(abi + ", " + versionName + ", " + flavor + ", " + builtType + ", " + suffix)
  105. outputFileName = abi == null ? "barinsta_${suffix}.apk" : "barinsta_${suffix}_${abi}.apk"
  106. }
  107. }
  108. }
  109. configurations.all {
  110. resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
  111. }
  112. dependencies {
  113. coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
  114. def appcompat_version = "1.2.0"
  115. def nav_version = '2.3.4'
  116. def exoplayer_version = '2.13.2'
  117. implementation 'com.google.android.material:material:1.4.0-alpha02'
  118. implementation "com.google.android.exoplayer:exoplayer-core:$exoplayer_version"
  119. implementation "com.google.android.exoplayer:exoplayer-dash:$exoplayer_version"
  120. implementation "com.google.android.exoplayer:exoplayer-ui:$exoplayer_version"
  121. implementation "androidx.appcompat:appcompat:$appcompat_version"
  122. implementation "androidx.appcompat:appcompat-resources:$appcompat_version"
  123. implementation "androidx.recyclerview:recyclerview:1.2.0-rc01"
  124. implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
  125. implementation "androidx.viewpager2:viewpager2:1.0.0"
  126. implementation "androidx.navigation:navigation-fragment:$nav_version"
  127. implementation "androidx.navigation:navigation-ui:$nav_version"
  128. implementation "androidx.constraintlayout:constraintlayout:2.0.4"
  129. implementation "androidx.preference:preference:1.1.1"
  130. implementation "androidx.work:work-runtime:2.5.0"
  131. implementation 'androidx.palette:palette:1.0.0'
  132. implementation "androidx.lifecycle:lifecycle-extensions:2.2.0"
  133. implementation 'com.google.guava:guava:27.0.1-android'
  134. // Room
  135. def room_version = "2.2.6"
  136. implementation "androidx.room:room-runtime:$room_version"
  137. implementation "androidx.room:room-guava:$room_version"
  138. annotationProcessor "androidx.room:room-compiler:$room_version"
  139. // CameraX
  140. def camerax_version = "1.1.0-alpha03"
  141. implementation "androidx.camera:camera-camera2:$camerax_version"
  142. implementation "androidx.camera:camera-lifecycle:$camerax_version"
  143. implementation "androidx.camera:camera-view:1.0.0-alpha22"
  144. // EmojiCompat
  145. def emoji_compat_version = "1.1.0"
  146. implementation "androidx.emoji:emoji:$emoji_compat_version"
  147. implementation "androidx.emoji:emoji-appcompat:$emoji_compat_version"
  148. implementation 'me.austinhuang:AutoLinkTextViewV2:-SNAPSHOT'
  149. implementation 'com.facebook.fresco:fresco:2.3.0'
  150. implementation 'com.facebook.fresco:animated-webp:2.3.0'
  151. implementation 'com.facebook.fresco:webpsupport:2.3.0'
  152. implementation 'com.squareup.retrofit2:retrofit:2.9.0'
  153. implementation 'com.squareup.retrofit2:converter-scalars:2.9.0'
  154. implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
  155. implementation 'org.apache.commons:commons-imaging:1.0-alpha2'
  156. implementation 'com.github.ammargitham:uCrop:2.3-native-beta-2'
  157. implementation 'com.github.ammargitham:android-gpuimage:2.1.1-beta4'
  158. debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.7'
  159. githubImplementation 'io.sentry:sentry-android:4.3.0'
  160. testImplementation 'org.junit.jupiter:junit-jupiter:5.7.1'
  161. }