[PR #2161] [MERGED] [EC-655] Adds build variants to the mobile codebase using a CAKE script #3397

Closed
opened 2025-11-26 23:32:11 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/2161
Author: @vvolkgang
Created: 10/31/2022
Status: Merged
Merged: 11/1/2022
Merged by: @vvolkgang

Base: masterHead: feature/cake-build


📝 Commits (10+)

  • dc26d89 Implemented CAKE build script
  • a27488a cake script now deals with all of iOS's .plists
  • 1fce72b cake now updates iOS bundleid's / Android packagename in codefiles
  • b93bc92 Merge branch 'master' into feature/cake-build
  • 1c1e24f iOS Bundle ID / Name should be correctly handled now + refactor
  • 5c155a8 tabs -> spaces
  • b87e888 Additional code files are now handled by cake
  • 727c52e Additional iOS codefile changes required
  • 6e61e1a Android's Autofill Label is now changed
  • 85e05d8 Removed dash from packagenames / bundleIDs

📊 Changes

4 files changed (+402 additions, -25 deletions)

View changed files

📝 .config/dotnet-tools.json (+6 -0)
📝 .github/workflows/build.yml (+49 -24)
📝 .gitignore (+2 -1)
build.cake (+345 -0)

📄 Description

Type of change

  • Bug fix
  • New feature development
  • Tech debt (refactoring, code cleanup, dependency upgrades, etc)
  • Build/deploy pipeline (DevOps)
  • Other

Objective

Enable the creation of build variants (dev, beta, qa and prod) that can be installed independently, using CAKE. Deprecates #1659

This CAKE script currently serves as a preprocessor only that prepares the codebase for the given variant. We'll still use our IDE to compile and deploy our app.

Additionally, our build action was updated to include both prod and qa build variants. We can build on top of this to support additional variants.

Script Usage:

  1. In your cmdline, navigate to the location of our build.cake
  2. Run dotnet tool restore to install CAKE.
  3. Run the CAKE script by supplying your desired build Target and Variant
    1. Script takes two arguments,--target and --variant
      • --target can have one of the following options: Android, iOS
      • --variant can have one of the following options: dev, beta, qa, prod
    2. E.g. dotnet cake build.cake --target Android --variant qa
    3. E.g. dotnet cake build.cake --target iOS --variant dev
  4. Open your IDE and compile the project

Script development tips:

  • Run the script and check the changes in your git tool

Code changes

.config/dotnet-tools.json: Makes sure CAKE is installed when dotnet tool restore is run
.github/workflows/build.yml: Updated by #2144
.gitignore: CAKE tools are installed in the /tools directory and shouldn't be versioned
build.cake: CAKE script responsible for preprocessing our codebase

Screenshots

Before you submit

  • Please check for formatting errors (dotnet format --verify-no-changes) (required)
  • Please add unit tests where it makes sense to do so (encouraged but not required)
  • If this change requires a documentation update - notify the documentation team
  • If this change has particular deployment requirements - notify the DevOps team

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/bitwarden/android/pull/2161 **Author:** [@vvolkgang](https://github.com/vvolkgang) **Created:** 10/31/2022 **Status:** ✅ Merged **Merged:** 11/1/2022 **Merged by:** [@vvolkgang](https://github.com/vvolkgang) **Base:** `master` ← **Head:** `feature/cake-build` --- ### 📝 Commits (10+) - [`dc26d89`](https://github.com/bitwarden/android/commit/dc26d8908ac5b596bbab7d2658f58d6cbbaa9f04) Implemented CAKE build script - [`a27488a`](https://github.com/bitwarden/android/commit/a27488a21701d4eafa8fca93cee7b83ca0f65017) cake script now deals with all of iOS's .plists - [`1fce72b`](https://github.com/bitwarden/android/commit/1fce72b0d0505b9e2dcb611b97df4e622a4b7d66) cake now updates iOS bundleid's / Android packagename in codefiles - [`b93bc92`](https://github.com/bitwarden/android/commit/b93bc92b8653423343d2cfcdf79d1bb709ebf870) Merge branch 'master' into feature/cake-build - [`1c1e24f`](https://github.com/bitwarden/android/commit/1c1e24f10efe334356381d947e9b4147b151d406) iOS Bundle ID / Name should be correctly handled now + refactor - [`5c155a8`](https://github.com/bitwarden/android/commit/5c155a85b1b858c7ea9d36965356bfa27989cdee) tabs -> spaces - [`b87e888`](https://github.com/bitwarden/android/commit/b87e8887b03cbe5068bf11af24f7958421f0af2e) Additional code files are now handled by cake - [`727c52e`](https://github.com/bitwarden/android/commit/727c52e67a50aff81d70f35f5bef79ec6a2737f3) Additional iOS codefile changes required - [`6e61e1a`](https://github.com/bitwarden/android/commit/6e61e1a11f052cc74c7472917744aa68ce2dedc0) Android's Autofill Label is now changed - [`85e05d8`](https://github.com/bitwarden/android/commit/85e05d8244ee8198f42e1249057ce0f984986cb4) Removed dash from packagenames / bundleIDs ### 📊 Changes **4 files changed** (+402 additions, -25 deletions) <details> <summary>View changed files</summary> 📝 `.config/dotnet-tools.json` (+6 -0) 📝 `.github/workflows/build.yml` (+49 -24) 📝 `.gitignore` (+2 -1) ➕ `build.cake` (+345 -0) </details> ### 📄 Description ## Type of change - [ ] Bug fix - [x] New feature development - [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc) - [ ] Build/deploy pipeline (DevOps) - [ ] Other ## Objective Enable the creation of build variants (`dev`, `beta`, `qa` and `prod`) that can be installed independently, using [CAKE](http://cakebuild.net/). Deprecates #1659 This CAKE script currently serves as a preprocessor only that prepares the codebase for the given variant. We'll still use our IDE to compile and deploy our app. Additionally, our build action was updated to include both `prod` and `qa` build variants. We can build on top of this to support additional variants. Script Usage: 1. In your cmdline, navigate to the location of our `build.cake` 1. Run `dotnet tool restore` to install CAKE. 1. Run the CAKE script by supplying your desired build Target and Variant 1. Script takes two arguments,`--target` and `--variant` * `--target` can have **one** of the following options: `Android`, `iOS` * `--variant` can have **one** of the following options: `dev`, `beta`, `qa`, `prod` 1. E.g. `dotnet cake build.cake --target Android --variant qa` 1. E.g. `dotnet cake build.cake --target iOS --variant dev` 1. Open your IDE and compile the project Script development tips: * Run the script and check the changes in your git tool ## Code changes **.config/dotnet-tools.json:** Makes sure CAKE is installed when `dotnet tool restore` is run **.github/workflows/build.yml:** Updated by #2144 **.gitignore:** CAKE tools are installed in the `/tools` directory and shouldn't be versioned **build.cake:** CAKE script responsible for preprocessing our codebase ## Screenshots <!--Required for any UI changes. Delete if not applicable--> ## Before you submit - Please check for formatting errors (`dotnet format --verify-no-changes`) (required) - Please add **unit tests** where it makes sense to do so (encouraged but not required) - If this change requires a **documentation update** - notify the documentation team - If this change has particular **deployment requirements** - notify the DevOps team --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-26 23:32:11 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#3397