diff --git a/build/repo.targets b/build/repo.targets index 1bb8d78971f7..59785014b5b4 100644 --- a/build/repo.targets +++ b/build/repo.targets @@ -60,7 +60,11 @@ $(MSBuildThisFileDirectory)..\eng\ProjectReferences.props + @(_ProjectReferenceProvider->'', '%0A ') diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 000000000000..98fe46e4032c --- /dev/null +++ b/docs/README.md @@ -0,0 +1,5 @@ +Contributor documentation +========================= + +The primary audience for documentation in this folder is contributors to ASP.NET Core. +If you are looking for documentation on to *use* ASP.NET Core, go to . diff --git a/docs/ReferenceResolution.md b/docs/ReferenceResolution.md new file mode 100644 index 000000000000..e0c3dbf6f4d2 --- /dev/null +++ b/docs/ReferenceResolution.md @@ -0,0 +1,34 @@ +`` resolution +======================== + +Most project files in this repo should use `` instead of `` or ``. +This was done to enable ASP.NET Core's unique requirements without requiring most ASP.NET Core contributors +to understand the complex rules for how versions and references should work. The build system will resolve +Reference items to the correct type and version of references based on our servicing and update rules. + +See [ResolveReferences.targets](/eng/targets/ResolveReferences.targets) for the exact implementation of custom +`` resolutions. + +The requirements that led to this system are: + +* Versions of external dependencies should be consistent. +* Servicing updates of ASP.NET Core should minimize the number of assemblies which need to re-build and re-ship. +* Newer versions of packages should not have lower dependency versions than previous releases. +* Minimize the cascading effect of servicing updates where possible by keeping a consistent baseline of dependencies. + +## Recommendations for writing a .csproj + +* Use `` +* Do not use `` +* Only use `` in test projects +* Name the .csproj file to match the assembly name. +* Run `build.cmd /t:GenerateProjectList` when adding new projects +* Use [eng/tools/BaseLineGenerator/](/eng/tools/BaselineGenerator/README.md) if you need to update baselines. + +## Important files + +* [eng/Baseline.xml](/eng/Baseline.xml) - this contains the 'baseline' of the latest servicing release for this branch. It should be modified and used to update the generated file, Baseline.Designer.props. +* [eng/Dependencies.props](/eng/Dependencies.props) - contains a list of all package references that might be used in the repo. +* [eng/PatchConfig.props](/eng/PatchConfig.props) - lists which assemblies or packages are patching in the current build. +* [eng/ProjectReferences.props](/eng/ProjectReferences.props) - lists which assemblies or packages might be available to be referenced as a local project +* [eng/Versions.props](/eng/Versions.props) - contains a list of versions which may be updated by automation. diff --git a/eng/Baseline.xml b/eng/Baseline.xml index 070816457bb8..e27da11e3a61 100644 --- a/eng/Baseline.xml +++ b/eng/Baseline.xml @@ -1,3 +1,9 @@ + diff --git a/eng/Dependencies.props b/eng/Dependencies.props index b7b342f0e715..7b1eba3c54a4 100644 --- a/eng/Dependencies.props +++ b/eng/Dependencies.props @@ -1,14 +1,29 @@ - + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + + + + + + + + - @@ -82,13 +97,4 @@ - - - - - - - - - diff --git a/eng/PatchConfig.props b/eng/PatchConfig.props index 91e93a17fe70..2fd81f182e35 100644 --- a/eng/PatchConfig.props +++ b/eng/PatchConfig.props @@ -1,3 +1,13 @@ + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) diff --git a/eng/ProjectReferences.props b/eng/ProjectReferences.props index ea6ac86aac43..2b71425adf5d 100644 --- a/eng/ProjectReferences.props +++ b/eng/ProjectReferences.props @@ -1,4 +1,8 @@ - + diff --git a/eng/Versions.props b/eng/Versions.props new file mode 100644 index 000000000000..8adc6dcbbd9e --- /dev/null +++ b/eng/Versions.props @@ -0,0 +1,8 @@ + + diff --git a/eng/targets/CSharp.Common.props b/eng/targets/CSharp.Common.props index b3fc97e2d9bd..6769d7508f6a 100644 --- a/eng/targets/CSharp.Common.props +++ b/eng/targets/CSharp.Common.props @@ -11,4 +11,13 @@ + + + + + + + + + diff --git a/eng/targets/ResolveReferences.targets b/eng/targets/ResolveReferences.targets index 7ff54b7d33bd..3c55bf6f8f6c 100644 --- a/eng/targets/ResolveReferences.targets +++ b/eng/targets/ResolveReferences.targets @@ -1,3 +1,21 @@ + @@ -31,16 +49,22 @@ + <_ImplicitPackageReference Include="@(PackageReference->WithMetadataValue('IsImplicitlyDefined', 'true'))" /> + <_ExplicitPackageReference Include="@(PackageReference)" Exclude="@(_ImplicitPackageReference)" /> + <_ExplicitPackageReference Remove="Internal.AspNetCore.Sdk" /> - + <_UnusedProjectReferenceProvider Include="@(ProjectReferenceProvider)" Exclude="@(Reference)" /> - + <_ProjectReferenceByAssemblyName Condition="'$(UseProjectReferences)' == 'true'" Include="@(ProjectReferenceProvider)" - Exclude="@(UnusedProjectReferenceProvider)" /> + Exclude="@(_UnusedProjectReferenceProvider)" /> @@ -51,12 +75,18 @@ + <_ReferenceTemp Remove="@(_ReferenceTemp)" /> + + @@ -117,6 +148,7 @@ Text="Could not resolve this reference. Could not locate the package or project for "%(Reference.Identity)"" /> + <_TargetFramework Remove="@(_TargetFramework)" />