Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Convert all projects to SDK-style #29831

Merged
merged 27 commits into from
Jul 8, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
91d7e62
Convert all .csproj files in src to SDK-style projects
wtgodbe May 21, 2018
be0421d
Add Directory.build.props/targets
wtgodbe May 21, 2018
f60fa38
Add project.assets.json & edit properties
wtgodbe May 21, 2018
10b7151
Remove project.assets.json file
wtgodbe May 21, 2018
3ecd281
Get netcoreapp build working.
eerhardt Jun 11, 2018
ad505eb
Merge master into SdkProj
eerhardt Jun 11, 2018
be5ceb5
Clean up projects. Get all projects importing clean with no warnings…
eerhardt Jun 12, 2018
204a8db
Rename dir files to Directory.Build
eerhardt Jun 15, 2018
1c91f96
merge master into SdkProj
eerhardt Jun 16, 2018
3b36996
Small fixes to get the build clean.
eerhardt Jun 16, 2018
b09b0b5
Fix AssemblySearchPaths on the Microsoft.NET.Sdk.
eerhardt Jun 16, 2018
67dacd6
Ensure csc command line is the same as before converting to Sdk proje…
eerhardt Jun 19, 2018
0c7364e
Merge master into SdkProj
eerhardt Jun 19, 2018
53d5973
Fix FileVersionInfo build
eerhardt Jun 19, 2018
6d25667
Rephrase Directory.Build comments to better describe why ImportDirect…
eerhardt Jun 20, 2018
e05508a
Change .csproj to new Configurations property
eerhardt Jun 28, 2018
9f65193
Turn off ILLinkTrimAssembly during design-time builds.
eerhardt Jun 29, 2018
ec546de
Merge master into SdkProj
eerhardt Jun 29, 2018
860888c
Fix up Reflection.Context dir.props/targets to Directory.Build.
eerhardt Jun 29, 2018
6ccae92
Revert WebServer change, since it cannot be an SDK style project.
eerhardt Jun 29, 2018
0343b37
Merge master into SdkProj
eerhardt Jul 5, 2018
1a4b8a2
Run UpdateVSConfigurations on the current code.
eerhardt Jul 5, 2018
9b7b8c0
Fix up new projects and usages of dir.props/targets.
eerhardt Jul 5, 2018
e72643b
Merge master into SdkProj
eerhardt Jul 6, 2018
aa89672
Set TargetFramework to workaround project system bug.
eerhardt Jul 6, 2018
b86cade
Merge remote-tracking branch 'upstream/master' into SdkProj
eerhardt Jul 6, 2018
99e21e6
Merge master into SdkProj
eerhardt Jul 7, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Rephrase Directory.Build comments to better describe why ImportDirect…
…oryBuild properties need to be set
  • Loading branch information
eerhardt committed Jun 20, 2018
commit 6d25667aec315fb4705195e53ff8cb59290a986b
5 changes: 4 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<PropertyGroup>
<!-- Don't need Microsoft.Common.props to import Directory.Build.props again -->
<!--
For non-SDK projects that import this file and then import Microsoft.Common.props,
tell Microsoft.Common.props not to import Directory.Build.props again
-->
<ImportDirectoryBuildProps>false</ImportDirectoryBuildProps>
Copy link
Member

Choose a reason for hiding this comment

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

Why is this necessary?

Copy link
Member

Choose a reason for hiding this comment

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

Because of the projects that aren't SDK style projects (like depproj or pkgproj). What they do:

  1. Import Directory.Build.props at the top of the project
  2. Import Microsoft.Common.props from MSBuild (probably from importing BuildTools stuff)
  3. Microsoft.Common.props will try to import Directory.Build.props again, and thus you get a warning.

Copy link
Member

Choose a reason for hiding this comment

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

Should I make the comment better here?

Copy link
Member

Choose a reason for hiding this comment

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

The comment is definitely added confusion to me as I was expecting this to automatically be imported. Is there any way we can just let the SDK import these in those project types as well? Or are they too much work right now to convert to SDK?

Copy link
Member

Choose a reason for hiding this comment

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

The way Directory.Build.props|targets files get automatically imported is by someone importing Microsoft.Common.props|targets. If your project isn't an "SDK-style" project, then somewhere in your project, you need an explicit <Import> statement in order to get the Microsoft.Common.props|targets imported.

So in order to do that, we would either need to:

  1. Make depproj and pkgproj (basically ALL our project files in corefx) be some sort of "SDK-style" projects. And in that "SDK", it would need to import Microsoft.Common.props|targets.
  2. Explicitly Import a different .props|.targets set of files at the top and bottom of the .depproj and .pkgproj files. Then that other set of .props|.targets files would import Microsoft.Common.props|targets at the right place, which would then import the Directory.Build.props|targets correctly.

I haven't tried (1) above, yet. You said @joperezr was working on the pkgproj projects, so I didn't want to do any work there. Also, it feels like we should try to make incremental progress here - get the .csproj's converted first, then worry about .depproj and .pkgproj.

Copy link
Member

Choose a reason for hiding this comment

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

For now I'm fine if you could please update the comment to call out this is about dealing with the non-sdk projects.

Copy link
Member

Choose a reason for hiding this comment

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

Done.

</PropertyGroup>

Expand Down
5 changes: 4 additions & 1 deletion Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
<Project ToolsVersion="14.0" InitialTargets="CheckForBuildTools" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<PropertyGroup>
<!-- Don't need Microsoft.Common.targets to import Directory.Build.targets again -->
<!--
For non-SDK projects that import this file and then import Microsoft.Common.targets,
tell Microsoft.Common.targets not to import Directory.Build.targets again
-->
<ImportDirectoryBuildTargets>false</ImportDirectoryBuildTargets>
</PropertyGroup>

Expand Down