Skip to content
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

Support dynamically skipping projects #438

Closed
jeffkl opened this issue Apr 26, 2023 · 3 comments
Closed

Support dynamically skipping projects #438

jeffkl opened this issue Apr 26, 2023 · 3 comments
Assignees
Labels
Feature Request New feature or request

Comments

@jeffkl
Copy link
Contributor

jeffkl commented Apr 26, 2023

At the moment, users have to manually implement the ability to condition out project references in Traversal projects:

<Project Sdk="Microsoft.Build.Traversal">
  <ItemGroup>
    <ProjectReference Include="src\Common\Common.csproj" />
    <ProjectReference Include="src\App\App.csproj" />
    <ProjectReference Include="src\WebApplication\WebApplication.csproj" Condition="'$(DoNotBuildWebApp)' == 'true'" />
  </ItemGroup>
</Project>

It would be very handy for Microsoft.Build.Traversal to have a built-in mechanism for skipping projects. It would also be great if Microsoft.Build.Traversal could extend Visual Studio solution file builds to dynamically skip projects. This would allow a repo owner to skip projects when a user uses dotnet build instead of MSBuild.exe since not all project types are buildable with dotnet build.

@jeffkl jeffkl added the Feature Request New feature or request label Apr 26, 2023
@jeffkl jeffkl self-assigned this Apr 26, 2023
@vikukush
Copy link

vikukush commented May 12, 2023

This new feature breaks the build because GetProjectsToSkip runs before Restore and does not ignore missing imports from packages, causing errors like
error MSB4019: The imported project "C:\msbuild\CompileModule.proj" was not found. Confirm that the expression in the Import declaration "\msbuild\CompileModule.proj" is correct, and that the file exists on disk.
4.0.0 breaks the build, I'm rolling back to 3.1.6

@vikukush
Copy link

@jeffkl could you please create a unit test about this? This seems to be a rather standard scenario that got broken; if it's not automatically tested, then it's an omission.

@jeffkl
Copy link
Contributor Author

jeffkl commented May 15, 2023

@vikukush you can skip updating to the latest version if its broken for you or you can disable the feature by setting the MSBuild property SkipProjects to false for now. I'll work on a fix in about two weeks when I'm back from vacation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants