Comments (6)
Good idea. By time of last commit?
from gradle-android-git-version.
No, rather the current time when I exported the APK.
The reasoning is that I might upload "betas" (dirty/amended commits) to Google Play Developer Console. Thus if only using version or commit count (B) the versionCode would never increment but Google Play Developer Console would still want me to increase the versionCode.
If we used the exported date I would always have a "new" versionCode number.
Tried to add it myself but I didn't understand how to use my local compiled version of your plugin :-)
from gradle-android-git-version.
Well...a couple things give me pause:
- I think it is generally safer to push releases from commits, so you always have a record of what is in the playstore.
- I also think in general that "build time" doesn't tell you as much as "last commit". If I build from the same bits, I should get the same result...no snowflakes!
- The number of digits available in the
versionCode
is not sufficient to store a full date stamp unless you toss most or all of the version number ... in which case this plugin probably isn't going to help a ton.
That said, I'm not trying to dictate your build pipeline -- it's yours to decide!
So: I created an X
code and pushed this into 0.3.1. This just leaves a 0 which you can fill as you wish by amending baseCode
. Sound good?
from gradle-android-git-version.
I agree it's safer to push from commits. But let's say I have SW in the beta tab in Google Play Developer Console. Then creating new commits per upload just to step the versionCode (and you need to step the versionCode each time a APK is uploaded) doesn't feel right because perhaps I just want to amend the previous commit. I.e. if I just keep amending based on the comments from my beta testers the versionCode doesn't get increased.
So I want to have some kind of auto increment to be able to push amended commits to the beta section in GPDC.
Any ideas about this?
from gradle-android-git-version.
YMMV, but in my experience a build that other people see deserves its own commit. In the future looking back to see the changes for each beta iteration could have some value. For example, you could change your mind and revert on a single commit. You can't do that if the commit has lots of changes rolled up into it.
But if amending is your workflow, you can also keep adding tags to the same commit to set the version name/code you want to expose. The plugin will always take the latest one, so if a commit has 1.2.345 and 1.2.346 it will take 1.2.346 for the name and code. This would give you the advantage of asking a beta user which one they were on, and you could at least tell they weren't on the latest!
And with the X digit in baseCode you can also try inserting your own clock-based designator into the baseCode if that's what you want to do.
Good luck!
from gradle-android-git-version.
OK thank you for your input and the change you did for me!
/ Henrik
from gradle-android-git-version.
Related Issues (20)
- Remove deprecated items
- Replace commitHashLength with format extension
- Replace untrackedIsDirty with format extension
- Use --first-parent strategy
- Match git-describe commit hash
- Document git-describe format HOT 1
- Changelog HOT 1
- Describe output is empty? HOT 5
- Clean up testNearestTag test
- Recent update of jgit breaks compatibility with older Gradle versions HOT 1
- .. HOT 1
- [question] Support for incremental versionCode separately from versionName? HOT 6
- Different format per buildType? HOT 2
- Bare Repository has neither a working tree, nor an index via execution of git hooks HOT 12
- Include proper task descriptions
- Add direct access to components
- Nearest tag with optional tagPattern
- Unable to download jgit from jcenter
- It's keep saying untagged even though I already did
- Allow different format for non-tagged version
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gradle-android-git-version.