-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Replace custom targets for generating assembly attributes and source control info by using SDK features #7504
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
13a4c3c
Replace custom targets for generating assembly attributes and source …
1161694
Extract SourceLink references into a props file only imported by proj…
4089b96
fixup! Extract SourceLink references into a props file only imported …
97a290c
fixup! Replace custom targets for generating assembly attributes and …
a5fc037
fixup! fixup! Replace custom targets for generating assembly attribut…
e59ccb0
fixup! fixup! Extract SourceLink references into a props file only im…
2e57e48
fixup! fixup! fixup! Extract SourceLink references into a props file …
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,15 +15,6 @@ | |
<PackageLicenseUrl>https://raw.githubusercontent.com/aspnet/AspNetCore/2.0.0/LICENSE.txt</PackageLicenseUrl> | ||
<!-- The SPDX name for the source license. See https://spdx.org/licenses/. --> | ||
<PackageLicenseType>Apache-2.0</PackageLicenseType> | ||
<!-- | ||
Suppress a warning about upcoming deprecation of PackageLicenseUrl. When embedding licenses are supported, | ||
replace PackageLicenseUrl with PackageLicenseExpression. | ||
--> | ||
<NoWarn>$(NoWarn);NU5125</NoWarn> | ||
<!-- Suppress warnings about using SemVer 2.0. --> | ||
<NoWarn>$(NoWarn);NU5105</NoWarn> | ||
<!-- Don't make missing XML docs a fatal build error, but still surface so we have visibility into undocumented APIs. --> | ||
<WarningsNotAsErrors>$(WarningsNotAsErrors);CS1591</WarningsNotAsErrors> | ||
|
||
<!-- Contact email address for NuGet packages and Linux installers. --> | ||
<MaintainerEmail>[email protected]</MaintainerEmail> | ||
|
@@ -42,20 +33,46 @@ | |
<SharedFxDescription>Shared Framework for hosting of Microsoft ASP.NET Core applications. It is open source, cross-platform and is supported by Microsoft. We hope you enjoy using it! If you do, please consider joining the active community of developers that are contributing to the project on GitHub ($(RepositoryUrl)). We happily accept issues and PRs.</SharedFxDescription> | ||
</PropertyGroup> | ||
|
||
<!-- Warnings and errors --> | ||
<PropertyGroup> | ||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> | ||
<!-- | ||
Suppress NuGet warning about upcoming deprecation of PackageLicenseUrl. When embedding licenses are supported, | ||
replace PackageLicenseUrl with PackageLicenseExpression. | ||
--> | ||
<NoWarn>$(NoWarn);NU5125</NoWarn> | ||
<!-- Suppress NuGet warnings about using SemVer 2.0. --> | ||
<NoWarn>$(NoWarn);NU5105</NoWarn> | ||
<!-- Don't make missing XML docs a fatal build error, but still surface so we have visibility into undocumented APIs. --> | ||
<WarningsNotAsErrors>$(WarningsNotAsErrors);CS1591</WarningsNotAsErrors> | ||
<!-- xUnit1004 = warns about skipped tests. Make this a non-fatal build warning. --> | ||
<WarningsNotAsErrors>$(WarningsNotAsErrors);xUnit1004</WarningsNotAsErrors> | ||
</PropertyGroup> | ||
|
||
<!-- Source code settings --> | ||
<PropertyGroup> | ||
<RepositoryRoot>$(MSBuildThisFileDirectory)</RepositoryRoot> | ||
<RepositoryUrl>https://github.com/aspnet/AspNetCore</RepositoryUrl> | ||
<RepositoryType>git</RepositoryType> | ||
<SharedSourceRoot>$(MSBuildThisFileDirectory)src\Shared\</SharedSourceRoot> | ||
<GoogleTestSubmoduleRoot>$(RepositoryRoot)src\submodules\googletest\</GoogleTestSubmoduleRoot> | ||
<!-- Embed source files that are not tracked by the source control manager in the PDB. --> | ||
<EmbedUntrackedSources>true</EmbedUntrackedSources> | ||
<!-- Additional assembly attributes are already configured to include the source revision ID. --> | ||
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion> | ||
|
||
<!-- These project types are disabled because the presence of a PackageReference causes issues for NuGet. --> | ||
<DisableSourceLink Condition="'$(MSBuildProjectExtension)' == '.zipproj' OR '$(MSBuildProjectExtension)' == '.debproj' OR '$(MSBuildProjectExtension)' == '.rpmproj'">true</DisableSourceLink> | ||
</PropertyGroup> | ||
|
||
<ItemGroup Condition="'$(DisableSourceLink)' != 'true'"> | ||
<!-- See https://github.com/dotnet/sourcelink --> | ||
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="$(MicrosoftSourceLinkGitHubPackageVersion)" PrivateAssets="All" AllowExplicitReference="true" /> | ||
<PackageReference Include="Microsoft.SourceLink.Vsts.Git" Version="$(MicrosoftSourceLinkVstsGitPackageVersion)" PrivateAssets="All" AllowExplicitReference="true" /> | ||
</ItemGroup> | ||
|
||
<!-- Compilation options which apply to all languages. Language-specific options should be set in eng/targets/$(lang).Common.props --> | ||
<PropertyGroup> | ||
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)eng\AspNetCore.snk</AssemblyOriginatorKeyFile> | ||
<SignAssembly>true</SignAssembly> | ||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<PlatformName Condition=" '$(PlatformName)' == '' ">$(Platform)</PlatformName> | ||
|
@@ -77,16 +94,14 @@ | |
linux-arm64 | ||
</SupportedRuntimeIdentifiers> | ||
|
||
<!-- Instructs the compiler to use SHA256 instead of SHA1 when adding file hashes to PDBs. --> | ||
<ChecksumAlgorithm>SHA256</ChecksumAlgorithm> | ||
<!-- Make error messages clickable in VS Code's console --> | ||
<GenerateFullPaths Condition="'$(VSCODE_PID)' != ''">true</GenerateFullPaths> | ||
|
||
<!-- Suppress the message about using a preview version of .NET Core SDK. We are okay with this and don't need the warning. --> | ||
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage> | ||
|
||
<!-- Fixes a common error in targets implementing a NoBuild mode. --> | ||
<BuildProjectReferences Condition=" '$(NoBuild)' == 'true' ">false</BuildProjectReferences> | ||
|
||
<!-- Enables Strict mode for Roslyn compiler --> | ||
<Features>strict</Features> | ||
</PropertyGroup> | ||
|
||
<Import Project="eng\Versions.props" /> | ||
|
@@ -139,12 +154,17 @@ | |
<IsTestAssetProject Condition="$(RepoRelativeProjectDir.Contains('testassets'))">true</IsTestAssetProject> | ||
<IsSampleProject Condition="$(RepoRelativeProjectDir.Contains('sample'))">true</IsSampleProject> | ||
<IsAnalyzersProject Condition="$(MSBuildProjectName.EndsWith('.Analyzers'))">true</IsAnalyzersProject> | ||
<DisableDeterministicSourceRoot Condition="'$(IsSampleProject)' == 'true' OR '$(IsTestAssetProject)' == 'true'">true</DisableDeterministicSourceRoot> | ||
</PropertyGroup> | ||
|
||
<Import Project="build\tasks\RepoTasks.tasks" Condition="'$(MSBuildProjectName)' != 'RepoTasks' AND '$(DesignTimeBuild)' != 'true'" /> | ||
|
||
<PropertyGroup> | ||
<ContinuousIntegrationBuild Condition="'$(CI)' == 'true'">true</ContinuousIntegrationBuild> | ||
<!-- | ||
Disable deterministic source paths in test assets and samples. | ||
In order for the debugger to find source files when debugging a locally built binary the PDB must contain original, unmapped local paths | ||
--> | ||
<DeterministicSourcePaths Condition="'$(IsSampleProject)' == 'true' OR '$(IsTestAssetProject)' == 'true'">false</DeterministicSourcePaths> | ||
<!-- Projects which reference Microsoft.AspNetCore.Mvc.Testing should import this targets file to ensure dependency .deps.json files are copied into test output. --> | ||
<MvcTestingTargets>$(MSBuildThisFileDirectory)src\Mvc\src\Microsoft.AspNetCore.Mvc.Testing\Microsoft.AspNetCore.Mvc.Testing.targets</MvcTestingTargets> | ||
<!-- IIS native projects can only be built on Windows for x86 and x64. --> | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
<!-- Use this file to workaround issues. List the issue tracking the item to fix so we can remove the workaround when the issue is resolved. --> | ||
<Project> | ||
|
||
<!-- Workaround https://github.com/aspnet/AspNetCore/issues/7503. This chains GenerateSourceLinkFile before razor component targets run. --> | ||
<Target Name="_EnsureSourceLinkHappensBeforeRazorComponentGeneration" | ||
BeforeTargets="PrepareForRazorComponentGenerate" | ||
DependsOnTargets="GenerateSourceLinkFile" /> | ||
|
||
</Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems odd to me that
*.proj
,*.javaproj
,*.npmproj
,*.pkgproj
,*.shfxproj
, and*.vcxproj
aren't included in this condition. Why not?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The project types listed were excluded because adding the PackageReference causes NuGet to fail because they don't import Microsoft.Common.targets. We probably could disable source link on javaproj/npmproj, but I left them on enabled because they weren't causing issues.