Skip to content

Conversation

@azlekov
Copy link
Contributor

@azlekov azlekov commented Oct 15, 2021

New Pull Request Checklist

Issue Description

The Parse SDK modules ware missing versionName and versionCode configurations.
In latest version of the AGP and Android Studio, Google remove BuildConfig.VERSION_NAME and BuildConfig.VERSION_CODE for a library modules and they try to make it hard using in next releases. I got some information form here.

Related issue: #1121
Closes: #1068
Closes: #1121

Approach

Add version to gradle.properties which can be managed using gradle-semantic-release-plugin and pass this version to the BuildConfig class, so the version is available runtime. BuildConfig.PARSE_VERSION field was introduced for all modules instead of using and maintain two (BuildConfig.VERSION_NAME and BuildConfig.VERSION_CODE) which we are not sure if will work next releases.

When update current ParseInstallation we set the Parse version to the one from the BuildConfig class.

TODOs before merging

  • Add tests
  • Add changes to documentation (guides, repository pages, in-code descriptions)
  • A changelog entry is created automatically using the pull request title (do not manually add a changelog entry)

Add PARSE_VERSION to all modules BuildConfig. Remove depricated versionCode and versionName from all library modules
@azlekov azlekov requested a review from mtrezza October 15, 2021 14:24
@parse-github-assistant
Copy link

parse-github-assistant bot commented Oct 15, 2021

Thanks for opening this pull request!

  • 🎉 We are excited about your hands-on contribution!

@codecov
Copy link

codecov bot commented Oct 15, 2021

Codecov Report

Merging #1130 (4fa05d4) into master (d28e64d) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #1130   +/-   ##
=========================================
  Coverage     65.29%   65.29%           
  Complexity     2218     2218           
=========================================
  Files           122      122           
  Lines          9960     9961    +1     
  Branches       1337     1337           
=========================================
+ Hits           6503     6504    +1     
  Misses         2945     2945           
  Partials        512      512           
Impacted Files Coverage Δ
...rse/src/main/java/com/parse/ParseInstallation.java 73.39% <100.00%> (+0.24%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1eeb9cf...4fa05d4. Read the comment docs.

@azlekov
Copy link
Contributor Author

azlekov commented Oct 15, 2021

@mtrezza the gradle-semantic-release-plugin manages the version inside gradle.properties. On all modules build, a BuildConfig file will be generated with the respective version from the gradle.properties file. I use BuildConfig.PARSE_VERSION and set it to the current ParseInstallation.

image

Copy link
Member

@mtrezza mtrezza left a comment

Choose a reason for hiding this comment

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

Amazing! I'll do a local dry-run to test it out before commit.

@mtrezza mtrezza changed the title fix: module versioning between releases and set current parse version to ParseInstallation fix: java package version always 1.0.0, current parse version not pushed to server Oct 18, 2021
Copy link
Member

@mtrezza mtrezza left a comment

Choose a reason for hiding this comment

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

Looks good! Tested locally and correctly updated the version in gradle.properties.

@mtrezza mtrezza merged commit 3c6496a into parse-community:master Oct 18, 2021
parseplatformorg pushed a commit that referenced this pull request Oct 18, 2021
## [2.0.3](2.0.2...2.0.3) (2021-10-18)

### Bug Fixes

* java package version always 1.0.0, current parse version not pushed to server ([#1130](#1130)) ([3c6496a](3c6496a))
@parseplatformorg
Copy link

🎉 This pull request has been released in version 2.0.3

@parseplatformorg parseplatformorg added the state:released Released as stable version label Oct 18, 2021
@mtrezza
Copy link
Member

mtrezza commented Oct 18, 2021

It worked perfectly, great job @L3K0V!

6c86cfb

@azlekov azlekov deleted the better-versioning branch November 3, 2021 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state:released Released as stable version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect SDK version numbers parseVersion undefined in Parse's Installation table

3 participants