Skip to content

[Proposal] Allow setting projects meant to only be used to not compile code as Non applicable for building. #15408

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

Open
AraHaan opened this issue Jan 20, 2021 · 7 comments

Comments

@AraHaan
Copy link
Member

AraHaan commented Jan 20, 2021

This is to avoid any CSC warnings about there being no code in the project (obviously there would be no code if we do not mean for the csproj to build anything except generating nuspec / providing our own nuspec to the .NET pack targets files in the .NET SDK (so we can use dotnet pack with it).

I am thinking of something similar to <IsPackable>/<IsPackable> for this to be something like:

  • <IsBuildable>true/false</IsBuildable> (default true)
  • <BuildSupported>true/false</BuildSupported> (default true)
  • <Buildable>true/false</Buildable> (default true)
  • etc.
@ghost
Copy link

ghost commented Jan 20, 2021

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@ghost ghost added the untriaged Request triage from a team member label Jan 20, 2021
@AraHaan AraHaan changed the title Allow setting projects meant to only be used to not compile code as Non applicable for building. [Proposal] Allow setting projects meant to only be used to not compile code as Non applicable for building. Jan 20, 2021
@AraHaan
Copy link
Member Author

AraHaan commented Jan 21, 2021

cc @dsplaisted

@AraHaan
Copy link
Member Author

AraHaan commented Jan 21, 2021

It does say that NoBuild can be used to skip building on dotnet pack on the project with nuspec, however what if I am running dotnet build to build other projects in the solution that just so happens to have the project with the nuspec only.

@dsplaisted
Copy link
Member

Is this what you are looking for? https://github.com/microsoft/MSBuildSdks/tree/master/src/NoTargets

@dsplaisted dsplaisted added Area-NetSDK and removed untriaged Request triage from a team member labels Jan 21, 2021
@dsplaisted dsplaisted added this to the Discussion milestone Jan 21, 2021
@AraHaan
Copy link
Member Author

AraHaan commented Jan 21, 2021

Oh that looks to be similar.

@kasperk81
Copy link
Contributor

<IsPublishable> doesn't publish
<IsPackable> doesn't package

there should be a <IsBuildable> property which will skip the build. it should be a property like the other two so we can use Condtion=whatever on it. NoTargets is not it

@osexpert
Copy link

Missing this as well. Currently a problem if having sln with different projects, some eg. net8.0, some net8.0-windows. Can control dotnet publish, but not dotnet build, so had to split out a subset sln with only net8.0 projects.

<IsBuildable> would have allowed me to keep the original sln as-is and only set to true in Directory.Build.props if building for win-* and target framework is *-windows

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

No branches or pull requests

4 participants