-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Updates Fenix taskcluster tasks to support beta release #1893
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,8 @@ apply plugin: 'androidx.navigation.safeargs.kotlin' | |
|
||
apply plugin: 'org.mozilla.appservices' | ||
|
||
import com.android.build.gradle.internal.tasks.AppPreBuildTask | ||
|
||
appservices { | ||
defaultConfig { | ||
megazord = 'fenix' | ||
|
@@ -25,8 +27,8 @@ android { | |
applicationId "org.mozilla.fenix" | ||
minSdkVersion Config.minSdkVersion | ||
targetSdkVersion Config.targetSdkVersion | ||
versionCode Config.versionCode | ||
versionName Config.versionName + Config.generateVersionSuffix() | ||
versionCode 1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: do we still want to keep There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're right that the first APK has already been uploaded to Google Play. Note that this is overridden separately here for release builds :) |
||
versionName Config.generateDebugVersionName() | ||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | ||
testInstrumentationRunnerArguments clearPackageData: 'true' | ||
manifestPlaceholders.isRaptorEnabled = "false" | ||
|
@@ -57,6 +59,7 @@ android { | |
resValue "bool", "IS_NOT_RELEASED", "false" | ||
} | ||
beta releaseTemplate >> { | ||
applicationIdSuffix ".beta" | ||
mitchhentges marked this conversation as resolved.
Show resolved
Hide resolved
|
||
buildConfigField "boolean", "IS_RELEASED", "true" | ||
resValue "bool", "IS_NOT_RELEASED", "false" | ||
} | ||
|
@@ -129,10 +132,11 @@ android.applicationVariants.all { variant -> | |
|
||
def buildType = variant.buildType.name | ||
def versionCode = null | ||
def isReleased = variant.buildType.buildConfigFields['IS_RELEASED']?.value ?: false | ||
|
||
buildConfigField 'Boolean', 'COLLECTIONS_ENABLED', (buildType != "release").toString() | ||
|
||
if (buildType == "nightly") { | ||
if (isReleased) { | ||
versionCode = generatedVersionCode | ||
|
||
// The Google Play Store does not allow multiple APKs for the same app that all have the | ||
|
@@ -150,7 +154,25 @@ android.applicationVariants.all { variant -> | |
}// else variant.flavorName.contains("Arm")) use generated version code | ||
|
||
variant.outputs.all { | ||
setVersionCodeOverride(versionCode) | ||
versionCodeOverride = versionCode | ||
versionNameOverride = Config.releaseVersionName(project) | ||
} | ||
|
||
// If this is a release build, validate that "versionName" is set | ||
tasks.withType(AppPreBuildTask) { prebuildTask -> | ||
// You can't add a closure to a variant, so we need to look for an early variant-specific type | ||
// of task (AppPreBuildTask is the first) and filter to make sure we're looking at the task for | ||
// this variant that we're currently configuring | ||
if (prebuildTask.variantName != variant.name) { | ||
return | ||
} | ||
|
||
// Append to the task so the first thing it does is run our validation | ||
prebuildTask.doFirst { | ||
if (!project.hasProperty('versionName')) { | ||
throw new RuntimeException("Release builds require the 'versionName' property, e.g.: './gradlew -PversionName=<...> assembleNightly'") | ||
mitchhentges marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
} | ||
} | ||
} | ||
|
||
|
@@ -197,7 +219,7 @@ android.applicationVariants.all { variant -> | |
|
||
print("Adjust token: ") | ||
|
||
if (variant.buildType.buildConfigFields['IS_RELEASED']?.value) { | ||
if (isReleased) { | ||
try { | ||
def token = new File("${rootDir}/.adjust_token").text.trim() | ||
buildConfigField 'String', 'ADJUST_TOKEN', '"' + token + '"' | ||
|
@@ -390,4 +412,4 @@ task printGeckoviewVersions { | |
|
||
// Normally this should use the same version as the glean dependency. But since we are currently using AC snapshots we | ||
// can't reference a git tag with a specific version here. So we are just using "master" and hoping for the best. | ||
apply from: 'https://github.com/mozilla-mobile/android-components/raw/master/components/service/glean/scripts/sdk_generator.gradle' | ||
apply from: 'https://github.com/mozilla-mobile/android-components/raw/master/components/service/glean/scripts/sdk_generator.gradle' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: EOL There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this something that should be addressed? I think that *nix prefers there to be an EOL at EOF, but Windows doesn't care. See this point. Mildly-relevant side-note: some of my tools automatically add a line to EOF, and I don't want to hunt them down and disable 'em :P |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that right now, any github release is assumed to be
beta
.As we get closer to the Fenix Preview release, I'll add a parse check to see if the tag has
-beta.*
on it