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

Update default local version code #504

Merged
merged 1 commit into from
Aug 8, 2023

Conversation

linhpha
Copy link
Collaborator

@linhpha linhpha commented Aug 8, 2023

I forgot to update the default version code for local build in #503. Before, devs usually get 30009999. This PR updates the version to be 90009999 to make it consistent with CI build number

@github-actions
Copy link

github-actions bot commented Aug 8, 2023

  1. The code can be improved by using a more descriptive name for the constant DEFAULT_VERSION_CODE. Instead of DEFAULT_VERSION_CODE, a more appropriate name could be MAX_VERSION_CODE.

  2. The value of MAX_VERSION_CODE can be calculated dynamically based on the maximum value of an Int in Kotlin. This will ensure that the maximum possible version code is used, regardless of the platform or architecture.

  3. The constant MAX_VERSION_CODE can be declared as a top-level constant outside the ApkVersioning object. This will make it more accessible and reusable throughout the codebase.

Here's an example of how the code can be improved:

internal class ApkVersioningPlugin : Plugin<Project> {

    private object ApkVersioning {
        // Remove the DEFAULT_VERSION_CODE constant
    }

    companion object {
        const val MAX_VERSION_CODE: Int = Int.MAX_VALUE
    }

    // Rest of the code...
}

By making these changes, the code will be more readable and maintainable. Additionally, the maximum possible version code will be used, ensuring that it is always greater than any other version code.

@ZacSweers ZacSweers added this pull request to the merge queue Aug 8, 2023
@ZacSweers ZacSweers removed this pull request from the merge queue due to a manual request Aug 8, 2023
@ZacSweers ZacSweers merged commit 344dd79 into main Aug 8, 2023
3 checks passed
@ZacSweers ZacSweers deleted the lp_update_default_apk_version_local branch August 8, 2023 03:06
ZacSweers pushed a commit that referenced this pull request Aug 8, 2023
I forgot to update the default version code for local build in #503.
Before, devs usually get 30009999. This PR updates the version to be
90009999 to make it consistent with CI build number



<!--
  ⬆ Put your description above this! ⬆

  Please be descriptive and detailed.
  
Please read our [Contributing
Guidelines](https://github.com/tinyspeck/slack-gradle-plugin/blob/main/.github/CONTRIBUTING.md)
and [Code of Conduct](https://slackhq.github.io/code-of-conduct).

Don't worry about deleting this, it's not visible in the PR!
-->
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.

2 participants