parse-community / Parse-SDK-Android

The Android SDK for Parse Platform
https://parseplatform.org/
Other
1.88k stars 735 forks source link

fix: java package version always 1.0.0, current parse version not pushed to server #1130

Closed azlekov closed 2 years ago

azlekov commented 2 years ago

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

parse-github-assistant[bot] commented 2 years ago

Thanks for opening this pull request!

codecov[bot] commented 2 years ago

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%) :arrow_up:

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 commented 2 years ago

@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
parseplatformorg commented 2 years ago

🎉 This pull request has been released in version 2.0.3

mtrezza commented 2 years ago

It worked perfectly, great job @L3K0V!

https://github.com/parse-community/Parse-SDK-Android/commit/6c86cfbc3e3c497dad8256c6bf7c36ae031736e1