0
0
Fork 0
mirror of https://github.com/YTVanced/VancedMicroG synced 2024-11-24 12:15:12 +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' apply plugin: 'com.android.application'
def useMapbox() { configurations {
Properties properties = new Properties() mapboxImplementation
properties.load(project.rootProject.file('local.properties').newDataInputStream()) vtmImplementation
return properties.getProperty("mapbox.enabled", "false") == "true"
} }
dependencies { 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 "com.squareup.wire:wire-runtime:1.6.1"
implementation "de.hdodenhof:circleimageview:1.3.0" implementation "de.hdodenhof:circleimageview:1.3.0"
implementation "org.conscrypt:conscrypt-android:2.1.0" implementation "org.conscrypt:conscrypt-android:2.1.0"
@ -42,18 +37,21 @@ dependencies {
implementation project(':play-services-base-core') implementation project(':play-services-base-core')
implementation project(':play-services-location-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-api')
implementation project(':play-services-cast-api') implementation project(':play-services-cast-api')
implementation project(':play-services-wearable') implementation project(':play-services-wearable')
implementation "org.microg:wearable:$wearableVersion" implementation "org.microg:wearable:$wearableVersion"
implementation "org.microg.gms:remote-droid-guard:$remoteDroidGuardVersion" implementation "org.microg.gms:remote-droid-guard:$remoteDroidGuardVersion"
if (useMapbox()) { mapboxImplementation project(':play-services-maps-core-mapbox')
implementation project(':play-services-maps-core-mapbox') vtmImplementation project(':play-services-maps-core-vtm')
} else {
implementation 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 // Navigation
implementation "androidx.navigation:navigation-fragment:$navigationVersion" implementation "androidx.navigation:navigation-fragment:$navigationVersion"
@ -67,13 +65,13 @@ android {
buildToolsVersion "$androidBuildVersionTools" buildToolsVersion "$androidBuildVersionTools"
defaultConfig { defaultConfig {
versionName version + (useMapbox() ? "" : "-vtm") versionName version
versionCode appVersionCode versionCode appVersionCode
minSdkVersion androidMinSdk minSdkVersion androidMinSdk
targetSdkVersion androidTargetSdk targetSdkVersion androidTargetSdk
buildConfigField "boolean", "USE_MAPBOX", "${useMapbox()}" // buildConfigField "boolean", "USE_MAPBOX", "${useMapbox()}"
multiDexEnabled true multiDexEnabled true
@ -103,6 +101,17 @@ android {
} }
} }
flavorDimensions 'maps'
productFlavors {
mapbox {
dimension 'maps'
}
vtm {
dimension 'maps'
versionNameSuffix '-vtm'
}
}
compileOptions { compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8 sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8

View file

@ -29,7 +29,7 @@ public class AboutFragment extends AbstractAboutFragment {
@Override @Override
protected void collectLibraries(List<AbstractAboutFragment.Library> libraries) { 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")); libraries.add(new AbstractAboutFragment.Library("com.mapbox.mapboxsdk", "Mapbox Maps SDK for Android", "Three-Clause BSD, Mapbox"));
} else { } else {
libraries.add(new AbstractAboutFragment.Library("org.oscim.android", "V™", "GNU LGPLv3, Hannes Janetzek and devemux86")); 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" apply plugin: "com.android.library"
dependencies { dependencies {
implementation project(":microg-ui-tools")
implementation project(":play-services-api") implementation project(":play-services-api")
implementation "org.microg:vtm-android:0.9.1-mod" 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-android:0.9.1-mod:natives-x86_64"
implementation "org.microg:vtm-extras:0.9.1-mod" implementation "org.microg:vtm-extras:0.9.1-mod"
implementation "org.microg:vtm-jts: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) { def execResult(...args) {

View file

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

View file

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

View file

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

View file

@ -13,14 +13,13 @@ include ':play-services-base'
include ':play-services-tasks' include ':play-services-tasks'
include ':play-services-wearable' include ':play-services-wearable'
include ':play-services-maps-core-mapbox'
include ':play-services-maps-core-vtm'
include ':play-services-base-core' include ':play-services-base-core'
include ':play-services-location-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'
include ':play-services-core:microg-ui-tools'
include ':microg-ui-tools'
include ':vtm-microg-theme'
include ':remote-droid-guard-lib'