-
-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mono-repo with one-way dependee-only pathFiltering completely ignores version config #1102
Comments
Ok I found what the cause was. <ManagePackageVersionsCentrally>false</ManagePackageVersionsCentrally> But this is quite unexpected to me. Is it supposed to work like that...? I thought this setting was only for dependencies, not for what should happen when I build and pack the project. |
Also the problem comes back if I add a This seems like a bigger problem to me. You are supposed to be able to have |
ManagePackageVersionsCentrally should have nothing to do with this. |
If Dependee is producing 1.0.0 unexpected, maybe try running |
Running Running Am I building it wrong somehow..? |
I have not set EDIT: |
Could this have something to do with me building all projects from one Build.csproj in root? <Project Sdk="Microsoft.Build.Traversal/2.0.24">
<ItemGroup>
<!-- <ProjectReference Include="benchmarks/**/*.csproj" /> -->
<ProjectReference Include="SharedNameHere*/*.csproj" />
<!-- <ProjectReference Include="tests/**/*.csproj" /> -->
</ItemGroup>
</Project> |
That's good.
That suggests it's an msbuild-unique issue, which brings me back to that |
@AArnott Aaah, I'm an idiot - I was trying to make a minimal reproducible repo with this issue, and as I was setting it up it dawned on me... root <ItemGroup>
<GlobalPackageReference Include="Nerdbank.GitVersioning" Version="3.6.143"/>
</ItemGroup> ...well if I'm not inheriting that, then of course it's not going to work! 🙃 |
EDIT: This was my user error - the NBGV nuget wasn't inheriting properly because of my mistake!
Original content below:
Repo and setup
So I have a mono-repo with a few projects in it:
inherit: false
, lets call itIndependent
.Dependee
.inherit: true
, lets sayProjA
andProjB
.So the root level config is a big full config with most settings defined.
It defines version, and specifically so none of the other projects are affected by
Independent
:And inside
Independent/version.json
for the same reason:The
Dependee
-only project is not part of the primary release for this repo, it needs to bump Patch version if any of the other code is changed - but I don't want other projects to be affected by changes in this project.However since I don't want to repeat all the other parts of the root-config, I followed the suggestion from here, which is to both inherit and set a version: #1004
The "regular" projects that are versioned together (
ProjA
andProjB
) should ignoreDependee
and have this config:Now to the issue.
I have everything commited, and sitting in the repo-root...
I build
dotnet build Build.csproj -c Release /p:CI=true
I pack
dotnet pack Build.csproj --no-build -c Release /p:PackageOutputPath=..\.nupkgs /p:CI=true
...and I get these packages:
Independent.2.0.x-beta.nupkg
Dependee.1.0.0.nupkg
<-- ?? Version completely ignored :(ProjA.2.0.x-beta.nupkg
ProjB.2.0.x-beta.nupkg
The text was updated successfully, but these errors were encountered: