mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-19 03:39:18 +01:00
Add new build type for weekly preview (#6067)
This adds new build type for minified non-debuggable preview builds. "debugFull" is removed and "debug" will be unminified. **It means preview build action needs to be updated to build "standardPreview"**
This commit is contained in:
parent
e98f90b099
commit
7e61900cf5
@ -36,6 +36,7 @@ android {
|
|||||||
buildConfigField("String", "COMMIT_SHA", "\"${getGitSha()}\"")
|
buildConfigField("String", "COMMIT_SHA", "\"${getGitSha()}\"")
|
||||||
buildConfigField("String", "BUILD_TIME", "\"${getBuildTime()}\"")
|
buildConfigField("String", "BUILD_TIME", "\"${getBuildTime()}\"")
|
||||||
buildConfigField("boolean", "INCLUDE_UPDATER", "false")
|
buildConfigField("boolean", "INCLUDE_UPDATER", "false")
|
||||||
|
buildConfigField("boolean", "PREVIEW", "false")
|
||||||
|
|
||||||
// Please disable ACRA or use your own instance in forked versions of the project
|
// Please disable ACRA or use your own instance in forked versions of the project
|
||||||
buildConfigField("String", "ACRA_URI", "\"https://tachiyomi.kanade.eu/crash_report\"")
|
buildConfigField("String", "ACRA_URI", "\"https://tachiyomi.kanade.eu/crash_report\"")
|
||||||
@ -58,25 +59,25 @@ android {
|
|||||||
named("debug") {
|
named("debug") {
|
||||||
versionNameSuffix = "-${getCommitCount()}"
|
versionNameSuffix = "-${getCommitCount()}"
|
||||||
applicationIdSuffix = ".debug"
|
applicationIdSuffix = ".debug"
|
||||||
|
|
||||||
isShrinkResources = true
|
|
||||||
isMinifyEnabled = true
|
|
||||||
proguardFiles("proguard-android-optimize.txt", "proguard-rules.pro")
|
|
||||||
}
|
|
||||||
create("debugFull") { // Debug without R8
|
|
||||||
initWith(getByName("debug"))
|
|
||||||
isShrinkResources = false
|
|
||||||
isMinifyEnabled = false
|
|
||||||
}
|
}
|
||||||
named("release") {
|
named("release") {
|
||||||
isShrinkResources = true
|
isShrinkResources = true
|
||||||
isMinifyEnabled = true
|
isMinifyEnabled = true
|
||||||
proguardFiles("proguard-android-optimize.txt", "proguard-rules.pro")
|
proguardFiles("proguard-android-optimize.txt", "proguard-rules.pro")
|
||||||
}
|
}
|
||||||
|
create("preview") {
|
||||||
|
initWith(getByName("release"))
|
||||||
|
buildConfigField("boolean", "PREVIEW", "true")
|
||||||
|
|
||||||
|
val debugType = getByName("debug")
|
||||||
|
signingConfig = debugType.signingConfig
|
||||||
|
versionNameSuffix = debugType.versionNameSuffix
|
||||||
|
applicationIdSuffix = debugType.applicationIdSuffix
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
getByName("debugFull").res.srcDirs("src/debug/res")
|
getByName("preview").res.srcDirs("src/debug/res")
|
||||||
}
|
}
|
||||||
|
|
||||||
flavorDimensions.add("default")
|
flavorDimensions.add("default")
|
||||||
|
@ -16,7 +16,7 @@ class AppUpdateChecker {
|
|||||||
private val preferences: PreferencesHelper by injectLazy()
|
private val preferences: PreferencesHelper by injectLazy()
|
||||||
|
|
||||||
private val repo: String by lazy {
|
private val repo: String by lazy {
|
||||||
if (BuildConfig.DEBUG) {
|
if (BuildConfig.PREVIEW) {
|
||||||
"tachiyomiorg/tachiyomi-preview"
|
"tachiyomiorg/tachiyomi-preview"
|
||||||
} else {
|
} else {
|
||||||
"tachiyomiorg/tachiyomi"
|
"tachiyomiorg/tachiyomi"
|
||||||
@ -46,7 +46,7 @@ class AppUpdateChecker {
|
|||||||
// Removes prefixes like "r" or "v"
|
// Removes prefixes like "r" or "v"
|
||||||
val newVersion = versionTag.replace("[^\\d.]".toRegex(), "")
|
val newVersion = versionTag.replace("[^\\d.]".toRegex(), "")
|
||||||
|
|
||||||
return if (BuildConfig.DEBUG) {
|
return if (BuildConfig.PREVIEW) {
|
||||||
// Preview builds: based on releases in "tachiyomiorg/tachiyomi-preview" repo
|
// Preview builds: based on releases in "tachiyomiorg/tachiyomi-preview" repo
|
||||||
// tagged as something like "r1234"
|
// tagged as something like "r1234"
|
||||||
newVersion.toInt() > BuildConfig.COMMIT_COUNT.toInt()
|
newVersion.toInt() > BuildConfig.COMMIT_COUNT.toInt()
|
||||||
|
@ -40,11 +40,17 @@ class AboutController : SettingsController(), NoAppBarElevationController {
|
|||||||
preference {
|
preference {
|
||||||
key = "pref_about_version"
|
key = "pref_about_version"
|
||||||
titleRes = R.string.version
|
titleRes = R.string.version
|
||||||
summary = if (BuildConfig.DEBUG) {
|
summary = when {
|
||||||
|
BuildConfig.DEBUG -> {
|
||||||
|
"Debug ${BuildConfig.COMMIT_SHA} (${getFormattedBuildTime()})"
|
||||||
|
}
|
||||||
|
BuildConfig.PREVIEW -> {
|
||||||
"Preview r${BuildConfig.COMMIT_COUNT} (${BuildConfig.COMMIT_SHA}, ${getFormattedBuildTime()})"
|
"Preview r${BuildConfig.COMMIT_COUNT} (${BuildConfig.COMMIT_SHA}, ${getFormattedBuildTime()})"
|
||||||
} else {
|
}
|
||||||
|
else -> {
|
||||||
"Stable ${BuildConfig.VERSION_NAME} (${getFormattedBuildTime()})"
|
"Stable ${BuildConfig.VERSION_NAME} (${getFormattedBuildTime()})"
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onClick {
|
onClick {
|
||||||
activity?.let {
|
activity?.let {
|
||||||
@ -61,12 +67,13 @@ class AboutController : SettingsController(), NoAppBarElevationController {
|
|||||||
onClick { checkVersion() }
|
onClick { checkVersion() }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!BuildConfig.DEBUG) {
|
||||||
preference {
|
preference {
|
||||||
key = "pref_about_whats_new"
|
key = "pref_about_whats_new"
|
||||||
titleRes = R.string.whats_new
|
titleRes = R.string.whats_new
|
||||||
|
|
||||||
onClick {
|
onClick {
|
||||||
val url = if (BuildConfig.DEBUG) {
|
val url = if (BuildConfig.PREVIEW) {
|
||||||
"https://github.com/tachiyomiorg/tachiyomi-preview/releases/tag/r${BuildConfig.COMMIT_COUNT}"
|
"https://github.com/tachiyomiorg/tachiyomi-preview/releases/tag/r${BuildConfig.COMMIT_COUNT}"
|
||||||
} else {
|
} else {
|
||||||
"https://github.com/tachiyomiorg/tachiyomi/releases/tag/v${BuildConfig.VERSION_NAME}"
|
"https://github.com/tachiyomiorg/tachiyomi/releases/tag/v${BuildConfig.VERSION_NAME}"
|
||||||
@ -74,6 +81,7 @@ class AboutController : SettingsController(), NoAppBarElevationController {
|
|||||||
openInBrowser(url)
|
openInBrowser(url)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
preference {
|
preference {
|
||||||
key = "pref_about_help_translate"
|
key = "pref_about_help_translate"
|
||||||
titleRes = R.string.help_translate
|
titleRes = R.string.help_translate
|
||||||
|
Loading…
Reference in New Issue
Block a user