Skip to content

Commit c2c2ae0

Browse files
authored
Merge pull request #17023 from wordpress-mobile/tooling/remove-alpha
[Tooling] Remove zalpha flavor and alpha versioning
2 parents fd78f7f + 020439b commit c2c2ae0

3 files changed

Lines changed: 10 additions & 95 deletions

File tree

WordPress/build.gradle

Lines changed: 8 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,15 @@ android {
7070

7171
compileSdkVersion rootProject.compileSdkVersion
7272

73+
def versionProperties = loadPropertiesFromFile(file("${rootDir}/version.properties"))
74+
7375
defaultConfig {
7476
applicationId "org.wordpress.android"
7577
archivesBaseName = "$applicationId"
7678

79+
versionName project.findProperty("installableBuildVersionName") ?: versionProperties.getProperty("versionName")
80+
versionCode versionProperties.getProperty("versionCode").toInteger()
81+
7782
minSdkVersion rootProject.minSdkVersion
7883
targetSdkVersion rootProject.targetSdkVersion
7984

@@ -141,8 +146,6 @@ android {
141146

142147
flavorDimensions "app", "buildType"
143148

144-
def versionProperties = loadPropertiesFromFile(file("${rootDir}/version.properties"))
145-
146149
productFlavors {
147150
wordpress {
148151
isDefault true
@@ -184,46 +187,25 @@ android {
184187
vanilla {
185188
dimension "buildType"
186189

187-
versionName versionProperties.getProperty("versionName")
188-
versionCode versionProperties.getProperty("versionCode").toInteger()
189-
190190
buildConfigField "boolean", "ME_ACTIVITY_AVAILABLE", "false"
191191
buildConfigField "long", "REMOTE_CONFIG_FETCH_INTERVAL", "3600"
192192
buildConfigField "boolean", "ENABLE_DEBUG_SETTINGS", "false"
193193
}
194194

195-
// Used for Alpha builds - testing builds with experimental features enabled.
196-
// AppName: WordPress/Jetpack
197-
zalpha {
198-
dimension "buildType"
199-
200-
versionName versionProperties.getProperty("alpha.versionName")
201-
versionCode versionProperties.getProperty("alpha.versionCode").toInteger()
202-
203-
buildConfigField "boolean", "VIDEO_OPTIMIZATION_AVAILABLE", "true"
204-
buildConfigField "boolean", "ENABLE_DEBUG_SETTINGS", "false"
205-
}
206-
207195
// Used for local development - preferred variant for developers.
208196
// AppName: WordPress Beta/Jetpack Beta
209197
wasabi {
210198
applicationIdSuffix ".beta"
211199
dimension "buildType"
212-
213-
versionName versionProperties.getProperty("alpha.versionName")
214-
versionCode versionProperties.getProperty("alpha.versionCode").toInteger()
215200
}
216201

217-
// Used for CI builds on PRs (downloadable apks). Can be used locally when a developer needs
202+
// Used for CI builds on PRs (aka "Installable Builds"). Can be used locally when a developer needs
218203
// to install multiple versions of the app on the same device.
219204
// AppName: WordPress Pre-Alpha/Jetpack Pre-Alpha
220205
jalapeno {
221206
isDefault true
222207
applicationIdSuffix ".prealpha"
223208
dimension "buildType"
224-
225-
versionName project.findProperty("installableBuildVersionName") ?: versionProperties.getProperty("alpha.versionName")
226-
versionCode 1 // Fixed versionCode because those builds are not meant to be uploaded to the PlayStore.
227209
}
228210

229211
// Also dynamically add additional `buildConfigFields` to our app flavors from any `wp.`/`jp.`-prefixed property in `gradle.properties`
@@ -605,19 +587,14 @@ tasks.register("dependencyTreeDiffCommentToGitHub", ViolationCommentsToGitHubTas
605587

606588
tasks.register("printVersionName") {
607589
doLast {
608-
if (project.hasProperty('alpha')) {
609-
println android.productFlavors.zalpha.versionName
610-
} else {
611-
println android.productFlavors.vanilla.versionName
612-
}
590+
println android.defaultConfig.versionName
613591
}
614592
}
615593

616594
tasks.register("printAllVersions") {
617595
doLast {
618596
android.applicationVariants.all { variant ->
619-
def apkData = variant.outputs*.apkData
620-
println "${variant.name}: ${apkData*.versionName} (${apkData*.versionCode})"
597+
println "${variant.name}: ${variant.versionName} (${variant.versionCode})"
621598
}
622599
}
623600
}

fastlane/lanes/build.rb

Lines changed: 1 addition & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -50,44 +50,15 @@
5050
lane :build_and_upload_pre_releases do |options|
5151
android_build_prechecks(
5252
skip_confirm: options[:skip_confirm],
53-
alpha: true,
53+
alpha: false,
5454
beta: true,
5555
final: false
5656
)
5757
android_build_preflight() unless options[:skip_prechecks]
5858
app = get_app_name_option!(options)
59-
build_alpha(app: app, skip_prechecks: true, skip_confirm: options[:skip_confirm], upload_to_play_store: true, create_release: options[:create_release])
6059
build_beta(app: app, skip_prechecks: true, skip_confirm: options[:skip_confirm], upload_to_play_store: true, create_release: options[:create_release])
6160
end
6261

63-
#####################################################################################
64-
# build_alpha
65-
# -----------------------------------------------------------------------------------
66-
# This lane builds the app for internal testing and optionally uploads it
67-
# -----------------------------------------------------------------------------------
68-
# Usage:
69-
# bundle exec fastlane build_alpha app:<wordpress|jetpack> [skip_confirm:<true|false>] [upload_to_play_store:<true|false>] [create_release:<true|false>]
70-
#
71-
# Example:
72-
# bundle exec fastlane build_alpha app:wordpress create_release:true
73-
# bundle exec fastlane build_alpha app:wordpress skip_confirm:true upload_to_play_store:true
74-
# bundle exec fastlane build_alpha app:jetpack
75-
#####################################################################################
76-
desc 'Builds and updates for distribution'
77-
lane :build_alpha do |options|
78-
android_build_prechecks(skip_confirm: options[:skip_confirm], alpha: true) unless options[:skip_prechecks]
79-
android_build_preflight() unless options[:skip_prechecks]
80-
81-
# Create the file names
82-
app = get_app_name_option!(options)
83-
version = android_get_alpha_version()
84-
build_bundle(app: app, version: version, flavor: 'Zalpha', buildType: 'Release')
85-
86-
upload_build_to_play_store(app: app, version: version, track: 'alpha') if options[:upload_to_play_store]
87-
88-
create_gh_release(app: app, version: version, prerelease: true) if options[:create_release]
89-
end
90-
9162
#####################################################################################
9263
# build_beta
9364
# -----------------------------------------------------------------------------------
@@ -116,34 +87,6 @@
11687
create_gh_release(app: app, version: version, prerelease: true) if options[:create_release]
11788
end
11889

119-
#####################################################################################
120-
# build_internal
121-
# -----------------------------------------------------------------------------------
122-
# This lane builds the app for restricted internal testing, and optionally uploads it to PlayStore's Internal track
123-
# -----------------------------------------------------------------------------------
124-
# Usage:
125-
# bundle exec fastlane build_internal app:<wordpress|jetpack> [skip_confirm:<true|false>] [upload_to_play_store:<true|false>] [create_release:<true|false>]
126-
#
127-
# Example:
128-
# bundle exec fastlane build_internal app:wordpress
129-
# bundle exec fastlane build_internal app:wordpress skip_confirm:true upload_to_play_store:true
130-
# bundle exec fastlane build_internal app:jetpack create_release:true
131-
#####################################################################################
132-
desc 'Builds and updates for internal testing'
133-
lane :build_internal do |options|
134-
android_build_prechecks(skip_confirm: options[:skip_confirm]) unless options[:skip_prechecks]
135-
android_build_preflight() unless options[:skip_prechecks]
136-
137-
# Create the file names
138-
app = get_app_name_option!(options)
139-
version = android_get_release_version()
140-
build_bundle(app: app, version: version, flavor: 'Zalpha', buildType: 'Debug')
141-
142-
upload_build_to_play_store(app: app, version: version, track: 'internal') if options[:upload_to_play_store]
143-
144-
create_gh_release(app: app, version: version, prerelease: true) if options[:create_release]
145-
end
146-
14790
#####################################################################################
14891
# upload_build_to_play_store
14992
# -----------------------------------------------------------------------------------

version.properties

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
#Mon, 30 Aug 2021 11:48:28 +0200
22

3-
# Version Information for Vanilla / Release builds
43
versionName=20.5-rc-1
5-
versionCode=1259
6-
7-
# Version Information for other flavors: zalpha, wasabi, jalapeno
8-
alpha.versionName=alpha-380
9-
alpha.versionCode=1260
4+
versionCode=1260

0 commit comments

Comments
 (0)