android: create build flavor for omitting non-free Google dependency

The F-Droid app store don't support non-free dependencies. Create two build
flavors, "fdroid" for building without Google Sign-In, and "play" for including
it.

Modify Makefile to target the play flavor.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
pull/4/head
Elias Naur 4 years ago
parent 6d9acbb479
commit 9c38bebfa9

@ -19,15 +19,15 @@ all: $(APK)
$(DEBUG_APK):
mkdir -p android/libs
go run gioui.org/cmd/gogio -buildmode archive -target android -appid $(APPID) -o $(AAR) github.com/tailscale/tailscale-android/cmd/tailscale
(cd android && ./gradlew assembleDebug)
mv android/build/outputs/apk/debug/android-debug.apk $@
(cd android && ./gradlew assemblePlayDebug)
mv android/build/outputs/apk/play/debug/android-play-debug.apk $@
$(RELEASE_AAB):
mkdir -p android/libs
go run gioui.org/cmd/gogio -ldflags "-X tailscale.com/version.Long=$(VERSION_LONG) -X tailscale.com/version.Short=$(VERSION_SHORT) -X tailscale.com/version.GitCommit=$(TAILSCALE_COMMIT)" -tags xversion -buildmode archive -target android -appid $(APPID) -o $(AAR) github.com/tailscale/tailscale-android/cmd/tailscale
(cd android && VERSION=$(VERSION_LONG) ./gradlew bundleRelease)
mv ./android/build/outputs/bundle/release/android-release.aab $@
(cd android && VERSION=$(VERSION_LONG) ./gradlew bundlePlayRelease)
mv ./android/build/outputs/bundle/playRelease/android-play-release.aab $@
release: $(RELEASE_AAB)
jarsigner -sigalg SHA256withRSA -digestalg SHA-256 -keystore $(KEYSTORE) $(RELEASE_AAB) $(KEYSTORE_ALIAS)

@ -32,12 +32,24 @@ android {
sourceCompatibility 1.8
targetCompatibility 1.8
}
flavorDimensions "version"
productFlavors {
fdroid {
// The fdroid flavor contains only free dependencies and is suitable
// for the F-Droid app store.
}
play {
// The play flavor contains all features and is for the Play Store.
}
}
}
dependencies {
implementation 'com.google.android.gms:play-services-auth:18.0.0'
implementation "androidx.core:core:1.2.0"
implementation "androidx.browser:browser:1.2.0"
implementation "androidx.security:security-crypto:1.1.0-alpha02"
implementation ':ipn@aar'
// Non-free dependencies.
playImplementation 'com.google.android.gms:play-services-auth:18.0.0'
}

Loading…
Cancel
Save