Skip to content

Conversation

@ben-efiz
Copy link

This cool little gradle plugin has one issue in case the git repo is dirty, meaning has unstaged or uncommitted changes.
The branch name and short commit hash on the app icon is not indicating if the the repo was dirty when compiling so you can't really rely on the information when giving the debug build to someone. It might have some unknown changes compiled in this build or not.

I suggest to detect if git repo is dirty and show it with different text colour, e.g. red. Of course other visualizations would be possible e.g. $branch\n$commit\n(dirty), but i leave this for discussion.

The implementation provides a flag to enable/disable the dirty check (disabled by default, could be enabled by default?).

@ben-efiz
Copy link
Author

I didn't implement a check for untracked files so far, but i think this is an issue as well. Think about the following cases

  • new untracked resource in some area (drawable, values) which might be used on some devices
  • new untracked AndroidManifest.xml for some flavor(s) with different content
  • new untracked Java classes for some flavor(s) which can result in different byte code if debug build was using the flavor
  • ...

Could be worth integrating this in the dirty check too?

… could be the same text as format if only dirtyColor is wanted.
@ben-efiz
Copy link
Author

I just pushed the mentioned additional dirtyFormat text used in case the git repo is dirty. It still can be set to the normal format string if the additional text "(dirty)" is not wished.
I can squash the commits to one if wished.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant