Skip to content

Remove "wc -l" from Jamulus.pro - #3903

Open
pljones wants to merge 2 commits into
jamulussoftware:mainfrom
pljones:bugfix/remove-platform-code-in-jamulus-pro
Open

Remove "wc -l" from Jamulus.pro#3903
pljones wants to merge 2 commits into
jamulussoftware:mainfrom
pljones:bugfix/remove-platform-code-in-jamulus-pro

Conversation

@pljones

@pljones pljones commented Aug 15, 2026

Copy link
Copy Markdown
Collaborator

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

  • I've verified that this Pull Request follows the general code principles
  • I tested my code and it does what I want
  • My code follows the style guide
  • I waited some time after this Pull Request was opened and all GitHub checks completed without errors.
  • I've filled all the content above

@pljones
pljones requested review from ann0see and softins and a lite review from Copilot August 15, 2026 15:12

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 -l with a QMake-based commit-count computation using $$system(..., lines) plus $$list()/$$size().
  • Set ANDROID_VERSION_CODE = 0 by default and only compute a commit-count-based version code for non-dev versions when a .git/config is present.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread Jamulus.pro Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@mcfnord

mcfnord commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

🤖 AI: Two checks on this, run with Qt 5.15.13 qmake on Linux:

  • git rev-list --count HEAD and git log --oneline | wc -l agree — both 6419 on current main.
  • In a git worktree checkout, .git is a file rather than a directory, so exists(".git/config") is false and a non-dev build from a worktree silently gets ANDROID_VERSION_CODE = 0. exists(".git") behaves as intended in both layouts, since qmake's exists() matches files as well as directories.

A shadow build with the build directory outside the repository is unaffected either way: qmake resolves both exists() and $$system() against the source directory.

@pljones

pljones commented Aug 15, 2026

Copy link
Copy Markdown
Collaborator Author

a non-dev build from a worktree

Mmm. Does that include the Github autobuild workflow? I think that does git clone. The aim is that zero should appear anywhere that isn't a Github autobuild workflow for a release build, so the check wants to be as strict as possible, rather than in any way permissive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants