Skip to content

Commit

Permalink
Correct sourcelink validation errors (#1033)
Browse files Browse the repository at this point in the history
- problem noticed while investigating dotnet/aspnetcore-internal#3030
- make XAML files available where the compiler looks for them
  - enables the compiler to embed these files too
  • Loading branch information
dougbu committed Aug 31, 2019
1 parent 05f93c1 commit 04b15ba
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
5 changes: 4 additions & 1 deletion Directory.Build.props
Expand Up @@ -14,7 +14,7 @@
<Import
Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), AspNetCoreSettings.props))\AspNetCoreSettings.props"
Condition=" '$(CI)' != 'true' AND '$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), AspNetCoreSettings.props))' != '' " />

<PropertyGroup Label="Build Settings">
<LangVersion>8.0</LangVersion>
<StrongNameKeyId>MicrosoftAspNetCore</StrongNameKeyId>
Expand All @@ -24,6 +24,9 @@
<GenerateResxSource>true</GenerateResxSource>
<GenerateResxSourceEmitFormatMethods>true</GenerateResxSourceEmitFormatMethods>
<ExcludeFromSourceBuild Condition="'$(IsUnitTestProject)' == 'true'">true</ExcludeFromSourceBuild>

<!-- Embed source files that are not tracked by the source control manager in the PDB. -->
<EmbedUntrackedSources>true</EmbedUntrackedSources>
</PropertyGroup>

<PropertyGroup Label="Package and Assembly Metadata">
Expand Down
14 changes: 13 additions & 1 deletion src/Razor/src/RazorDeveloperTools/RazorDeveloperTools.csproj
Expand Up @@ -100,10 +100,22 @@
<PackageReference Include="Microsoft.VisualStudio.SDK.Analyzers" Version="$(MicrosoftVisualStudioSDKAnalyzersVersion)" PrivateAssets="all" />
</ItemGroup>

<Target Name="_RemoveAnalyzers" BeforeTargets="CoreCompile">
<Target Name="_RemoveAnalyzers_CopyXaml" BeforeTargets="CoreCompile">
<ItemGroup>
<Analyzer Remove="@(Analyzer)" />
<_SourcesForXamlCopy Include="*\*.xaml" />
</ItemGroup>

<!-- Make XAML files available to the compiler. This allows embedding the files for source link. -->
<Copy
SourceFiles="@(_SourcesForXamlCopy)"
DestinationFiles="@(_SourcesForXamlCopy -> '$(IntermediateOutputPath)%(RelativeDir)%(RelativeDir)%(Filename)%(Extension)')"
SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"
OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
Retries="$(CopyRetryCount)"
RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
UseHardlinksIfPossible="$(CreateHardLinksForCopyFilesToOutputDirectoryIfPossible)"
UseSymboliclinksIfPossible="$(CreateSymbolicLinksForCopyFilesToOutputDirectoryIfPossible)" />
</Target>

<Target Name="WORKAROUND_SETINFORMATIONVERSION" BeforeTargets="AddSourceRevisionToInformationalVersion">
Expand Down

0 comments on commit 04b15ba

Please sign in to comment.