mirror of
https://github.com/k0shk0sh/FastHub.git
synced 2026-02-01 15:56:14 +00:00
175 lines
6.9 KiB
Groovy
175 lines
6.9 KiB
Groovy
def taskRequests = getGradle().getStartParameter().getTaskRequests().toString()
|
|
def isGms = taskRequests.contains("Gms") || taskRequests.contains("gms")
|
|
|
|
apply plugin: 'com.android.application'
|
|
if (isGms) {
|
|
apply plugin: 'com.google.firebase.firebase-crash'
|
|
}
|
|
|
|
apply plugin: 'com.novoda.build-properties'
|
|
apply plugin: 'jacoco-android'
|
|
|
|
buildProperties {
|
|
notThere {
|
|
file rootProject.file('debug_gradle.properties')
|
|
}
|
|
secrets {
|
|
file rootProject.file('gradle.properties')
|
|
}
|
|
}
|
|
|
|
android {
|
|
signingConfigs {
|
|
signing {
|
|
keyAlias((buildProperties.secrets['android_key_alias'] | buildProperties.notThere['android_key_alias']).string)
|
|
keyPassword((buildProperties.secrets['android_store_password'] | buildProperties.notThere['android_store_password']).string)
|
|
storeFile file('fastaccess-key')
|
|
storePassword((buildProperties.secrets['android_store_password'] | buildProperties.notThere['android_store_password']).string)
|
|
}
|
|
}
|
|
compileSdkVersion 25
|
|
buildToolsVersion "26-rc1"
|
|
defaultConfig {
|
|
applicationId "com.fastaccess.github"
|
|
minSdkVersion 21
|
|
targetSdkVersion 26
|
|
versionCode 210
|
|
versionName "2.1.0"
|
|
signingConfig signingConfigs.signing
|
|
buildConfigString "GITHUB_CLIENT_ID", (buildProperties.secrets['github_client_id'] | buildProperties.notThere['github_client_id']).string
|
|
buildConfigString "GITHUB_SECRET", (buildProperties.secrets['github_secret'] | buildProperties.notThere['github_secret']).string
|
|
buildConfigString "IMGUR_CLIENT_ID", (buildProperties.secrets['imgur_client_id'] | buildProperties.notThere['imgur_client_id']).string
|
|
buildConfigString "IMGUR_SECRET", (buildProperties.secrets['imgur_secret'] | buildProperties.notThere['imgur_secret']).string
|
|
buildConfigField "String", "REST_URL", '"https://api.github.com/"'
|
|
buildConfigField "String", "IMGUR_URL", '"https://api.imgur.com/3/"'
|
|
multiDexEnabled true
|
|
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
|
javaCompileOptions {
|
|
annotationProcessorOptions {
|
|
includeCompileClasspath true
|
|
}
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
minifyEnabled true
|
|
shrinkResources true
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
}
|
|
}
|
|
|
|
productFlavors {
|
|
// includes gms
|
|
gms {
|
|
buildConfigField "boolean", "FDROID", "false"
|
|
}
|
|
|
|
// only foss
|
|
fdroid {
|
|
buildConfigField "boolean", "FDROID", "true"
|
|
}
|
|
}
|
|
|
|
sourceSets {
|
|
main {
|
|
res.srcDirs = [
|
|
"src/main/res/",
|
|
"src/main/res/layouts/main_layouts",
|
|
"src/main/res/layouts/row_layouts",
|
|
"src/main/res/layouts/other_layouts",
|
|
"src/main/res/translations",
|
|
"src/main/res"
|
|
]
|
|
}
|
|
}
|
|
|
|
lintOptions {
|
|
abortOnError false
|
|
htmlReport true
|
|
xmlReport true
|
|
disable 'InvalidPackage'
|
|
}
|
|
compileOptions {
|
|
sourceCompatibility JavaVersion.VERSION_1_8
|
|
targetCompatibility JavaVersion.VERSION_1_8
|
|
}
|
|
|
|
configurations {
|
|
all*.exclude module: 'annotations'
|
|
}
|
|
|
|
dexOptions {
|
|
jumboMode true
|
|
}
|
|
|
|
testOptions {
|
|
unitTests.returnDefaultValues = true
|
|
}
|
|
}
|
|
|
|
repositories {
|
|
maven { url "https://clojars.org/repo/" }
|
|
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
|
|
maven { url "https://jitpack.io" }
|
|
}
|
|
|
|
dependencies {
|
|
compile fileTree(include: ['*.jar'], dir: 'libs')
|
|
compile "com.android.support:appcompat-v7:${supportVersion}"
|
|
compile "com.android.support:design:${supportVersion}"
|
|
compile "com.android.support:cardview-v7:${supportVersion}"
|
|
compile "com.android.support:recyclerview-v7:${supportVersion}"
|
|
compile "com.android.support:preference-v14:${supportVersion}"
|
|
compile "com.android.support:customtabs:${supportVersion}"
|
|
compile "com.android.support:palette-v7:${supportVersion}"
|
|
compile "net.grandcentrix.thirtyinch:thirtyinch:${thirtyinchVersion}"
|
|
compile "net.grandcentrix.thirtyinch:thirtyinch-rx:${thirtyinchVersion}"
|
|
testCompile "net.grandcentrix.thirtyinch:thirtyinch-test:$thirtyinchVersion"
|
|
compile "com.squareup.retrofit2:retrofit:${retrofit}"
|
|
compile "com.squareup.retrofit2:converter-gson:${retrofit}"
|
|
compile "com.squareup.retrofit2:adapter-rxjava:${retrofit}"
|
|
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
|
|
compile 'cn.gavinliu.android.lib:ShapedImageView:0.8.3'
|
|
compile "frankiesardo:icepick:${icepickVersion}"
|
|
compile "com.jakewharton:butterknife:${butterKnifeVersion}"
|
|
compile 'it.sephiroth.android.library.bottomnavigation:bottom-navigation:2.0.1-rc1'
|
|
compile 'io.reactivex:rxandroid:1.2.1'
|
|
compile 'io.reactivex:rxjava:1.2.2'
|
|
compile 'com.squareup.okhttp3:logging-interceptor:3.3.1'
|
|
compile 'com.annimon:stream:1.1.7'
|
|
compile 'com.github.GrenderG:Toasty:1.1.3'
|
|
compile 'uk.co.samuelwall:material-tap-target-prompt:1.9.2'
|
|
compile 'com.github.k0shk0sh:RetainedDateTimePickers:1.0.2'
|
|
compile 'com.github.daniel-stoneuk:material-about-library:1.8.1'
|
|
compile 'io.requery:requery:1.3.0'
|
|
compile 'io.requery:requery-android:1.3.0'
|
|
compile('com.mikepenz:aboutlibraries:5.9.5@aar') { transitive = true }
|
|
compile 'com.github.nightwhistler:HtmlSpanner:0.4'
|
|
compile 'net.sourceforge.htmlcleaner:htmlcleaner:2.2'
|
|
compile 'com.github.matthiasrobbers:shortbread:1.0.1'
|
|
provided "org.projectlombok:lombok:${lombokVersion}"
|
|
annotationProcessor 'io.requery:requery-processor:1.2.0'
|
|
annotationProcessor "org.projectlombok:lombok:${lombokVersion}"
|
|
annotationProcessor "frankiesardo:icepick-processor:${icepickVersion}"
|
|
annotationProcessor "com.jakewharton:butterknife-compiler:${butterKnifeVersion}"
|
|
annotationProcessor 'com.github.matthiasrobbers:shortbread-compiler:1.0.1'
|
|
if (isGms) {
|
|
compile "com.google.firebase:firebase-ads:${firebase}"
|
|
compile "com.google.firebase:firebase-messaging:${firebase}"
|
|
releaseCompile "com.google.firebase:firebase-crash:${firebase}"
|
|
}
|
|
testCompile "junit:junit:${junitVersion}"
|
|
testCompile "org.mockito:mockito-core:${mockitoVersion}"
|
|
testCompile "org.assertj:assertj-core:${assertjVersion}"
|
|
androidTestCompile "com.android.support:support-annotations:${supportVersion}"
|
|
androidTestCompile "org.mockito:mockito-core:${mockitoVersion}"
|
|
androidTestCompile 'com.android.support.test:runner:0.5'
|
|
androidTestCompile 'com.android.support.test:rules:0.5'
|
|
androidTestCompile "com.android.support.test.espresso:espresso-intents:${espresseVersion}"
|
|
androidTestCompile "com.android.support.test.espresso:espresso-core:${espresseVersion}"
|
|
}
|
|
|
|
if (isGms) {
|
|
apply plugin: 'com.google.gms.google-services'
|
|
} |