2020-07-01 19:08:28 +02:00
|
|
|
apply plugin: 'com.android.application'
|
2020-08-17 15:49:51 +02:00
|
|
|
apply plugin: "androidx.navigation.safeargs"
|
2021-03-21 14:50:23 +01:00
|
|
|
apply from: 'sentry.gradle'
|
2020-07-01 19:08:28 +02:00
|
|
|
|
2021-03-26 16:40:08 +01:00
|
|
|
def getGitHash = { ->
|
|
|
|
def stdout = new ByteArrayOutputStream()
|
|
|
|
exec {
|
|
|
|
commandLine 'git', 'rev-parse', '--short', 'HEAD'
|
|
|
|
standardOutput = stdout
|
|
|
|
}
|
|
|
|
return stdout.toString().trim()
|
|
|
|
}
|
|
|
|
|
2020-07-01 19:08:28 +02:00
|
|
|
android {
|
2021-04-01 18:42:21 +02:00
|
|
|
compileSdkVersion 30
|
2020-07-01 19:08:28 +02:00
|
|
|
|
|
|
|
defaultConfig {
|
2020-11-07 17:55:44 +01:00
|
|
|
applicationId 'me.austinhuang.instagrabber'
|
2020-07-01 19:08:28 +02:00
|
|
|
|
2020-09-21 14:02:18 +02:00
|
|
|
minSdkVersion 21
|
2021-04-01 18:42:21 +02:00
|
|
|
targetSdkVersion 30
|
2020-07-01 19:08:28 +02:00
|
|
|
|
2021-03-17 20:34:56 +01:00
|
|
|
versionCode 60
|
|
|
|
versionName '19.1.0'
|
2020-07-01 19:08:28 +02:00
|
|
|
|
|
|
|
multiDexEnabled true
|
|
|
|
|
|
|
|
vectorDrawables.useSupportLibrary = true
|
|
|
|
vectorDrawables.generatedDensities = []
|
2020-12-08 12:15:52 +01:00
|
|
|
|
|
|
|
javaCompileOptions {
|
|
|
|
annotationProcessorOptions {
|
|
|
|
arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
|
|
|
|
}
|
|
|
|
}
|
2020-07-01 19:08:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
compileOptions {
|
2020-10-17 12:07:03 +02:00
|
|
|
// Flag to enable support for the new language APIs
|
|
|
|
coreLibraryDesugaringEnabled true
|
|
|
|
|
2020-07-01 19:08:28 +02:00
|
|
|
targetCompatibility JavaVersion.VERSION_1_8
|
|
|
|
sourceCompatibility JavaVersion.VERSION_1_8
|
|
|
|
}
|
|
|
|
|
|
|
|
buildFeatures { viewBinding true }
|
|
|
|
|
|
|
|
aaptOptions { additionalParameters '--no-version-vectors' }
|
|
|
|
|
|
|
|
buildTypes {
|
2020-12-05 21:17:46 +01:00
|
|
|
debug {
|
2021-03-15 03:49:17 +01:00
|
|
|
minifyEnabled true
|
|
|
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
2020-12-05 21:17:46 +01:00
|
|
|
}
|
|
|
|
|
2020-07-01 19:08:28 +02:00
|
|
|
release {
|
2020-12-05 21:17:46 +01:00
|
|
|
minifyEnabled true
|
2020-07-01 19:08:28 +02:00
|
|
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-03-21 14:50:23 +01:00
|
|
|
flavorDimensions "repo"
|
|
|
|
|
|
|
|
productFlavors {
|
|
|
|
github {
|
|
|
|
dimension "repo"
|
2021-03-26 16:40:08 +01:00
|
|
|
// versionNameSuffix "-github" // appended in assemble task
|
2021-03-21 14:50:23 +01:00
|
|
|
buildConfigField("String", "dsn", SENTRY_DSN)
|
2021-03-28 16:32:27 +02:00
|
|
|
buildConfigField("boolean", "isPre", "false")
|
2021-03-21 14:50:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
fdroid {
|
|
|
|
dimension "repo"
|
|
|
|
versionNameSuffix "-fdroid"
|
2021-03-28 16:32:27 +02:00
|
|
|
buildConfigField("boolean", "isPre", "false")
|
2021-03-21 14:50:23 +01:00
|
|
|
}
|
|
|
|
}
|
2021-03-26 14:30:55 +01: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 16:40:08 +01:00
|
|
|
def flavor = variant.flavorName
|
|
|
|
|
|
|
|
def suffix = "${versionName}-${flavor}_${builtType}" // eg. 19.1.0-github_debug or release
|
|
|
|
if (builtType.toString() == 'release' && project.hasProperty("pre")) {
|
2021-03-28 16:32:27 +02:00
|
|
|
buildConfigField("boolean", "isPre", "true")
|
2021-03-26 16:40:08 +01:00
|
|
|
// append latest commit short hash for pre-release
|
|
|
|
suffix = "${versionName}.${getGitHash()}-${flavor}" // eg. 19.1.0.b123456-github
|
|
|
|
}
|
|
|
|
|
|
|
|
output.versionNameOverride = suffix
|
|
|
|
outputFileName = "barinsta_${suffix}.apk"
|
2021-03-26 14:30:55 +01:00
|
|
|
}
|
|
|
|
}
|
2021-03-21 14:50:23 +01:00
|
|
|
}
|
2020-10-24 11:10:21 +02:00
|
|
|
|
|
|
|
configurations.all {
|
|
|
|
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
|
|
|
|
}
|
|
|
|
|
2020-07-01 19:08:28 +02:00
|
|
|
dependencies {
|
2021-02-27 17:13:47 +01:00
|
|
|
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
|
2020-10-17 12:07:03 +02:00
|
|
|
|
2020-08-29 10:01:42 +02:00
|
|
|
def appcompat_version = "1.2.0"
|
2021-03-20 02:32:13 +01:00
|
|
|
def nav_version = '2.3.4'
|
2021-03-20 16:13:41 +01:00
|
|
|
def exoplayer_version = '2.13.2'
|
2020-08-29 10:01:42 +02:00
|
|
|
|
2021-03-31 19:37:25 +02:00
|
|
|
implementation 'com.google.android.material:material:1.4.0-alpha02'
|
2020-11-05 19:34:01 +01:00
|
|
|
|
2021-01-06 04:10:54 +01: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 08:35:10 +02:00
|
|
|
|
2020-08-29 10:01:42 +02:00
|
|
|
implementation "androidx.appcompat:appcompat:$appcompat_version"
|
|
|
|
implementation "androidx.appcompat:appcompat-resources:$appcompat_version"
|
2021-03-24 20:54:54 +01:00
|
|
|
implementation "androidx.recyclerview:recyclerview:1.2.0-rc01"
|
2020-08-29 10:01:42 +02:00
|
|
|
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
|
|
|
|
implementation "androidx.viewpager2:viewpager2:1.0.0"
|
2020-08-17 15:49:51 +02:00
|
|
|
implementation "androidx.navigation:navigation-fragment:$nav_version"
|
|
|
|
implementation "androidx.navigation:navigation-ui:$nav_version"
|
2020-11-01 07:02:54 +01:00
|
|
|
implementation "androidx.constraintlayout:constraintlayout:2.0.4"
|
2020-10-17 12:07:03 +02:00
|
|
|
implementation "androidx.preference:preference:1.1.1"
|
2021-02-27 17:13:47 +01:00
|
|
|
implementation "androidx.work:work-runtime:2.5.0"
|
2020-11-01 07:02:54 +01:00
|
|
|
implementation 'androidx.palette:palette:1.0.0'
|
2021-03-13 16:21:31 +01:00
|
|
|
implementation "androidx.lifecycle:lifecycle-extensions:2.2.0"
|
2020-10-17 12:07:03 +02:00
|
|
|
|
2021-03-21 14:50:23 +01:00
|
|
|
implementation 'com.google.guava:guava:27.0.1-android'
|
2020-08-30 08:47:04 +02:00
|
|
|
|
2020-12-05 21:17:46 +01:00
|
|
|
// Room
|
2021-01-02 03:54:32 +01:00
|
|
|
def room_version = "2.2.6"
|
2020-12-05 21:17:46 +01:00
|
|
|
implementation "androidx.room:room-runtime:$room_version"
|
|
|
|
implementation "androidx.room:room-guava:$room_version"
|
|
|
|
annotationProcessor "androidx.room:room-compiler:$room_version"
|
|
|
|
|
2021-01-02 03:54:32 +01:00
|
|
|
// CameraX
|
2021-03-24 18:48:08 +01:00
|
|
|
def camerax_version = "1.1.0-alpha03"
|
2021-01-02 03:54:32 +01:00
|
|
|
implementation "androidx.camera:camera-camera2:$camerax_version"
|
|
|
|
implementation "androidx.camera:camera-lifecycle:$camerax_version"
|
2021-02-27 17:13:47 +01:00
|
|
|
implementation "androidx.camera:camera-view:1.0.0-alpha22"
|
2021-01-02 03:54:32 +01: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 15:49:51 +02:00
|
|
|
|
2020-12-21 20:27:15 +01:00
|
|
|
implementation 'me.austinhuang:AutoLinkTextViewV2:-SNAPSHOT'
|
2020-08-17 15:49:51 +02:00
|
|
|
|
2020-08-29 10:01:42 +02:00
|
|
|
implementation 'com.facebook.fresco:fresco:2.3.0'
|
2020-11-10 14:41:22 +01:00
|
|
|
implementation 'com.facebook.fresco:animated-webp:2.3.0'
|
|
|
|
implementation 'com.facebook.fresco:webpsupport:2.3.0'
|
2020-07-01 19:08:28 +02:00
|
|
|
|
2020-08-29 10:01:42 +02:00
|
|
|
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
|
|
|
implementation 'com.squareup.retrofit2:converter-scalars:2.9.0'
|
2020-08-30 08:47:04 +02:00
|
|
|
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
2020-09-11 18:56:15 +02:00
|
|
|
|
2020-11-10 13:43:53 +01:00
|
|
|
implementation 'org.apache.commons:commons-imaging:1.0-alpha2'
|
2021-04-08 00:51:37 +02:00
|
|
|
implementation 'com.github.ammargitham:uCrop:2.3-beta'
|
2021-01-02 03:54:32 +01:00
|
|
|
implementation 'com.github.ammargitham:android-gpuimage:2.1.1-beta4'
|
2020-11-05 19:34:01 +01:00
|
|
|
|
2021-03-26 20:19:16 +01:00
|
|
|
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.7'
|
2020-10-17 12:07:03 +02:00
|
|
|
|
2021-03-21 14:50:23 +01:00
|
|
|
githubImplementation 'io.sentry:sentry-android:4.3.0'
|
2021-03-26 16:40:08 +01:00
|
|
|
|
2021-03-20 23:22:12 +01:00
|
|
|
testImplementation 'org.junit.jupiter:junit-jupiter:5.7.1'
|
2020-07-01 19:08:28 +02:00
|
|
|
}
|