Closed shana closed 5 years ago
You can simplify your root version.json to just the following, since you're just explicitly setting defaults.
{
"$schema": "https://raw.githubusercontent.com/AArnott/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
"version": "1.0",
"publicReleaseRefSpec": [
"^refs/heads/master$",
"^refs/heads/v\\d+(?:.\\d+)?$"
],
- "cloudBuild": {
- "setVersionVariables": false,
- "buildNumber": {
- "enabled": false
- }
- },
- "inherit": false
}
You can remove all your version.json files that are just:
{
"$schema": "https://raw.githubusercontent.com/AArnott/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
"inherit": true
}
These are completely unnecessary.
For your master project and your main point, I'll think about it more and get back to you.
Ah, cool, I'll try that, thanks!
So your root version.json is and always has been in the repo root, right?
Can you share the repo or whip up a repro repo that you can share?
@AArnott Yeah, the version.json in the root was never touched. The repo is https://github.com/spoiledcat/UnityTools, but I've moved some other things around and suddenly it's versioning things correctly, I can't reproduce it anymore. I have no idea what was happening or why it stopped happening :-/
Well, that's good---ish. ;-p
One thing that frequently trips up people is that changes to version.json must be committed for everything to apply properly. Maybe when you were seeing the unexpected behavior, you only had local changes that hadn't been committed yet.
Maybe, could have been that. If it happens again, I'll try to isolate it. Thanks!
Hey hey! First off, love the project, it's solving almost all my versioning issues! I hit a thing that might or might not be a bug (or maybe I'm missing something, dunno)...
I have about 10 projects in a repo, and I'm following the instructions at https://github.com/AArnott/Nerdbank.GitVersioning/blob/master/doc/cloudbuild.md#set-them-from-just-one-project to set the cloud build variables from only one project. I have a version.json in the root like this:
version.json at root:
version.json in all project subdirectories except MasterProject:
version.json in MasterProject:
It all works great except that I moved the projects down one subdirectory. The root version.json file has not been changed. After this move, all theprojects have their versions bumped correctly in a local build (from
1.0.9
to1.0.10
) EXCEPT for the MasterProject, which misteriously got stamped with1.0.0
. If I take out the thecloudBuild
section in the MasterProject, it gets versioned correctly. Looks like it thinks that the version.json file in the MasterProject has changes that affect the version?