Keep optimized versions compatible with upgrade and update parsing
All checks were successful
review/code-gpt Build-only change (new optimized build type, own package, baseline seed, version parser test) read by firstmate; release and debug unchanged; the optimized APK was installed and run on the real box (sign-in, picker, Home, Movies work under R8; 0.4 s cold start, 14x lower p99 frame time than debug); version-suffix defect found on the box and fixed in this head
All checks were successful
review/code-gpt Build-only change (new optimized build type, own package, baseline seed, version parser test) read by firstmate; release and debug unchanged; the optimized APK was installed and run on the real box (sign-in, picker, Home, Movies work under R8; 0.4 s cold start, 14x lower p99 frame time than debug); version-suffix defect found on the box and fixed in this head
This commit is contained in:
parent
59f4a06815
commit
5306f8ddc4
3 changed files with 19 additions and 5 deletions
|
|
@ -138,7 +138,6 @@ configure<ApplicationExtension> {
|
|||
initWith(getByName("release"))
|
||||
signingConfig = signingConfigs.getByName("debug")
|
||||
applicationIdSuffix = ".opt"
|
||||
versionNameSuffix = "-opt"
|
||||
matchingFallbacks += "release"
|
||||
}
|
||||
}
|
||||
|
|
@ -240,6 +239,11 @@ androidComponents {
|
|||
"Wholphin-${variant.flavorName}-${variant.buildType}-${output.versionName.get()}-${output.versionCode.get()}$abi.apk"
|
||||
output.outputFileName = outputFileName
|
||||
}
|
||||
if (variant.name == "defaultOptimized") {
|
||||
tasks.withType<Test>().configureEach {
|
||||
systemProperty("wolfskin.optimizedVersionName", variant.outputs.first().versionName.get())
|
||||
}
|
||||
}
|
||||
if (variant.name == "defaultDebug") {
|
||||
val packagedApks = variant.artifacts.get(SingleArtifact.APK)
|
||||
val artifactLoader = variant.artifacts.getBuiltArtifactsLoader()
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.github.damontecres.wholphin.test
|
||||
|
||||
import com.github.damontecres.wholphin.BuildConfig
|
||||
import com.github.damontecres.wholphin.util.Version
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
|
|
@ -18,6 +19,12 @@ class VersionCompareTests {
|
|||
val V_0_1_1_5 = Version.fromString("v0.1.1-5-gabc1234")
|
||||
}
|
||||
|
||||
@Test
|
||||
fun optimizedVersionRemainsCompatibleWithUpgradeAndUpdateChecks() {
|
||||
val optimizedVersion = Version.fromString(requireNotNull(System.getProperty("wolfskin.optimizedVersionName")))
|
||||
Assert.assertEquals(Version.fromString(BuildConfig.VERSION_NAME), optimizedVersion)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testIsAtLeast() {
|
||||
Assert.assertTrue(V_0_2_0.isAtLeast(V_0_2_0))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue