2020-07-01 17:08:28 +00:00
|
|
|
apply plugin: 'com.android.application'
|
2021-05-22 08:58:18 +00:00
|
|
|
apply plugin: 'kotlin-android'
|
2020-08-17 13:49:51 +00:00
|
|
|
apply plugin: "androidx.navigation.safeargs"
|
2021-06-08 13:39:00 +00:00
|
|
|
apply plugin: 'kotlin-kapt'
|
2021-03-21 13:50:23 +00:00
|
|
|
apply from: 'sentry.gradle'
|
2020-07-01 17:08:28 +00:00
|
|
|
|
2021-03-26 15:40:08 +00:00
|
|
|
def getGitHash = { ->
|
|
|
|
def stdout = new ByteArrayOutputStream()
|
|
|
|
exec {
|
|
|
|
commandLine 'git', 'rev-parse', '--short', 'HEAD'
|
|
|
|
standardOutput = stdout
|
|
|
|
}
|
|
|
|
return stdout.toString().trim()
|
|
|
|
}
|
|
|
|
|
2020-07-01 17:08:28 +00:00
|
|
|
android {
|
2021-04-01 16:42:21 +00:00
|
|
|
compileSdkVersion 30
|
2020-07-01 17:08:28 +00:00
|
|
|
|
|
|
|
defaultConfig {
|
2020-11-07 16:55:44 +00:00
|
|
|
applicationId 'me.austinhuang.instagrabber'
|
2020-07-01 17:08:28 +00:00
|
|
|
|
2020-09-21 12:02:18 +00:00
|
|
|
minSdkVersion 21
|
2021-04-01 16:42:21 +00:00
|
|
|
targetSdkVersion 30
|
2020-07-01 17:08:28 +00:00
|
|
|
|
2021-06-21 19:55:35 +00:00
|
|
|
versionCode 64
|
|
|
|
versionName '19.2.3'
|
2020-07-01 17:08:28 +00:00
|
|
|
|
|
|
|
multiDexEnabled true
|
|
|
|
|
|
|
|
vectorDrawables.useSupportLibrary = true
|
|
|
|
vectorDrawables.generatedDensities = []
|
2020-12-08 11:15:52 +00:00
|
|
|
|
|
|
|
javaCompileOptions {
|
|
|
|
annotationProcessorOptions {
|
|
|
|
arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
|
|
|
|
}
|
|
|
|
}
|
2021-04-13 15:17:23 +00:00
|
|
|
|
|
|
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
|
|
}
|
|
|
|
|
|
|
|
sourceSets {
|
|
|
|
androidTest.assets.srcDirs += files("$projectDir/schemas".toString())
|
2020-07-01 17:08:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
compileOptions {
|
2020-10-17 10:07:03 +00:00
|
|
|
// Flag to enable support for the new language APIs
|
|
|
|
coreLibraryDesugaringEnabled true
|
|
|
|
|
2020-07-01 17:08:28 +00:00
|
|
|
targetCompatibility JavaVersion.VERSION_1_8
|
|
|
|
sourceCompatibility JavaVersion.VERSION_1_8
|
|
|
|
}
|
|
|
|
|
|
|
|
buildFeatures { viewBinding true }
|
|
|
|
|
|
|
|
aaptOptions { additionalParameters '--no-version-vectors' }
|
|
|
|
|
|
|
|
buildTypes {
|
2020-12-05 20:17:46 +00:00
|
|
|
debug {
|
2021-03-15 02:49:17 +00:00
|
|
|
minifyEnabled true
|
|
|
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
2020-12-05 20:17:46 +00:00
|
|
|
}
|
|
|
|
|
2020-07-01 17:08:28 +00:00
|
|
|
release {
|
2020-12-05 20:17:46 +00:00
|
|
|
minifyEnabled true
|
2020-07-01 17:08:28 +00:00
|
|
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-03-21 13:50:23 +00:00
|
|
|
flavorDimensions "repo"
|
|
|
|
|
|
|
|
productFlavors {
|
|
|
|
github {
|
|
|
|
dimension "repo"
|
2021-03-26 15:40:08 +00:00
|
|
|
// versionNameSuffix "-github" // appended in assemble task
|
2021-03-21 13:50:23 +00:00
|
|
|
buildConfigField("String", "dsn", SENTRY_DSN)
|
2021-03-28 14:32:27 +00:00
|
|
|
buildConfigField("boolean", "isPre", "false")
|
2021-03-21 13:50:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fdroid {
|
|
|
|
dimension "repo"
|
|
|
|
versionNameSuffix "-fdroid"
|
2021-03-28 14:32:27 +00:00
|
|
|
buildConfigField("boolean", "isPre", "false")
|
2021-03-21 13:50:23 +00:00
|
|
|
}
|
|
|
|
}
|
2021-03-26 13:30:55 +00:00
|
|
|
|
2021-04-03 13:17:23 +00:00
|
|
|
splits {
|
|
|
|
// Configures multiple APKs based on ABI.
|
|
|
|
abi {
|
|
|
|
// Enables building multiple APKs per ABI.
|
2021-05-09 15:54:06 +00:00
|
|
|
enable project.hasProperty("split") && !gradle.startParameter.taskNames.isEmpty() && gradle.startParameter.taskNames.get(0).contains('Release')
|
2021-04-03 13:17:23 +00:00
|
|
|
|
|
|
|
// By default all ABIs are included, so use reset() and include to specify that we only
|
|
|
|
// want APKs for x86 and x86_64.
|
|
|
|
|
|
|
|
// Resets the list of ABIs that Gradle should create APKs for to none.
|
|
|
|
reset()
|
|
|
|
|
|
|
|
// Specifies a list of ABIs that Gradle should create APKs for.
|
|
|
|
include "x86", "x86_64", "arm64-v8a", "armeabi-v7a"
|
|
|
|
|
|
|
|
// Specifies that we want to also generate a universal APK that includes all ABIs.
|
|
|
|
universalApk true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-03-26 13:30:55 +00:00
|
|
|
android.applicationVariants.all { variant ->
|
|
|
|
if (variant.flavorName != "github") return
|
|
|
|
variant.outputs.all { output ->
|
|
|
|
def builtType = variant.buildType.name
|
|
|
|
def versionName = variant.versionName
|
|
|
|
// def versionCode = variant.versionCode
|
2021-03-26 15:40:08 +00:00
|
|
|
def flavor = variant.flavorName
|
|
|
|
|
2021-04-03 13:17:23 +00:00
|
|
|
def flavorBuiltType = "${flavor}_${builtType}"
|
|
|
|
def suffix
|
|
|
|
// For x86 and x86_64, the versionNames are already overridden
|
|
|
|
if (versionName.contains(flavorBuiltType)) {
|
|
|
|
suffix = "${versionName}"
|
|
|
|
} else {
|
|
|
|
suffix = "${versionName}-${flavorBuiltType}" // eg. 19.1.0-github_debug or release
|
|
|
|
}
|
2021-03-26 15:40:08 +00:00
|
|
|
if (builtType.toString() == 'release' && project.hasProperty("pre")) {
|
2021-03-28 14:32:27 +00:00
|
|
|
buildConfigField("boolean", "isPre", "true")
|
2021-04-03 13:17:23 +00:00
|
|
|
|
|
|
|
flavorBuiltType = "${getGitHash()}-${flavor}"
|
|
|
|
|
|
|
|
// For x86 and x86_64, the versionNames are already overridden
|
|
|
|
if (versionName.contains(flavorBuiltType)) {
|
|
|
|
suffix = "${versionName}"
|
|
|
|
} else {
|
|
|
|
// append latest commit short hash for pre-release
|
|
|
|
suffix = "${versionName}.${flavorBuiltType}" // eg. 19.1.0.b123456-github
|
|
|
|
}
|
2021-03-26 15:40:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
output.versionNameOverride = suffix
|
2021-04-03 13:17:23 +00:00
|
|
|
def abi = output.getFilter(com.android.build.OutputFile.ABI)
|
|
|
|
// println(abi + ", " + versionName + ", " + flavor + ", " + builtType + ", " + suffix)
|
|
|
|
outputFileName = abi == null ? "barinsta_${suffix}.apk" : "barinsta_${suffix}_${abi}.apk"
|
2021-03-26 13:30:55 +00:00
|
|
|
}
|
|
|
|
}
|
2021-04-13 15:17:23 +00:00
|
|
|
|
|
|
|
packagingOptions {
|
|
|
|
// Exclude file to avoid
|
|
|
|
// Error: Duplicate files during packaging of APK
|
|
|
|
exclude 'META-INF/LICENSE.md'
|
|
|
|
exclude 'META-INF/LICENSE-notice.md'
|
2021-06-08 13:39:00 +00:00
|
|
|
exclude 'META-INF/atomicfu.kotlin_module'
|
2021-04-13 15:17:23 +00:00
|
|
|
}
|
2021-06-05 10:36:00 +00:00
|
|
|
|
|
|
|
testOptions.unitTests {
|
|
|
|
includeAndroidResources = true
|
|
|
|
}
|
|
|
|
|
2021-03-21 13:50:23 +00:00
|
|
|
}
|
2020-10-24 09:10:21 +00:00
|
|
|
|
|
|
|
configurations.all {
|
|
|
|
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
|
|
|
|
}
|
|
|
|
|
2020-07-01 17:08:28 +00:00
|
|
|
dependencies {
|
2021-02-27 16:13:47 +00:00
|
|
|
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
|
2020-10-17 10:07:03 +00:00
|
|
|
|
2021-06-21 21:35:13 +00:00
|
|
|
def exoplayer_version = '2.14.1'
|
2020-08-29 08:01:42 +00:00
|
|
|
|
2021-07-02 15:21:17 +00:00
|
|
|
implementation 'com.google.android.material:material:1.4.0'
|
2020-11-05 18:34:01 +00:00
|
|
|
|
2021-01-06 03:10:54 +00:00
|
|
|
implementation "com.google.android.exoplayer:exoplayer-core:$exoplayer_version"
|
|
|
|
implementation "com.google.android.exoplayer:exoplayer-dash:$exoplayer_version"
|
|
|
|
implementation "com.google.android.exoplayer:exoplayer-ui:$exoplayer_version"
|
2020-09-12 06:35:10 +00:00
|
|
|
|
2021-06-28 20:27:09 +00:00
|
|
|
implementation "androidx.recyclerview:recyclerview:1.2.1"
|
2020-08-29 08:01:42 +00:00
|
|
|
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
|
|
|
|
implementation "androidx.viewpager2:viewpager2:1.0.0"
|
2020-11-01 06:02:54 +00:00
|
|
|
implementation "androidx.constraintlayout:constraintlayout:2.0.4"
|
2020-10-17 10:07:03 +00:00
|
|
|
implementation "androidx.preference:preference:1.1.1"
|
2020-11-01 06:02:54 +00:00
|
|
|
implementation 'androidx.palette:palette:1.0.0'
|
2021-06-30 21:44:48 +00:00
|
|
|
implementation 'androidx.documentfile:documentfile:1.0.1'
|
2020-10-17 10:07:03 +00:00
|
|
|
|
2021-03-21 13:50:23 +00:00
|
|
|
implementation 'com.google.guava:guava:27.0.1-android'
|
2020-08-30 06:47:04 +00:00
|
|
|
|
2021-06-30 20:19:31 +00:00
|
|
|
def core_version = "1.6.0"
|
2021-05-13 15:53:23 +00:00
|
|
|
implementation "androidx.core:core:$core_version"
|
|
|
|
|
2021-05-31 11:55:22 +00:00
|
|
|
// Fragment
|
2021-06-28 18:54:35 +00:00
|
|
|
implementation "androidx.fragment:fragment-ktx:1.3.5"
|
2021-05-24 22:36:47 +00:00
|
|
|
|
2021-05-31 11:55:22 +00:00
|
|
|
// Lifecycle
|
|
|
|
implementation "androidx.lifecycle:lifecycle-extensions:2.2.0"
|
|
|
|
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1"
|
2021-06-23 11:52:45 +00:00
|
|
|
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.3.1"
|
2021-05-31 11:55:22 +00:00
|
|
|
|
2021-07-03 12:36:34 +00:00
|
|
|
// Navigation
|
|
|
|
implementation "androidx.navigation:navigation-fragment-ktx:$rootProject.nav_version"
|
|
|
|
implementation "androidx.navigation:navigation-ui-ktx:$rootProject.nav_version"
|
|
|
|
|
2020-12-05 20:17:46 +00:00
|
|
|
// Room
|
2021-05-09 22:04:14 +00:00
|
|
|
def room_version = "2.3.0"
|
2020-12-05 20:17:46 +00:00
|
|
|
implementation "androidx.room:room-runtime:$room_version"
|
|
|
|
implementation "androidx.room:room-guava:$room_version"
|
2021-06-06 11:59:56 +00:00
|
|
|
implementation "androidx.room:room-ktx:$room_version"
|
2021-06-08 13:39:00 +00:00
|
|
|
kapt "androidx.room:room-compiler:$room_version"
|
2020-12-05 20:17:46 +00:00
|
|
|
annotationProcessor "androidx.room:room-compiler:$room_version"
|
|
|
|
|
2021-01-02 02:54:32 +00:00
|
|
|
// CameraX
|
2021-06-30 17:11:30 +00:00
|
|
|
def camerax_version = "1.1.0-alpha06"
|
2021-01-02 02:54:32 +00:00
|
|
|
implementation "androidx.camera:camera-camera2:$camerax_version"
|
|
|
|
implementation "androidx.camera:camera-lifecycle:$camerax_version"
|
2021-06-30 18:24:05 +00:00
|
|
|
implementation "androidx.camera:camera-view:1.0.0-alpha26"
|
2021-01-02 02:54:32 +00:00
|
|
|
|
|
|
|
// EmojiCompat
|
|
|
|
def emoji_compat_version = "1.1.0"
|
|
|
|
implementation "androidx.emoji:emoji:$emoji_compat_version"
|
|
|
|
implementation "androidx.emoji:emoji-appcompat:$emoji_compat_version"
|
2020-08-17 13:49:51 +00:00
|
|
|
|
2021-06-01 23:09:22 +00:00
|
|
|
// Work
|
|
|
|
def work_version = '2.5.0'
|
|
|
|
implementation "androidx.work:work-runtime:$work_version"
|
|
|
|
implementation "androidx.work:work-runtime-ktx:$work_version"
|
|
|
|
|
2021-06-03 11:40:13 +00:00
|
|
|
implementation "ru.gildor.coroutines:kotlin-coroutines-okhttp:1.0"
|
2020-08-17 13:49:51 +00:00
|
|
|
|
2021-06-21 21:35:13 +00:00
|
|
|
implementation 'com.facebook.fresco:fresco:2.5.0'
|
|
|
|
implementation 'com.facebook.fresco:animated-webp:2.5.0'
|
|
|
|
implementation 'com.facebook.fresco:webpsupport:2.5.0'
|
2020-07-01 17:08:28 +00:00
|
|
|
|
2020-08-29 08:01:42 +00:00
|
|
|
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
|
|
|
implementation 'com.squareup.retrofit2:converter-scalars:2.9.0'
|
2020-08-30 06:47:04 +00:00
|
|
|
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
2020-09-11 16:56:15 +00:00
|
|
|
|
2020-11-10 12:43:53 +00:00
|
|
|
implementation 'org.apache.commons:commons-imaging:1.0-alpha2'
|
2021-04-25 11:58:02 +00:00
|
|
|
|
2021-07-02 19:59:12 +00:00
|
|
|
implementation 'com.github.skydoves:balloon:1.3.5'
|
2021-05-08 11:22:26 +00:00
|
|
|
|
2021-05-23 00:12:00 +00:00
|
|
|
implementation 'com.github.ammargitham:AutoLinkTextViewV2:3.2.0'
|
2021-01-02 02:54:32 +00:00
|
|
|
implementation 'com.github.ammargitham:uCrop:2.3-native-beta-2'
|
|
|
|
implementation 'com.github.ammargitham:android-gpuimage:2.1.1-beta4'
|
2020-11-05 18:34:01 +00:00
|
|
|
|
2021-03-26 19:19:16 +00:00
|
|
|
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.7'
|
2020-10-17 10:07:03 +00:00
|
|
|
|
2021-06-07 10:15:56 +00:00
|
|
|
githubImplementation 'io.sentry:sentry-android:5.0.1'
|
2021-03-26 15:40:08 +00:00
|
|
|
|
2021-05-19 17:18:04 +00:00
|
|
|
testImplementation 'org.junit.jupiter:junit-jupiter:5.7.2'
|
2021-06-05 10:36:00 +00:00
|
|
|
testImplementation "androidx.test.ext:junit-ktx:1.1.2"
|
|
|
|
testImplementation "androidx.test:core-ktx:1.3.0"
|
2021-06-13 11:52:03 +00:00
|
|
|
testImplementation "androidx.arch.core:core-testing:2.1.0"
|
2021-06-05 10:36:00 +00:00
|
|
|
testImplementation "org.robolectric:robolectric:4.5.1"
|
2021-06-23 11:52:45 +00:00
|
|
|
testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.5.0'
|
2021-04-13 15:17:23 +00:00
|
|
|
|
2021-06-13 11:52:03 +00:00
|
|
|
androidTestImplementation 'org.junit.jupiter:junit-jupiter:5.7.2'
|
2021-04-13 15:17:23 +00:00
|
|
|
androidTestImplementation 'androidx.test:core:1.3.0'
|
|
|
|
androidTestImplementation 'com.android.support:support-annotations:28.0.0'
|
|
|
|
androidTestImplementation 'com.android.support.test:runner:1.0.2'
|
2021-05-14 17:34:15 +00:00
|
|
|
androidTestImplementation "androidx.room:room-testing:2.3.0"
|
2021-04-13 15:17:23 +00:00
|
|
|
|
2020-07-01 17:08:28 +00:00
|
|
|
}
|