zsfVishnu / apk-size-tracker

10 stars 2 forks source link

Change default buildType/flavor to release #13

Open divyanshupundir opened 1 year ago

divyanshupundir commented 1 year ago

Most people who will use this action will need it for release builds to track their app delivery statistics. Debug or staging build sizes may vary vastly on library addition as minification is not generally applied.

zsfVishnu commented 1 year ago

Yup, you're right . I've already created an issue for this : https://github.com/zsfVishnu/apk-size-tracker/issues/3 . The only extra input we would then need for this is the signing keys, which we can either store in the git secrets or as a config file somewhere.

divyanshupundir commented 1 year ago

Interesting, I didn't think about the signing keys. If you can add a method to configure the build.gradle of the app and set the debug build configuration (like minification) to the same as the release build. Then you can quite easily track the apk size without requiring the signing keys.

zsfVishnu commented 1 year ago

@divyanshupundir that's actually a great idea. In fact if i remember correctly, we can pass property values via command line itself using the -P flag. Something like this gradlew assemble -P<property>=<value>.

divyanshupundir commented 1 year ago

@zsfVishnu, on-prem integration sounds like a good idea. And what if you create something like a fastlane integration? In that case the app won't need building twice. The same build will be used in deployment and metric scan.

For the case in which debug build is configured is a similar manner as the release, you can have a buildtype.properties file with properties like:

debug.minify=false
release.minify=true
...

common.shrinkResources=false # For common config to the build types

The users just need to create and use this file. All you need to do now is replace the debug values in the file with the corresponding release values as one of the first steps of the GitHub action.