gradle: add pure productFlavor which contains no google libs

This commit is contained in:
PeratX 2019-07-15 17:42:45 +08:00
parent 3fc25ed2fe
commit 70be7128d0
4 changed files with 26 additions and 48 deletions

View File

@ -16,6 +16,6 @@ android:
- '.+'
script:
- chmod 777 gradlew
- ./gradlew clean assembleDebug
- ./gradlew clean assemblePureDebug
after_success:
- bash <(curl -s https://codecov.io/bash)

View File

@ -22,6 +22,15 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
flavorDimensions "default"
productFlavors {
pure {
dimension "default"
}
google {
dimension "default"
}
}
lintOptions {
checkReleaseBuilds false
abortOnError false
@ -37,6 +46,10 @@ android {
}
}
configurations {
googleReleaseImplementation
}
dependencies {
//Support
implementation 'androidx.appcompat:appcompat:1.1.0-rc01'
@ -51,9 +64,19 @@ dependencies {
implementation 'org.minidns:minidns-client:0.3.4'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.squareup.okhttp3:okhttp:3.14.1'
//Analytics
implementation 'com.google.firebase:firebase-core:17.0.1'
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
googleReleaseImplementation 'com.google.firebase:firebase-core:17.0.1'
googleReleaseImplementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
}
apply plugin: 'com.google.gms.google-services'
android.applicationVariants.all { variant ->
project.tasks.each { t ->
if (!t.name.toLowerCase().contains("googlerelease") &&
(t.name.contains("GoogleServices") || t.name.contains("fabric"))) {
t.enabled = false
}
}
}

View File

@ -1,42 +0,0 @@
{
"project_info": {
"project_number": "364359664562",
"firebase_url": "https://daedalusdebug.firebaseio.com",
"project_id": "daedalusdebug",
"storage_bucket": "daedalusdebug.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:364359664562:android:51675184b44f9aaf",
"android_client_info": {
"package_name": "org.itxtech.daedalus"
}
},
"oauth_client": [
{
"client_id": "364359664562-oukpc6t0mjpgc4jqcmpe5qu4ghf6qjln.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyAq3BS019g5WXKll6ytod_DOszz3ISX4wY"
}
],
"services": {
"analytics_service": {
"status": 1
},
"appinvite_service": {
"status": 1,
"other_platform_oauth_client": []
},
"ads_service": {
"status": 2
}
}
}
],
"configuration_version": "1"
}

View File

@ -12,9 +12,6 @@ buildscript {
classpath 'com.android.tools.build:gradle:3.4.2'
classpath 'com.google.gms:google-services:4.3.0'
classpath 'io.fabric.tools:gradle:1.28.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}