forked from github/szkolny
[Gradle] Add non-Play flavor without self-updater.
This commit is contained in:
parent
98a89b1ca1
commit
5b5dc5cade
@ -41,6 +41,7 @@ android {
|
||||
|
||||
buildTypes {
|
||||
debug {
|
||||
getIsDefault().set(true)
|
||||
minifyEnabled = false
|
||||
manifestPlaceholders = [
|
||||
buildTimestamp: 0
|
||||
@ -55,7 +56,8 @@ android {
|
||||
}
|
||||
flavorDimensions "platform"
|
||||
productFlavors {
|
||||
main {
|
||||
unofficial {
|
||||
getIsDefault().set(true)
|
||||
versionName "${release.versionName}-${gitInfo.versionSuffix}"
|
||||
}
|
||||
official {}
|
||||
@ -63,7 +65,18 @@ android {
|
||||
}
|
||||
variantFilter { variant ->
|
||||
def flavors = variant.flavors*.name
|
||||
setIgnore(variant.buildType.name == "debug" && !flavors.contains("main"))
|
||||
setIgnore(variant.buildType.name == "debug" && !flavors.contains("unofficial") || flavors.contains("main"))
|
||||
}
|
||||
sourceSets {
|
||||
unofficial {
|
||||
java.srcDirs = ["src/main/java", "src/play-not/java"]
|
||||
}
|
||||
official {
|
||||
java.srcDirs = ["src/main/java", "src/play-not/java"]
|
||||
}
|
||||
play {
|
||||
java.srcDirs = ["src/main/java", "src/play/java"]
|
||||
}
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
|
@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Copyright (c) Kuba Szczodrzyński 2022-2-21.
|
||||
*/
|
||||
|
||||
package pl.szczodrzynski.edziennik.sync
|
||||
|
||||
import android.app.IntentService
|
||||
import android.content.Intent
|
||||
import android.widget.Toast
|
||||
import pl.szczodrzynski.edziennik.utils.Utils
|
||||
|
||||
class UpdateDownloaderService : IntentService(UpdateDownloaderService::class.java.simpleName) {
|
||||
|
||||
override fun onHandleIntent(intent: Intent?) {
|
||||
try {
|
||||
Utils.openGooglePlay(this, application.packageName)
|
||||
}
|
||||
catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
Toast.makeText(this, "Nie znaleziono Google Play. Pobierz aktualizację ręcznie.", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user