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.

168 lines
5.7 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
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 62
  19. versionName '19.2.1'
  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. android.applicationVariants.all { variant ->
  62. if (variant.flavorName != "github") return
  63. variant.outputs.all { output ->
  64. def builtType = variant.buildType.name
  65. def versionName = variant.versionName
  66. // def versionCode = variant.versionCode
  67. def flavor = variant.flavorName
  68. def suffix = "${versionName}-${flavor}_${builtType}" // eg. 19.1.0-github_debug or release
  69. if (builtType.toString() == 'release' && project.hasProperty("pre")) {
  70. buildConfigField("boolean", "isPre", "true")
  71. // append latest commit short hash for pre-release
  72. suffix = "${versionName}.${getGitHash()}-${flavor}" // eg. 19.1.0.b123456-github
  73. }
  74. output.versionNameOverride = suffix
  75. outputFileName = "barinsta_${suffix}.apk"
  76. }
  77. }
  78. }
  79. configurations.all {
  80. resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
  81. }
  82. dependencies {
  83. coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
  84. def appcompat_version = "1.2.0"
  85. def nav_version = '2.3.4'
  86. def exoplayer_version = '2.13.3'
  87. implementation 'com.google.android.material:material:1.4.0-alpha02'
  88. implementation "com.google.android.exoplayer:exoplayer-core:$exoplayer_version"
  89. implementation "com.google.android.exoplayer:exoplayer-dash:$exoplayer_version"
  90. implementation "com.google.android.exoplayer:exoplayer-ui:$exoplayer_version"
  91. implementation "androidx.appcompat:appcompat:$appcompat_version"
  92. implementation "androidx.appcompat:appcompat-resources:$appcompat_version"
  93. implementation "androidx.recyclerview:recyclerview:1.2.0-rc01"
  94. implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
  95. implementation "androidx.viewpager2:viewpager2:1.0.0"
  96. implementation "androidx.navigation:navigation-fragment:$nav_version"
  97. implementation "androidx.navigation:navigation-ui:$nav_version"
  98. implementation "androidx.constraintlayout:constraintlayout:2.0.4"
  99. implementation "androidx.preference:preference:1.1.1"
  100. implementation "androidx.work:work-runtime:2.5.0"
  101. implementation 'androidx.palette:palette:1.0.0'
  102. implementation "androidx.lifecycle:lifecycle-extensions:2.2.0"
  103. implementation 'com.google.guava:guava:27.0.1-android'
  104. // Room
  105. def room_version = "2.2.6"
  106. implementation "androidx.room:room-runtime:$room_version"
  107. implementation "androidx.room:room-guava:$room_version"
  108. annotationProcessor "androidx.room:room-compiler:$room_version"
  109. // CameraX
  110. def camerax_version = "1.1.0-alpha03"
  111. implementation "androidx.camera:camera-camera2:$camerax_version"
  112. implementation "androidx.camera:camera-lifecycle:$camerax_version"
  113. implementation "androidx.camera:camera-view:1.0.0-alpha22"
  114. // EmojiCompat
  115. def emoji_compat_version = "1.1.0"
  116. implementation "androidx.emoji:emoji:$emoji_compat_version"
  117. implementation "androidx.emoji:emoji-appcompat:$emoji_compat_version"
  118. implementation 'me.austinhuang:AutoLinkTextViewV2:-SNAPSHOT'
  119. implementation 'com.facebook.fresco:fresco:2.3.0'
  120. implementation 'com.facebook.fresco:animated-webp:2.3.0'
  121. implementation 'com.facebook.fresco:webpsupport:2.3.0'
  122. implementation 'com.squareup.retrofit2:retrofit:2.9.0'
  123. implementation 'com.squareup.retrofit2:converter-scalars:2.9.0'
  124. implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
  125. implementation 'org.apache.commons:commons-imaging:1.0-alpha2'
  126. implementation 'com.github.ammargitham:uCrop:2.3-native-beta-2'
  127. implementation 'com.github.ammargitham:android-gpuimage:2.1.1-beta4'
  128. debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.7'
  129. githubImplementation 'io.sentry:sentry-android:4.3.0'
  130. testImplementation 'org.junit.jupiter:junit-jupiter:5.7.1'
  131. }