Remove "wc -l" from Jamulus.pro - #3903
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the QMake project (Jamulus.pro) to make Android ANDROID_VERSION_CODE generation more portable (avoiding wc -l, which is not reliably available on Windows) and to force ANDROID_VERSION_CODE to 0 for *dev* builds.
Changes:
- Replace
git log ... | wc -lwith a QMake-based commit-count computation using$$system(..., lines)plus$$list()/$$size(). - Set
ANDROID_VERSION_CODE = 0by default and only compute a commit-count-based version code for non-devversions when a.git/configis present.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
🤖 AI: Two checks on this, run with Qt 5.15.13 qmake on Linux:
A shadow build with the build directory outside the repository is unaffected either way: qmake resolves both |
Mmm. Does that include the Github autobuild workflow? I think that does |
Then probably just say nothing next time. |
ann0see
left a comment
There was a problem hiding this comment.
Looks ok.
--
I think that it just needs to be an increasing number. As we don't publish it in the play store anyway (yet) how we calculate it does not matter.
Yep - this was part of what I was doing after 3.11.0 to get 3.12.0 ready for Play Store (but I was using Windows Qt Creator at the time, hence the build failing on the |
f691cd0 to
e677a74
Compare
|
Closing - will merge this into a larger rewrite. |
Short description of changes
Currently, to get a build number for android builds, Jamulus.pro runs
wc -l-- this is unlikely to work on Windows and isn't necessary to achieve the result intended. This patch amends Jamulus.pro to use built-ins to do the calculation.It also amends the build number so it is aways zero on dev builds. This is so that only tagged builds have the number of commits counted. (We're unlikely to have more commits on a release branch than on main.)
CHANGELOG: SKIP
Context: Fixes an issue?
Makes Jamulus.pro more portable.
Does this change need documentation? What needs to be documented and how?
No.
Status of this Pull Request
Tested locally, including on branch and tagged builds.
What is missing until this pull request can be merged?
Should be good, subject to review.
Checklist