diff --git a/.buildkite/commands/gradle-cache-build.sh b/.buildkite/commands/gradle-cache-build.sh index 40bfa3bd5489..d7dbd53bcef5 100755 --- a/.buildkite/commands/gradle-cache-build.sh +++ b/.buildkite/commands/gradle-cache-build.sh @@ -14,9 +14,9 @@ bundle exec fastlane run configure_apply echo "--- :hammer_and_wrench: Building" if [ "$1" = "wordpress" ]; then - ./gradlew assembleWordpressWasabiDebug + ./gradlew assembleWordpressDebug fi if [ "$1" = "jetpack" ]; then - ./gradlew assembleJetpackWasabiDebug + ./gradlew assembleJetpackDebug fi diff --git a/.buildkite/commands/lint.sh b/.buildkite/commands/lint.sh index 6a836fdbb25d..ef471bb8db79 100755 --- a/.buildkite/commands/lint.sh +++ b/.buildkite/commands/lint.sh @@ -15,17 +15,17 @@ bundle exec fastlane check_declared_locales_consistency app:"$1" echo "--- :microscope: Linting" if [ "$1" = "wordpress" ]; then - ./gradlew lintWordpressVanillaRelease + ./gradlew lintWordpressRelease exit 0 fi if [ "$1" = "jetpack" ]; then set +e - ./gradlew lintJetpackVanillaRelease + ./gradlew lintJetpackRelease lint_exit_code=$? set -e - upload_sarif_to_github "WordPress/build/reports/lint-results-jetpackVanillaRelease.sarif" + upload_sarif_to_github "WordPress/build/reports/lint-results-jetpackRelease.sarif" exit $lint_exit_code fi diff --git a/.buildkite/commands/run-unit-tests.sh b/.buildkite/commands/run-unit-tests.sh index 9b1e5be2c019..dad62c5486fd 100755 --- a/.buildkite/commands/run-unit-tests.sh +++ b/.buildkite/commands/run-unit-tests.sh @@ -10,12 +10,12 @@ fi echo "+++ ๐Ÿงช Testing" set +e ./gradlew \ - testWordpressWasabiDebugUnitTest \ + testWordpressDebugUnitTest \ :libs:processors:test \ :libs:image-editor:testDebugUnitTest \ :libs:fluxc:testDebugUnitTest \ :libs:login:testDebugUnitTest \ - koverXmlReportWordpressWasabiDebug \ + koverXmlReportWordpressDebug \ :libs:processors:koverXmlReportJvm \ :libs:image-editor:koverXmlReportDebug \ :libs:fluxc:koverXmlReportDebug \ @@ -45,7 +45,7 @@ echo "--- ๐Ÿšฆ Collecting Test Results" # Define test result directories for each module declare -A TEST_RESULT_DIRS=( - ["WordPress:wordpress"]="WordPress/build/test-results/testWordpressWasabiDebugUnitTest" + ["WordPress:wordpress"]="WordPress/build/test-results/testWordpressDebugUnitTest" ["processors"]="libs/processors/build/test-results/test" ["image-editor"]="libs/image-editor/build/test-results/testDebugUnitTest" ["fluxc"]="libs/fluxc/build/test-results/testDebugUnitTest" diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 25b2f2aa7d4f..c5b4ba3c3f39 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -78,25 +78,30 @@ steps: steps: - label: "Dependency Tree Diff" command: | - comment_with_dependency_diff 'WordPress' 'wordpressVanillaReleaseRuntimeClasspath' + comment_with_dependency_diff 'WordPress' 'wordpressReleaseRuntimeClasspath' if: build.pull_request.id != null plugins: [$CI_TOOLKIT] artifact_paths: - "**/build/reports/diff/*" + # TODO: Remove soft_fail after this PR merges and trunk + # uses the new variant names (without buildType flavors) + soft_fail: true - label: "Merged Manifest Diff WordPress" - command: ".buildkite/commands/diff-merged-manifest.sh wordpressVanillaRelease" + command: ".buildkite/commands/diff-merged-manifest.sh wordpressRelease" if: build.pull_request.id != null plugins: [$CI_TOOLKIT] artifact_paths: - "**/build/reports/diff_manifest/**/**/*" + soft_fail: true - label: "Merged Manifest Diff Jetpack" - command: ".buildkite/commands/diff-merged-manifest.sh jetpackVanillaRelease" + command: ".buildkite/commands/diff-merged-manifest.sh jetpackRelease" if: build.pull_request.id != null plugins: [$CI_TOOLKIT] artifact_paths: - "**/build/reports/diff_manifest/**/**/*" + soft_fail: true ################# # Unit Tests diff --git a/.claude/skills/run-app/SKILL.md b/.claude/skills/run-app/SKILL.md index 2fd7235ed1ef..6a5ba7a559c1 100644 --- a/.claude/skills/run-app/SKILL.md +++ b/.claude/skills/run-app/SKILL.md @@ -8,7 +8,7 @@ description: > # Run App -Build and run the Jetpack wasabi debug variant on a connected Android +Build and run the Jetpack debug variant on a connected Android device or emulator. By default this skill builds and runs the **Jetpack** app. Only build the WordPress app if the user explicitly asks for it. @@ -17,16 +17,16 @@ asks for it. ### 1. Build the app -By default, build the Jetpack wasabi debug variant: +By default, build the Jetpack debug variant: ```bash -./gradlew assembleJetpackWasabiDebug +./gradlew assembleJetpackDebug ``` If the user explicitly asks for the WordPress app instead, run: ```bash -./gradlew assembleWordPressWasabiDebug +./gradlew assembleWordPressDebug ``` ### 2. Check for connected devices @@ -89,14 +89,14 @@ Gradle versions): **Jetpack (default):** ```bash -APK=$(find WordPress/build/outputs/apk/jetpackWasabi/debug \ +APK=$(find WordPress/build/outputs/apk/jetpack/debug \ -name '*.apk' ! -name '*androidTest*' | head -1) ``` **WordPress (only if the user explicitly requested it):** ```bash -APK=$(find WordPress/build/outputs/apk/wordpressWasabi/debug \ +APK=$(find WordPress/build/outputs/apk/wordpress/debug \ -name '*.apk' ! -name '*androidTest*' | head -1) ``` @@ -109,8 +109,8 @@ adb [-s ] install -r "$APK" Then launch the app: -- **Jetpack**: `adb [-s ] shell am start -n com.jetpack.android.beta/org.wordpress.android.ui.WPLaunchActivity` -- **WordPress**: `adb [-s ] shell am start -n org.wordpress.android.beta/org.wordpress.android.ui.WPLaunchActivity` +- **Jetpack**: `adb [-s ] shell am start -n com.jetpack.android/org.wordpress.android.ui.WPLaunchActivity` +- **WordPress**: `adb [-s ] shell am start -n org.wordpress.android/org.wordpress.android.ui.WPLaunchActivity` ### 6. Report the result diff --git a/CLAUDE.md b/CLAUDE.md index af34144daada..e0cff8c2bdc8 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -5,21 +5,21 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co ## Build and Test Commands ### Main Build Commands -- `./gradlew assembleWordPressVanillaDebug` - Build debug APK for WordPress app -- `./gradlew assembleJetpackVanillaDebug` - Build debug APK for Jetpack app -- `./gradlew installWordPressVanillaDebug` - Install debug APK to connected device -- `./gradlew installJetpackVanillaDebug` - Install debug APK for Jetpack to device +- `./gradlew assembleWordPressDebug` - Build debug APK for WordPress app +- `./gradlew assembleJetpackDebug` - Build debug APK for Jetpack app +- `./gradlew installWordPressDebug` - Install debug APK to connected device +- `./gradlew installJetpackDebug` - Install debug APK for Jetpack to device ### Testing Commands -- `./gradlew :WordPress:testWordPressVanillaDebugUnitTest` - Run unit tests for WordPress app -- `./gradlew :WordPress:connectedWordPressVanillaDebugAndroidTest` - Run instrumented tests for WordPress app +- `./gradlew :WordPress:testWordPressDebugUnitTest` - Run unit tests for WordPress app +- `./gradlew :WordPress:connectedWordPressDebugAndroidTest` - Run instrumented tests for WordPress app - `bundle exec fastlane build_and_run_instrumented_test app:wordpress` - Build and run WordPress instrumented tests in Firebase Test Lab - `bundle exec fastlane build_and_run_instrumented_test app:jetpack` - Build and run Jetpack instrumented tests in Firebase Test Lab ### Code Quality Commands - `./gradlew checkstyle` - Run Checkstyle linter (generates report in `WordPress/build/reports/checkstyle/checkstyle.html`) - `./gradlew detekt` - Run Detekt linter for Kotlin (generates report in `WordPress/build/reports/detekt/detekt.html`) -- `./gradlew lintWordPressVanillaRelease` - Run Android lint on WordPress release variant +- `./gradlew lintWordPressRelease` - Run Android lint on WordPress release variant ## Architecture Overview @@ -30,8 +30,8 @@ This repository builds two apps from shared codebase: ### Product Flavors and Build Types - **App Flavors**: `wordpress`, `jetpack` -- **Build Type Flavors**: `vanilla` (release/beta), `wasabi` (development), `jalapeno` (CI/prototype) -- Common development variant: `jetpackWasabiDebug` +- **Build Types**: `debug`, `release` +- Common development variant: `jetpackDebug` ### Module Architecture ``` @@ -121,7 +121,7 @@ WordPress/src/main/java/org/wordpress/android/ other members (properties, init blocks, constructors, functions) ### Development Workflow -- Default development flavor: `jetpackWasabi` (Jetpack app with beta suffix) +- Default development variant: `jetpackDebug` - Remote build cache available for faster builds (requires setup) - Fastlane used for release automation and testing - Secrets managed via `secrets.properties` file (not in repo) diff --git a/README.md b/README.md index 495b99dc7395..a7bc5a5d0905 100644 --- a/README.md +++ b/README.md @@ -21,11 +21,11 @@ Notes: To build, install, and test the project from the command line: - $ ./gradlew assembleWordPressVanillaDebug # assemble the debug .apk - $ ./gradlew installWordPressVanillaDebug # install the debug .apk if you have an + $ ./gradlew assembleWordPressDebug # assemble the debug .apk + $ ./gradlew installWordPressDebug # install the debug .apk if you have an # emulator or an Android device connected - $ ./gradlew :WordPress:testWordPressVanillaDebugUnitTest # assemble, install and run unit tests - $ ./gradlew :WordPress:connectedWordPressVanillaDebugAndroidTest # assemble, install and run Android tests + $ ./gradlew :WordPress:testWordPressDebugUnitTest # assemble, install and run unit tests + $ ./gradlew :WordPress:connectedWordPressDebugAndroidTest # assemble, install and run Android tests ## Running the app ## @@ -49,7 +49,7 @@ Note: Access to WordPress.com features is temporarily disabled in the developmen โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ java # main project java code โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ res # main project resources โ”‚ย ย  โ”œโ”€โ”€ debug # debug variant - โ”‚ย ย  โ””โ”€โ”€ wasabi # wasabi variant specific resources and manifest + โ”‚ย ย  โ””โ”€โ”€ release # release variant ## Google Configuration ## diff --git a/WordPress/build.gradle b/WordPress/build.gradle index cd4cb1c3e5eb..175a865f6b33 100644 --- a/WordPress/build.gradle +++ b/WordPress/build.gradle @@ -54,11 +54,11 @@ fladle { } String appPathForVariant(String app) { - String path = "outputs/apk/${app}Vanilla/debug" + String path = "outputs/apk/${app}/debug" return new File(layout.buildDirectory.dir(path).get().asFile, '*.apk').absolutePath } String testPathForVariant(String app) { - String path = "outputs/apk/androidTest/${app}Vanilla/debug" + String path = "outputs/apk/androidTest/${app}/debug" return new File(layout.buildDirectory.dir(path).get().asFile, '*.apk').absolutePath } @@ -195,7 +195,7 @@ android { targetCompatibility JvmTarget.fromTarget(libs.versions.java.get()).target } - flavorDimensions = ['app', 'buildType'] + flavorDimensions = ['app'] productFlavors { @@ -242,29 +242,6 @@ android { resourceConfigurations += ["in", "iw"] } - // Used for release/beta testing builds. Usually shouldn't be build locally. - // AppName: WordPress/Jetpack - vanilla { - dimension "buildType" - - buildConfigField "boolean", "ENABLE_DEBUG_SETTINGS", "false" - } - - // Used for local development - preferred variant for developers. - // AppName: WordPress Beta/Jetpack Beta - wasabi { - isDefault true - applicationIdSuffix ".beta" - dimension "buildType" - } - - // Used for CI builds on PRs (aka "Prototype Builds"). Can be used locally when a developer needs to install multiple versions of the app on the same device. - // AppName: WordPress Pre-Alpha/Jetpack Pre-Alpha - jalapeno { - applicationIdSuffix ".prealpha" - dimension "buildType" - } - // Also dynamically add additional `buildConfigFields` to our app flavors from any `wp.`/`jp.`-prefixed property in `secrets.properties` addBuildConfigFieldsFromPrefixedProperties(wordpress, gradle.ext.secretProperties, ['wp']) addBuildConfigFieldsFromPrefixedProperties(jetpack, gradle.ext.secretProperties, ['wp', 'jp']) // Inherit same properties used from WP first then overwrite with JP-specific ones @@ -276,9 +253,11 @@ android { // but we don't obfuscate the bytecode. minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard.cfg' + buildConfigField "boolean", "ENABLE_DEBUG_SETTINGS", "false" } debug { + applicationIdSuffix ".prealpha" minifyEnabled false pseudoLocalesEnabled true } diff --git a/WordPress/google-services.json-example b/WordPress/google-services.json-example index 9d82f8b21c1e..feadc8cb4eff 100644 --- a/WordPress/google-services.json-example +++ b/WordPress/google-services.json-example @@ -88,48 +88,6 @@ } } }, - { - "client_info": { - "mobilesdk_app_id": "1:123:android:abc", - "android_client_info": { - "package_name": "org.wordpress.android.beta" - } - }, - "oauth_client": [ - { - "client_id": "123-abc.apps.googleusercontent.com", - "client_type": 3 - }, - { - "client_id": "", - "client_type": 1, - "android_info": { - "package_name": "org.wordpress.android.beta", - "certificate_hash": "" - } - } - ], - "api_key": [ - { - "current_key": "" - } - ], - "services": { - "analytics_service": { - "status": 2, - "analytics_property": { - "tracking_id": "" - } - }, - "appinvite_service": { - "status": 1, - "other_platform_oauth_client": [] - }, - "ads_service": { - "status": 1 - } - } - }, { "client_info": { "mobilesdk_app_id": "1:123:android:abc", @@ -213,48 +171,6 @@ "status": 1 } } - }, - { - "client_info": { - "mobilesdk_app_id": "1:123:android:abc", - "android_client_info": { - "package_name": "com.jetpack.android.beta" - } - }, - "oauth_client": [ - { - "client_id": "123-abc.apps.googleusercontent.com", - "client_type": 3 - }, - { - "client_id": "", - "client_type": 1, - "android_info": { - "package_name": "com.jetpack.android.beta", - "certificate_hash": "" - } - } - ], - "api_key": [ - { - "current_key": "" - } - ], - "services": { - "analytics_service": { - "status": 2, - "analytics_property": { - "tracking_id": "" - } - }, - "appinvite_service": { - "status": 1, - "other_platform_oauth_client": [] - }, - "ads_service": { - "status": 1 - } - } } ], "configuration_version": "1" diff --git a/WordPress/src/androidTest/java/org/wordpress/android/e2e/flows/LoginFlow.kt b/WordPress/src/androidTest/java/org/wordpress/android/e2e/flows/LoginFlow.kt index a8dcf13ecd86..fa4d06d183f8 100644 --- a/WordPress/src/androidTest/java/org/wordpress/android/e2e/flows/LoginFlow.kt +++ b/WordPress/src/androidTest/java/org/wordpress/android/e2e/flows/LoginFlow.kt @@ -57,7 +57,7 @@ class LoginFlow { // Follow the magic link to continue login // Intent is invoked directly rather than through a browser as WireMock is unavailable once in the background - val appVariant = BuildConfig.FLAVOR_app + val appVariant = BuildConfig.FLAVOR val intent = Intent(Intent.ACTION_VIEW, Uri.parse("$appVariant://magic-login?token=valid_token")) .setPackage(ApplicationProvider.getApplicationContext().packageName) diff --git a/WordPress/src/androidTest/java/org/wordpress/android/e2e/flows/SignupFlow.kt b/WordPress/src/androidTest/java/org/wordpress/android/e2e/flows/SignupFlow.kt index f98217559cb0..6ae284e2a53a 100644 --- a/WordPress/src/androidTest/java/org/wordpress/android/e2e/flows/SignupFlow.kt +++ b/WordPress/src/androidTest/java/org/wordpress/android/e2e/flows/SignupFlow.kt @@ -37,7 +37,7 @@ class SignupFlow { // Follow the magic link to continue login // Intent is invoked directly rather than through a browser as WireMock is unavailable once in the background - val appVariant = BuildConfig.FLAVOR_app // Either "wordpress" or "jetpack" + val appVariant = BuildConfig.FLAVOR // Either "wordpress" or "jetpack" val intent = Intent( Intent.ACTION_VIEW, Uri.parse("$appVariant://magic-login?token=valid_token&new_user=1") diff --git a/WordPress/src/jalapeno/res/drawable/app_icon_background.xml b/WordPress/src/debug/res/drawable/app_icon_background.xml similarity index 100% rename from WordPress/src/jalapeno/res/drawable/app_icon_background.xml rename to WordPress/src/debug/res/drawable/app_icon_background.xml diff --git a/WordPress/src/jalapeno/res/drawable/app_icon_foreground.xml b/WordPress/src/debug/res/drawable/app_icon_foreground.xml similarity index 100% rename from WordPress/src/jalapeno/res/drawable/app_icon_foreground.xml rename to WordPress/src/debug/res/drawable/app_icon_foreground.xml diff --git a/WordPress/src/jalapeno/res/mipmap-hdpi/app_icon.png b/WordPress/src/debug/res/mipmap-hdpi/app_icon.png similarity index 100% rename from WordPress/src/jalapeno/res/mipmap-hdpi/app_icon.png rename to WordPress/src/debug/res/mipmap-hdpi/app_icon.png diff --git a/WordPress/src/jalapeno/res/mipmap-xhdpi/app_icon.png b/WordPress/src/debug/res/mipmap-xhdpi/app_icon.png similarity index 100% rename from WordPress/src/jalapeno/res/mipmap-xhdpi/app_icon.png rename to WordPress/src/debug/res/mipmap-xhdpi/app_icon.png diff --git a/WordPress/src/jalapeno/res/mipmap-xxhdpi/app_icon.png b/WordPress/src/debug/res/mipmap-xxhdpi/app_icon.png similarity index 100% rename from WordPress/src/jalapeno/res/mipmap-xxhdpi/app_icon.png rename to WordPress/src/debug/res/mipmap-xxhdpi/app_icon.png diff --git a/WordPress/src/jalapeno/res/mipmap-xxxhdpi/app_icon.png b/WordPress/src/debug/res/mipmap-xxxhdpi/app_icon.png similarity index 100% rename from WordPress/src/jalapeno/res/mipmap-xxxhdpi/app_icon.png rename to WordPress/src/debug/res/mipmap-xxxhdpi/app_icon.png diff --git a/WordPress/src/jalapeno/res/values/strings.xml b/WordPress/src/debug/res/values/strings.xml similarity index 100% rename from WordPress/src/jalapeno/res/values/strings.xml rename to WordPress/src/debug/res/values/strings.xml diff --git a/WordPress/src/jalapeno/res/xml/shortcuts.xml b/WordPress/src/debug/res/xml/shortcuts.xml similarity index 100% rename from WordPress/src/jalapeno/res/xml/shortcuts.xml rename to WordPress/src/debug/res/xml/shortcuts.xml diff --git a/WordPress/src/jetpack/AndroidManifest.xml b/WordPress/src/jetpack/AndroidManifest.xml index 72ac098b9b8e..3d547885ece2 100644 --- a/WordPress/src/jetpack/AndroidManifest.xml +++ b/WordPress/src/jetpack/AndroidManifest.xml @@ -3,8 +3,6 @@ xmlns:tools="http://schemas.android.com/tools"> - - diff --git a/WordPress/src/jetpackJalapeno/res/mipmap-hdpi/app_icon.png b/WordPress/src/jetpackDebug/res/mipmap-hdpi/app_icon.png similarity index 100% rename from WordPress/src/jetpackJalapeno/res/mipmap-hdpi/app_icon.png rename to WordPress/src/jetpackDebug/res/mipmap-hdpi/app_icon.png diff --git a/WordPress/src/jetpackJalapeno/res/mipmap-xhdpi/app_icon.png b/WordPress/src/jetpackDebug/res/mipmap-xhdpi/app_icon.png similarity index 100% rename from WordPress/src/jetpackJalapeno/res/mipmap-xhdpi/app_icon.png rename to WordPress/src/jetpackDebug/res/mipmap-xhdpi/app_icon.png diff --git a/WordPress/src/jetpackJalapeno/res/mipmap-xxhdpi/app_icon.png b/WordPress/src/jetpackDebug/res/mipmap-xxhdpi/app_icon.png similarity index 100% rename from WordPress/src/jetpackJalapeno/res/mipmap-xxhdpi/app_icon.png rename to WordPress/src/jetpackDebug/res/mipmap-xxhdpi/app_icon.png diff --git a/WordPress/src/jetpackJalapeno/res/values/strings.xml b/WordPress/src/jetpackDebug/res/values/strings.xml similarity index 100% rename from WordPress/src/jetpackJalapeno/res/values/strings.xml rename to WordPress/src/jetpackDebug/res/values/strings.xml diff --git a/WordPress/src/jetpackJalapeno/res/xml/shortcuts.xml b/WordPress/src/jetpackDebug/res/xml/shortcuts.xml similarity index 100% rename from WordPress/src/jetpackJalapeno/res/xml/shortcuts.xml rename to WordPress/src/jetpackDebug/res/xml/shortcuts.xml diff --git a/WordPress/src/jetpackJalapeno/res/drawable/app_icon_background.xml b/WordPress/src/jetpackJalapeno/res/drawable/app_icon_background.xml deleted file mode 100644 index 7292ba5c118d..000000000000 --- a/WordPress/src/jetpackJalapeno/res/drawable/app_icon_background.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - diff --git a/WordPress/src/jetpackJalapeno/res/drawable/app_icon_foreground.xml b/WordPress/src/jetpackJalapeno/res/drawable/app_icon_foreground.xml deleted file mode 100644 index d9020ae84602..000000000000 --- a/WordPress/src/jetpackJalapeno/res/drawable/app_icon_foreground.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - diff --git a/WordPress/src/jetpackJalapeno/res/mipmap-xxxhdpi/app_icon.png b/WordPress/src/jetpackJalapeno/res/mipmap-xxxhdpi/app_icon.png deleted file mode 100644 index 1382f0d29fcd..000000000000 Binary files a/WordPress/src/jetpackJalapeno/res/mipmap-xxxhdpi/app_icon.png and /dev/null differ diff --git a/WordPress/src/jetpackWasabi/res/drawable/app_icon_background.xml b/WordPress/src/jetpackWasabi/res/drawable/app_icon_background.xml deleted file mode 100644 index d9d6942e437f..000000000000 --- a/WordPress/src/jetpackWasabi/res/drawable/app_icon_background.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - diff --git a/WordPress/src/jetpackWasabi/res/drawable/app_icon_foreground.xml b/WordPress/src/jetpackWasabi/res/drawable/app_icon_foreground.xml deleted file mode 100644 index 47afe14276e0..000000000000 --- a/WordPress/src/jetpackWasabi/res/drawable/app_icon_foreground.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - diff --git a/WordPress/src/jetpackWasabi/res/mipmap-hdpi/app_icon.png b/WordPress/src/jetpackWasabi/res/mipmap-hdpi/app_icon.png deleted file mode 100644 index 418c610332a7..000000000000 Binary files a/WordPress/src/jetpackWasabi/res/mipmap-hdpi/app_icon.png and /dev/null differ diff --git a/WordPress/src/jetpackWasabi/res/mipmap-xhdpi/app_icon.png b/WordPress/src/jetpackWasabi/res/mipmap-xhdpi/app_icon.png deleted file mode 100644 index 80075aedb5e7..000000000000 Binary files a/WordPress/src/jetpackWasabi/res/mipmap-xhdpi/app_icon.png and /dev/null differ diff --git a/WordPress/src/jetpackWasabi/res/mipmap-xxhdpi/app_icon.png b/WordPress/src/jetpackWasabi/res/mipmap-xxhdpi/app_icon.png deleted file mode 100644 index c894873b48bf..000000000000 Binary files a/WordPress/src/jetpackWasabi/res/mipmap-xxhdpi/app_icon.png and /dev/null differ diff --git a/WordPress/src/jetpackWasabi/res/mipmap-xxxhdpi/app_icon.png b/WordPress/src/jetpackWasabi/res/mipmap-xxxhdpi/app_icon.png deleted file mode 100644 index fd8d0e1af16e..000000000000 Binary files a/WordPress/src/jetpackWasabi/res/mipmap-xxxhdpi/app_icon.png and /dev/null differ diff --git a/WordPress/src/jetpackWasabi/res/values/strings.xml b/WordPress/src/jetpackWasabi/res/values/strings.xml deleted file mode 100644 index 6bb9cb282379..000000000000 --- a/WordPress/src/jetpackWasabi/res/values/strings.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - Jetpack Beta - diff --git a/WordPress/src/jetpackWasabi/res/xml/shortcuts.xml b/WordPress/src/jetpackWasabi/res/xml/shortcuts.xml deleted file mode 100644 index dda037bc5c3c..000000000000 --- a/WordPress/src/jetpackWasabi/res/xml/shortcuts.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/WordPress/src/main/java/org/wordpress/android/util/publicdata/JetpackPublicData.kt b/WordPress/src/main/java/org/wordpress/android/util/publicdata/JetpackPublicData.kt index 903953ee1927..d0cb2cec2f4f 100644 --- a/WordPress/src/main/java/org/wordpress/android/util/publicdata/JetpackPublicData.kt +++ b/WordPress/src/main/java/org/wordpress/android/util/publicdata/JetpackPublicData.kt @@ -1,38 +1,30 @@ package org.wordpress.android.util.publicdata import org.wordpress.android.BuildConfig -import org.wordpress.android.util.publicdata.JetpackPublicData.PackageName.Jalapeno -import org.wordpress.android.util.publicdata.JetpackPublicData.PackageName.Vanilla -import org.wordpress.android.util.publicdata.JetpackPublicData.PackageName.Wasabi import org.wordpress.android.util.publicdata.JetpackPublicData.PublicKeyHash.Debug import org.wordpress.android.util.publicdata.JetpackPublicData.PublicKeyHash.Release import javax.inject.Inject class JetpackPublicData @Inject constructor() { private sealed class PublicKeyHash(val type: String, val value: String) { - object Release : PublicKeyHash("release", "f2d7acc12614750009514a0932bf0b0aa9c11829a66e862ce4572bced344e76e") - - object Debug : PublicKeyHash("debug", "60fca11c59c6933610146f40a1296250abff640dc5da2b85fc8e5aa411dd17d6") + object Release : PublicKeyHash( + "release", + "f2d7acc12614750009514a0932bf0b0aa9c11829a66e862ce4572bced344e76e" + ) + + object Debug : PublicKeyHash( + "debug", + "60fca11c59c6933610146f40a1296250abff640dc5da2b85fc8e5aa411dd17d6" + ) } fun currentPublicKeyHash() = when (BuildConfig.BUILD_TYPE) { Release.type -> Release.value Debug.type -> Debug.value - else -> throw IllegalArgumentException("Failed to get Jetpack public key hash: build type not found") - } - - private sealed class PackageName(val type: String, val value: String) { - object Jalapeno : PackageName("jalapeno", "com.jetpack.android.prealpha") - - object Vanilla : PackageName("vanilla", "com.jetpack.android") - - object Wasabi : PackageName("wasabi", "com.jetpack.android.beta") + else -> throw IllegalArgumentException( + "Failed to get Jetpack public key hash: build type not found" + ) } - fun currentPackageId(): String = when (BuildConfig.FLAVOR_buildType) { - Jalapeno.type -> Jalapeno.value - Vanilla.type -> Vanilla.value - Wasabi.type -> Wasabi.value - else -> throw IllegalArgumentException("Failed to get Jetpack package ID: build flavor not found.") - } + fun currentPackageId(): String = BuildConfig.APPLICATION_ID } diff --git a/WordPress/src/main/java/org/wordpress/android/util/publicdata/WordPressPublicData.kt b/WordPress/src/main/java/org/wordpress/android/util/publicdata/WordPressPublicData.kt index e0c6c7912b9c..e3c9e5d29180 100644 --- a/WordPress/src/main/java/org/wordpress/android/util/publicdata/WordPressPublicData.kt +++ b/WordPress/src/main/java/org/wordpress/android/util/publicdata/WordPressPublicData.kt @@ -1,39 +1,26 @@ package org.wordpress.android.util.publicdata import org.wordpress.android.BuildConfig -import org.wordpress.android.util.publicdata.WordPressPublicData.PackageName.Jalapeno -import org.wordpress.android.util.publicdata.WordPressPublicData.PackageName.Vanilla -import org.wordpress.android.util.publicdata.WordPressPublicData.PackageName.Wasabi import javax.inject.Inject class WordPressPublicData @Inject constructor(private val packageManagerWrapper: PackageManagerWrapper) { - private sealed class PackageName(val type: String, val value: String) { - object Jalapeno : PackageName("jalapeno", "org.wordpress.android.prealpha") + fun currentPackageId(): String = BuildConfig.APPLICATION_ID - object Vanilla : PackageName("vanilla", "org.wordpress.android") - - object Wasabi : PackageName("wasabi", "org.wordpress.android.beta") - } - - fun currentPackageId(): String = when (BuildConfig.FLAVOR_buildType) { - Jalapeno.type -> Jalapeno.value - Vanilla.type -> Vanilla.value - Wasabi.type -> Wasabi.value - else -> throw IllegalArgumentException("Failed to get Jetpack package ID: build flavor not found.") - } - - fun currentPackageVersion(): String? = packageManagerWrapper.getPackageInfo(currentPackageId())?.versionName + fun currentPackageVersion(): String? = + packageManagerWrapper.getPackageInfo(currentPackageId())?.versionName fun nonSemanticPackageVersion(): String? { val rawVersion = currentPackageVersion() ?: return null - // Clean app semantic versioning and keep ony major-minor version info. E.g 21.2-rc-3 turns to 21.2 + // Clean app semantic versioning and keep ony major-minor version info. + // E.g 21.2-rc-3 turns to 21.2 val majorMinorRegex = "^(\\d*)(\\.(\\d*))".toRegex() val wordPressVersion = majorMinorRegex.find(rawVersion)?.value - // Verify that the resulting version is supported by org.wordpress.android.util.helpers.Version.Version - val versionIsSupportedForComparison = wordPressVersion != null - && Regex("[0-9]+(\\.[0-9]+)*").matchEntire(wordPressVersion) != null + // Verify that the resulting version is supported by + // org.wordpress.android.util.helpers.Version.Version + val versionIsSupportedForComparison = wordPressVersion != null && + Regex("[0-9]+(\\.[0-9]+)*").matchEntire(wordPressVersion) != null return if (versionIsSupportedForComparison) wordPressVersion else null } diff --git a/WordPress/src/wasabi/res/drawable/app_icon_background.xml b/WordPress/src/wasabi/res/drawable/app_icon_background.xml deleted file mode 100644 index 0728870d6c48..000000000000 --- a/WordPress/src/wasabi/res/drawable/app_icon_background.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - diff --git a/WordPress/src/wasabi/res/drawable/app_icon_foreground.xml b/WordPress/src/wasabi/res/drawable/app_icon_foreground.xml deleted file mode 100644 index 41d001c4dfa4..000000000000 --- a/WordPress/src/wasabi/res/drawable/app_icon_foreground.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - diff --git a/WordPress/src/wasabi/res/mipmap-hdpi/app_icon.png b/WordPress/src/wasabi/res/mipmap-hdpi/app_icon.png deleted file mode 100755 index 9a1e077c96bf..000000000000 Binary files a/WordPress/src/wasabi/res/mipmap-hdpi/app_icon.png and /dev/null differ diff --git a/WordPress/src/wasabi/res/mipmap-xhdpi/app_icon.png b/WordPress/src/wasabi/res/mipmap-xhdpi/app_icon.png deleted file mode 100755 index 57025d570381..000000000000 Binary files a/WordPress/src/wasabi/res/mipmap-xhdpi/app_icon.png and /dev/null differ diff --git a/WordPress/src/wasabi/res/mipmap-xxhdpi/app_icon.png b/WordPress/src/wasabi/res/mipmap-xxhdpi/app_icon.png deleted file mode 100755 index d5ac32f20fb5..000000000000 Binary files a/WordPress/src/wasabi/res/mipmap-xxhdpi/app_icon.png and /dev/null differ diff --git a/WordPress/src/wasabi/res/mipmap-xxxhdpi/app_icon.png b/WordPress/src/wasabi/res/mipmap-xxxhdpi/app_icon.png deleted file mode 100755 index 8b6244052343..000000000000 Binary files a/WordPress/src/wasabi/res/mipmap-xxxhdpi/app_icon.png and /dev/null differ diff --git a/WordPress/src/wasabi/res/values/strings.xml b/WordPress/src/wasabi/res/values/strings.xml deleted file mode 100644 index fec1b13fec7b..000000000000 --- a/WordPress/src/wasabi/res/values/strings.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - WordPress Beta - diff --git a/WordPress/src/wasabi/res/xml/shortcuts.xml b/WordPress/src/wasabi/res/xml/shortcuts.xml deleted file mode 100644 index f861b18da46e..000000000000 --- a/WordPress/src/wasabi/res/xml/shortcuts.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/config/gradle/code_coverage.gradle b/config/gradle/code_coverage.gradle index fa222ab1961b..efad9b3ebbb2 100644 --- a/config/gradle/code_coverage.gradle +++ b/config/gradle/code_coverage.gradle @@ -1,6 +1,6 @@ static String resolveProjectVariantForCodeCoverage(Project project) { if (project.name == "WordPress") { - return "wordpressVanillaRelease" + return "wordpressRelease" } else { return "release" } diff --git a/docs/coding-style.md b/docs/coding-style.md index e9af04022ec7..272072aa0ec4 100644 --- a/docs/coding-style.md +++ b/docs/coding-style.md @@ -5,7 +5,7 @@ Our code style guidelines are based on the [Android Code Style Guidelines for Co * Line length is 120 characters * FIXME must not be committed in the repository use TODO instead. FIXME can be used in your own local repository only. -On top of the Android linter rules (best run for this project using `./gradlew lintWordPressVanillaRelease`), we use two linters: [Checkstyle](https://checkstyle.sourceforge.io/) (for Java and some language-independent custom project rules), and [detekt](https://detekt.dev/) (for Kotlin). +On top of the Android linter rules (best run for this project using `./gradlew lintWordPressRelease`), we use two linters: [Checkstyle](https://checkstyle.sourceforge.io/) (for Java and some language-independent custom project rules), and [detekt](https://detekt.dev/) (for Kotlin). ## Checkstyle You can run checkstyle via a gradle command: diff --git a/docs/test_instructions_per_dependency_update.md b/docs/test_instructions_per_dependency_update.md index 206d599bf238..bc6f3def4097 100644 --- a/docs/test_instructions_per_dependency_update.md +++ b/docs/test_instructions_per_dependency_update.md @@ -355,8 +355,8 @@ Step.3: - I recommend using a `versionCode` of `1000000001` and above. - I recommend using an explicit `versionName` like `deps-update-google-play-services-20-4-1` (similar to the name of this branch itself) -- Build the release `.aab` locally using this command: `./gradlew bundleJetpackVanillaRelease` -- Upload the locally generated `.aab`, found within the `WordPress/build/outputs/bundle/jetpackVanillaRelease/` +- Build the release `.aab` locally using this command: `./gradlew bundleJetpackRelease` +- Upload the locally generated `.aab`, found within the `WordPress/build/outputs/bundle/jetpackRelease/` build folder, and into Google Play Console (`Jetpack - Website Builder`) via: `App Bundle Explorer` > `Upload new version` (top-right) - Wait for the upload to complete, then via this newly uploaded app version, navigation to the @@ -385,8 +385,8 @@ Step.3: - I recommend using a `versionCode` of `1000000001` and above. - I recommend using an explicit `versionName` like `deps-update-google-play-services-20-4-1` (similar to the name of this branch itself) -- Build the release `.aab` locally using this command: `./gradlew bundleWordPressVanillaRelease` -- Upload the locally generated `.aab`, found within the `WordPress/build/outputs/bundle/wordpressVanillaRelease/` +- Build the release `.aab` locally using this command: `./gradlew bundleWordPressRelease` +- Upload the locally generated `.aab`, found within the `WordPress/build/outputs/bundle/wordpressRelease/` build folder, and into Google Play Console (`WordPress - Website Builder`) via: `App Bundle Explorer` > `Upload new version` (top-right) - Wait for the upload to complete, then via this newly uploaded app version, navigation to the @@ -833,7 +833,7 @@ bumping `sentryVersion`. #### To Test -Please build the release variant (`vanillaRelease`) of both WordPress and Jetpack flavors and verify if issues are sent correctly. You can use the following snippet. +Please build the release variant of both WordPress and Jetpack flavors and verify if issues are sent correctly. You can use the following snippet.
PATCH (warning: it'll probably have some conflicts in the future when `WPMainActivityViewModel` change. It's more for an idea: diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 1133a6d23b3a..c74b73ac7fe2 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -35,7 +35,6 @@ APP_SPECIFIC_VALUES = { UPLOAD_TO_PLAY_STORE_JSON_KEY = File.join(Dir.home, '.configure', 'wordpress-android', 'secrets', 'google-upload-credentials.json') -PROTOTYPE_BUILD_FLAVOR = 'Jalapeno' PROTOTYPE_BUILD_TYPE = 'Debug' PROJECT_ROOT_FOLDER = File.dirname(File.expand_path(__dir__)) diff --git a/fastlane/lanes/build.rb b/fastlane/lanes/build.rb index d7338405d40b..faeb62695196 100644 --- a/fastlane/lanes/build.rb +++ b/fastlane/lanes/build.rb @@ -34,7 +34,7 @@ # Create the file names app = get_app_name_option!(options) version_name = current_version_name - build_bundle(app: app, version_name: version_name, build_code: current_build_code, flavor: 'Vanilla', buildType: 'Release') + build_bundle(app: app, version_name: version_name, build_code: current_build_code, buildType: 'Release') upload_build_to_play_store(app: app, version_name: version_name, track: 'production') upload_gutenberg_sourcemaps(app: app, release_version: version_name) @@ -103,7 +103,7 @@ # Create the file names app = get_app_name_option!(options) version_name = current_version_name - build_bundle(app: app, version_name: version_name, build_code: current_build_code, flavor: 'Vanilla', buildType: 'Release') + build_bundle(app: app, version_name: version_name, build_code: current_build_code, buildType: 'Release') upload_build_to_play_store(app: app, version_name: version_name, track: 'beta') if options[:upload_to_play_store] upload_gutenberg_sourcemaps(app: app, release_version: version_name) @@ -214,7 +214,7 @@ version_name = generate_prototype_build_number gradle( task: 'assemble', - flavor: "WordPress#{PROTOTYPE_BUILD_FLAVOR}", + flavor: 'WordPress', build_type: PROTOTYPE_BUILD_TYPE, properties: { prototypeBuildVersionName: version_name } ) @@ -238,7 +238,7 @@ version_name = generate_prototype_build_number gradle( task: 'assemble', - flavor: "Jetpack#{PROTOTYPE_BUILD_FLAVOR}", + flavor: 'Jetpack', build_type: PROTOTYPE_BUILD_TYPE, properties: { prototypeBuildVersionName: version_name } ) @@ -270,13 +270,13 @@ prefix = APP_SPECIFIC_VALUES[app.to_sym][:bundle_name_prefix] name = "#{prefix}-#{version_name}.aab" - aab_file = "org.wordpress.android-#{app}-#{options[:flavor]}-#{options[:buildType]}.aab".downcase + aab_file = "org.wordpress.android-#{app}-#{options[:buildType]}.aab".downcase output_dir = 'WordPress/build/outputs/bundle/' build_dir = 'build/' logfile_path = "#{build_dir}build.log" # Intermediate Variables - bundle_path = "#{output_dir}#{app}#{options[:flavor].capitalize}#{options[:buildType].capitalize}/#{aab_file}" + bundle_path = "#{output_dir}#{app}#{options[:buildType].capitalize}/#{aab_file}" # Build Dir.chdir('..') do @@ -290,14 +290,14 @@ if options[:skip_lint].nil? UI.message('Running lint...') sh("echo \"Running lint...\" >> #{logfile_path}") - sh("./gradlew lint#{app}#{options[:flavor]}#{options[:buildType]} >> #{logfile_path} 2>&1") unless is_ci + sh("./gradlew lint#{app}#{options[:buildType]} >> #{logfile_path} 2>&1") unless is_ci else UI.message('Skipping lint...') end UI.message("Building #{version_name} / #{build_code} - #{aab_file}...") sh("echo \"Building #{version_name} / #{build_code} - #{aab_file}...\" >> #{logfile_path}") - sh("./gradlew bundle#{app}#{options[:flavor]}#{options[:buildType]} >> #{logfile_path} 2>&1") + sh("./gradlew bundle#{app}#{options[:buildType]} >> #{logfile_path} 2>&1") UI.crash!("Unable to find a bundle at #{bundle_path}") unless File.file?(bundle_path) @@ -342,7 +342,6 @@ def upload_prototype_build(app:, version_name:) app_display_name: "#{app_display_name} Android", app_icon: ":#{app}:", metadata: { - Flavor: PROTOTYPE_BUILD_FLAVOR, 'Build Type': PROTOTYPE_BUILD_TYPE, Version: version_name } diff --git a/fastlane/lanes/screenshots.rb b/fastlane/lanes/screenshots.rb index ab0054b0641e..ef63e0537f8c 100644 --- a/fastlane/lanes/screenshots.rb +++ b/fastlane/lanes/screenshots.rb @@ -32,7 +32,7 @@ lane :screenshots do |options| app = get_app_name_option!(options) - gradle(tasks: ["assemble#{app.to_s.capitalize}VanillaDebug", "assemble#{app.to_s.capitalize}VanillaDebugAndroidTest"]) + gradle(tasks: ["assemble#{app.to_s.capitalize}Debug", "assemble#{app.to_s.capitalize}DebugAndroidTest"]) # Clear previous screenshots if we build for all devices. Don't clear if we only do a subset should_clear_previous_screenshots = options[:device].nil? && options[:locale].nil? @@ -57,8 +57,8 @@ serial = android_launch_emulator(avd_name: name) # Launch an emulator using this AVD and get its serial number, to know which emulator to run the tests on capture_android_screenshots( - app_apk_path: File.join(apk_dir, "#{app}Vanilla", 'debug', "org.wordpress.android-#{app}-vanilla-debug.apk"), - tests_apk_path: File.join(apk_dir, 'androidTest', "#{app}Vanilla", 'debug', "org.wordpress.android-#{app}-vanilla-debug-androidTest.apk"), + app_apk_path: File.join(apk_dir, app.to_s, 'debug', "org.wordpress.android-#{app}-debug.apk"), + tests_apk_path: File.join(apk_dir, 'androidTest', app.to_s, 'debug', "org.wordpress.android-#{app}-debug-androidTest.apk"), reinstall_app: false, clear_previous_screenshots: should_clear_previous_screenshots, app_package_name: package_name, diff --git a/fastlane/lanes/test.rb b/fastlane/lanes/test.rb index 0dc3c4acfd90..771f3e6b55e8 100644 --- a/fastlane/lanes/test.rb +++ b/fastlane/lanes/test.rb @@ -15,9 +15,9 @@ lane :build_and_run_instrumented_test do |options| app = get_app_name_option!(options) - gradle(tasks: ["WordPress:assemble#{app.to_s.capitalize}VanillaDebug", "WordPress:assemble#{app.to_s.capitalize}VanillaDebugAndroidTest"]) + gradle(tasks: ["WordPress:assemble#{app.to_s.capitalize}Debug", "WordPress:assemble#{app.to_s.capitalize}DebugAndroidTest"]) - annotation_ctx = "firebase-test-#{app}-vanilla-debug" + annotation_ctx = "firebase-test-#{app}-debug" begin gradle(task: "runFlank#{app.to_s.capitalize}") sh("buildkite-agent annotation remove --context '#{annotation_ctx}' || true") if is_ci? diff --git a/gradle.properties b/gradle.properties index 055a39e39728..18fcd989917a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -11,5 +11,5 @@ android.nonFinalResIds=true android.enableR8.fullMode=false # Dependency Analysis Plugin -dependency.analysis.android.ignored.variants=release,wordpressVanillaDebug,wordpressVanillaRelease,wordpressWasabiDebug,wordpressWasabiRelease,wordpressJalapenoRelease,jetpackVanillaDebug,jetpackVanillaRelease,jetpackWasabiDebug,jetpackWasabiRelease,jetpackJalapenoRelease +dependency.analysis.android.ignored.variants=release,wordpressRelease,jetpackRelease dependency.analysis.test.analysis=false diff --git a/libs/posttypes/README.md b/libs/posttypes/README.md index 321eb33f1183..bc99ee51ca33 100644 --- a/libs/posttypes/README.md +++ b/libs/posttypes/README.md @@ -147,5 +147,5 @@ When adding new functionality to this module: ./gradlew :libs:posttypes:assembleDebug # Build the full app (verifies integration) -./gradlew assembleWordPressVanillaDebug +./gradlew assembleWordPressDebug ```