0
0
Fork 0
mirror of https://github.com/YTVanced/VancedMicroG synced 2024-11-27 21:53:00 +00:00

Use flavors for mapbox vs vtm

This commit is contained in:
Marvin W 2020-07-09 09:53:37 +02:00
parent 895c74d095
commit 8eff51cfb6
No known key found for this signature in database
GPG key ID: 072E9235DB996F2A
63 changed files with 40 additions and 28 deletions

View file

@ -16,17 +16,12 @@
apply plugin: 'com.android.application'
def useMapbox() {
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
return properties.getProperty("mapbox.enabled", "false") == "true"
configurations {
mapboxImplementation
vtmImplementation
}
dependencies {
implementation "androidx.multidex:multidex:$multidexVersion"
implementation "androidx.appcompat:appcompat:$appcompatVersion"
implementation "androidx.mediarouter:mediarouter:$mediarouterVersion"
implementation "androidx.preference:preference:$preferenceVersion"
implementation "com.squareup.wire:wire-runtime:1.6.1"
implementation "de.hdodenhof:circleimageview:1.3.0"
implementation "org.conscrypt:conscrypt-android:2.1.0"
@ -42,18 +37,21 @@ dependencies {
implementation project(':play-services-base-core')
implementation project(':play-services-location-core')
implementation project(':microg-ui-tools')
implementation project(':play-services-core:microg-ui-tools') // deprecated
implementation project(':play-services-api')
implementation project(':play-services-cast-api')
implementation project(':play-services-wearable')
implementation "org.microg:wearable:$wearableVersion"
implementation "org.microg.gms:remote-droid-guard:$remoteDroidGuardVersion"
if (useMapbox()) {
implementation project(':play-services-maps-core-mapbox')
} else {
implementation project(':play-services-maps-core-vtm')
}
mapboxImplementation project(':play-services-maps-core-mapbox')
vtmImplementation project(':play-services-maps-core-vtm')
// AndroidX UI
implementation "androidx.multidex:multidex:$multidexVersion"
implementation "androidx.appcompat:appcompat:$appcompatVersion"
implementation "androidx.mediarouter:mediarouter:$mediarouterVersion"
implementation "androidx.preference:preference:$preferenceVersion"
// Navigation
implementation "androidx.navigation:navigation-fragment:$navigationVersion"
@ -67,13 +65,13 @@ android {
buildToolsVersion "$androidBuildVersionTools"
defaultConfig {
versionName version + (useMapbox() ? "" : "-vtm")
versionName version
versionCode appVersionCode
minSdkVersion androidMinSdk
targetSdkVersion androidTargetSdk
buildConfigField "boolean", "USE_MAPBOX", "${useMapbox()}"
// buildConfigField "boolean", "USE_MAPBOX", "${useMapbox()}"
multiDexEnabled true
@ -103,6 +101,17 @@ android {
}
}
flavorDimensions 'maps'
productFlavors {
mapbox {
dimension 'maps'
}
vtm {
dimension 'maps'
versionNameSuffix '-vtm'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8

View file

@ -29,7 +29,7 @@ public class AboutFragment extends AbstractAboutFragment {
@Override
protected void collectLibraries(List<AbstractAboutFragment.Library> libraries) {
if (BuildConfig.USE_MAPBOX) {
if (BuildConfig.FLAVOR.contains("mapbox")) {
libraries.add(new AbstractAboutFragment.Library("com.mapbox.mapboxsdk", "Mapbox Maps SDK for Android", "Three-Clause BSD, Mapbox"));
} else {
libraries.add(new AbstractAboutFragment.Library("org.oscim.android", "V™", "GNU LGPLv3, Hannes Janetzek and devemux86"));

View file

@ -17,7 +17,6 @@
apply plugin: "com.android.library"
dependencies {
implementation project(":microg-ui-tools")
implementation project(":play-services-api")
implementation "org.microg:vtm-android:0.9.1-mod"
@ -28,7 +27,9 @@ dependencies {
implementation "org.microg:vtm-android:0.9.1-mod:natives-x86_64"
implementation "org.microg:vtm-extras:0.9.1-mod"
implementation "org.microg:vtm-jts:0.9.1-mod"
implementation project(":vtm-microg-theme")
implementation project(":play-services-maps-core-vtm:vtm-microg-theme")
implementation "androidx.appcompat:appcompat:$appcompatVersion"
}
def execResult(...args) {

View file

@ -21,9 +21,10 @@ import android.content.Context;
import android.content.res.Resources;
import android.os.Parcel;
import android.os.RemoteException;
import android.support.annotation.Keep;
import android.util.Log;
import androidx.annotation.Keep;
import com.google.android.gms.dynamic.IObjectWrapper;
import com.google.android.gms.dynamic.ObjectWrapper;
import com.google.android.gms.maps.GoogleMapOptions;

View file

@ -27,10 +27,11 @@ import android.os.Handler;
import android.os.Looper;
import android.os.Parcel;
import android.os.RemoteException;
import android.support.v4.content.ContextCompat;
import android.util.Log;
import android.view.View;
import androidx.core.content.ContextCompat;
import com.google.android.gms.dynamic.IObjectWrapper;
import com.google.android.gms.dynamic.ObjectWrapper;
import com.google.android.gms.maps.GoogleMapOptions;

View file

@ -21,7 +21,8 @@ import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.support.v4.content.ContextCompat;
import androidx.core.content.ContextCompat;
public class ResourceBitmapDescriptor extends AbstractBitmapDescriptor {
private int resourceId;

View file

@ -13,14 +13,13 @@ include ':play-services-base'
include ':play-services-tasks'
include ':play-services-wearable'
include ':play-services-maps-core-mapbox'
include ':play-services-maps-core-vtm'
include ':play-services-base-core'
include ':play-services-location-core'
include ':play-services-maps-core-mapbox'
include ':play-services-maps-core-vtm'
include ':play-services-maps-core-vtm:vtm-microg-theme'
include ':play-services-core'
include ':play-services-core:microg-ui-tools'
include ':microg-ui-tools'
include ':vtm-microg-theme'
include ':remote-droid-guard-lib'