Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support resource customization #1739

Merged
merged 2 commits into from
Apr 27, 2023

Conversation

vitorhugods
Copy link
Member


PR Submission Checklist for internal contributors

  • The PR Title

    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • answers the question: If merged, this PR will: ... ³
  • The PR Description

    • is free of optional paragraphs and you have filled the relevant parts to the best of your ability

What's new in this PR?

Issues

Customers with custom builds need some resources to be overriden.

Solutions

Check if the customization directory also contains a resources directory inside of it.
If it does, grab all files from inside the resources directory and copy them into res of each flavor, keeping the file structure.

Example:

-custom/
 |-resources/
 | |-mipmap/
 |   |-file1.png
 | |-file2.png
  -
  • file2.png will be copied to res/file2.png
  • file1.png will be copied to res/mipmap/file1.png

This is applied to all flavors. It doesn't allow flavor-specific resources for custom builds. A new custom build is needed in order to do it.

Testing

Tested manually.

Coverage will be added Soon™.

Test Coverage (Optional)

  • I have added automated test to this contribution

How to Test

Force a customized build by adding a custom.json file:

val buildtimeConfiguration = getBuildtimeConfiguration(rootDir = rootDir,
    Customization.CustomizationOption.FromFile(rootProject.file("custom/custom-reloaded.json"))
)

Add a resources directory beside the custom-reloaded.json file.
Its content will be copied to all flavours.


PR Post Merge Checklist for internal contributors

  • If any soft of configuration variable was introduced by this PR, it has been added to the relevant documents and the CI jobs have been updated.

References
  1. https://sparkbox.com/foundry/semantic_commit_messages
  2. https://github.com/wireapp/.github#usage
  3. E.g. feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764.

@github-actions
Copy link
Contributor

Unit Test Results

  59 files    59 suites   39s ⏱️
405 tests 404 ✔️ 1 💤 0

Results for commit 331d01e.

@github-actions
Copy link
Contributor

Build available here. Scroll down to Artifacts!

@AndroidBob
Copy link
Collaborator

Build 1 succeeded.

The build produced the following APK's:

* @return the [NormalizedFlavorSettings], result from the importing of configuration files.
* @return the [BuildTimeConfiguration], result from the importing of configuration files.
*/
fun getBuildtimeConfiguration(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
fun getBuildtimeConfiguration(
fun getBuildTimeConfiguration(

Maybe? 🤔

@vitorhugods vitorhugods merged commit e1bb144 into release/candidate Apr 27, 2023
@vitorhugods vitorhugods deleted the feat/support_resource_customization branch April 27, 2023 14:58
tmspzz pushed a commit that referenced this pull request Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants