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.

188 lines
6.4 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 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. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  29. }
  30. sourceSets {
  31. androidTest.assets.srcDirs += files("$projectDir/schemas".toString())
  32. }
  33. compileOptions {
  34. // Flag to enable support for the new language APIs
  35. coreLibraryDesugaringEnabled true
  36. targetCompatibility JavaVersion.VERSION_1_8
  37. sourceCompatibility JavaVersion.VERSION_1_8
  38. }
  39. buildFeatures { viewBinding true }
  40. aaptOptions { additionalParameters '--no-version-vectors' }
  41. buildTypes {
  42. debug {
  43. minifyEnabled true
  44. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  45. }
  46. release {
  47. minifyEnabled true
  48. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  49. }
  50. }
  51. flavorDimensions "repo"
  52. productFlavors {
  53. github {
  54. dimension "repo"
  55. // versionNameSuffix "-github" // appended in assemble task
  56. buildConfigField("String", "dsn", SENTRY_DSN)
  57. buildConfigField("boolean", "isPre", "false")
  58. }
  59. fdroid {
  60. dimension "repo"
  61. versionNameSuffix "-fdroid"
  62. buildConfigField("boolean", "isPre", "false")
  63. }
  64. }
  65. android.applicationVariants.all { variant ->
  66. if (variant.flavorName != "github") return
  67. variant.outputs.all { output ->
  68. def builtType = variant.buildType.name
  69. def versionName = variant.versionName
  70. // def versionCode = variant.versionCode
  71. def flavor = variant.flavorName
  72. def suffix = "${versionName}-${flavor}_${builtType}" // eg. 19.1.0-github_debug or release
  73. if (builtType.toString() == 'release' && project.hasProperty("pre")) {
  74. buildConfigField("boolean", "isPre", "true")
  75. // append latest commit short hash for pre-release
  76. suffix = "${versionName}.${getGitHash()}-${flavor}" // eg. 19.1.0.b123456-github
  77. }
  78. output.versionNameOverride = suffix
  79. outputFileName = "barinsta_${suffix}.apk"
  80. }
  81. }
  82. packagingOptions {
  83. // Exclude file to avoid
  84. // Error: Duplicate files during packaging of APK
  85. exclude 'META-INF/LICENSE.md'
  86. exclude 'META-INF/LICENSE-notice.md'
  87. }
  88. }
  89. configurations.all {
  90. resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
  91. }
  92. dependencies {
  93. coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
  94. def appcompat_version = "1.2.0"
  95. def nav_version = '2.3.4'
  96. def exoplayer_version = '2.13.2'
  97. implementation 'com.google.android.material:material:1.4.0-alpha02'
  98. implementation "com.google.android.exoplayer:exoplayer-core:$exoplayer_version"
  99. implementation "com.google.android.exoplayer:exoplayer-dash:$exoplayer_version"
  100. implementation "com.google.android.exoplayer:exoplayer-ui:$exoplayer_version"
  101. implementation "androidx.appcompat:appcompat:$appcompat_version"
  102. implementation "androidx.appcompat:appcompat-resources:$appcompat_version"
  103. implementation "androidx.recyclerview:recyclerview:1.2.0-rc01"
  104. implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
  105. implementation "androidx.viewpager2:viewpager2:1.0.0"
  106. implementation "androidx.navigation:navigation-fragment:$nav_version"
  107. implementation "androidx.navigation:navigation-ui:$nav_version"
  108. implementation "androidx.constraintlayout:constraintlayout:2.0.4"
  109. implementation "androidx.preference:preference:1.1.1"
  110. implementation "androidx.work:work-runtime:2.5.0"
  111. implementation 'androidx.palette:palette:1.0.0'
  112. implementation "androidx.lifecycle:lifecycle-extensions:2.2.0"
  113. implementation 'com.google.guava:guava:27.0.1-android'
  114. // Room
  115. def room_version = "2.2.6"
  116. implementation "androidx.room:room-runtime:$room_version"
  117. implementation "androidx.room:room-guava:$room_version"
  118. annotationProcessor "androidx.room:room-compiler:$room_version"
  119. // CameraX
  120. def camerax_version = "1.1.0-alpha03"
  121. implementation "androidx.camera:camera-camera2:$camerax_version"
  122. implementation "androidx.camera:camera-lifecycle:$camerax_version"
  123. implementation "androidx.camera:camera-view:1.0.0-alpha22"
  124. // EmojiCompat
  125. def emoji_compat_version = "1.1.0"
  126. implementation "androidx.emoji:emoji:$emoji_compat_version"
  127. implementation "androidx.emoji:emoji-appcompat:$emoji_compat_version"
  128. implementation 'me.austinhuang:AutoLinkTextViewV2:-SNAPSHOT'
  129. implementation 'com.facebook.fresco:fresco:2.3.0'
  130. implementation 'com.facebook.fresco:animated-webp:2.3.0'
  131. implementation 'com.facebook.fresco:webpsupport:2.3.0'
  132. implementation 'com.squareup.retrofit2:retrofit:2.9.0'
  133. implementation 'com.squareup.retrofit2:converter-scalars:2.9.0'
  134. implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
  135. implementation 'org.apache.commons:commons-imaging:1.0-alpha2'
  136. implementation 'com.github.ammargitham:uCrop:2.3-native-beta-2'
  137. implementation 'com.github.ammargitham:android-gpuimage:2.1.1-beta4'
  138. debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.7'
  139. githubImplementation 'io.sentry:sentry-android:4.3.0'
  140. testImplementation 'org.junit.jupiter:junit-jupiter:5.7.1'
  141. androidTestImplementation 'org.junit.jupiter:junit-jupiter:5.7.1'
  142. androidTestImplementation 'androidx.test:core:1.3.0'
  143. androidTestImplementation 'com.android.support:support-annotations:28.0.0'
  144. androidTestImplementation 'com.android.support.test:runner:1.0.2'
  145. androidTestImplementation "androidx.room:room-testing:2.2.6"
  146. }