Skip to content

Commit

Permalink
Generalize the analayzer inclusion to the target file
Browse files Browse the repository at this point in the history
  • Loading branch information
TomFinley committed Sep 24, 2018
1 parent a39b1f7 commit d8b4f9e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 19 deletions.
12 changes: 9 additions & 3 deletions src/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
<Import Project="..\Directory.Build.targets" />

<Target Name="PreparePackageAssets"
AfterTargets="Build"
Condition="'$(IncludeInPackage)' != ''">
AfterTargets="Build">

<ItemGroup>
<ItemGroup Condition="'$(IncludeInPackage)' != ''">
<PackageAsset Include="$(TargetPath)"
RelativePath="$(IncludeInPackage)\lib\$(TargetFramework)" />
<PackageAsset Include="@(DebugSymbolsProjectOutputGroupOutput)"
Expand All @@ -15,6 +14,13 @@
RelativePath="$(IncludeInPackage)\lib\$(TargetFramework)" />
</ItemGroup>

<ItemGroup Condition="'$(IncludeAnalyzerInPackage)' != ''">
<PackageAsset Include="$(TargetPath)"
RelativePath="$(IncludeAnalyzerInPackage)\analyzers\dotnet\cs" />
<PackageAsset Include="@(DebugSymbolsProjectOutputGroupOutput)"
RelativePath="$(IncludeAnalyzerInPackage)\analyzers\dotnet\cs" />
</ItemGroup>

<Copy SourceFiles="@(PackageAsset)"
DestinationFolder="$(PackageAssetsPath)%(PackageAsset.RelativePath)" />

Expand Down
16 changes: 0 additions & 16 deletions src/Microsoft.ML.Analyzer/Microsoft.ML.Analyzer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,6 @@
<IncludeAnalyzerInPackage>Microsoft.ML</IncludeAnalyzerInPackage>
</PropertyGroup>

<Target Name="PrepareAnalyzerPackageAssets"
AfterTargets="Build">

<ItemGroup>
<PackageAsset Include="$(TargetPath)"
RelativePath="$(IncludeAnalyzerInPackage)\analyzers\dotnet\cs" />
<PackageAsset Include="@(DebugSymbolsProjectOutputGroupOutput)"
RelativePath="$(IncludeAnalyzerInPackage)\analyzers\dotnet\cs" />
</ItemGroup>

<Copy SourceFiles="@(PackageAsset)"
DestinationFolder="$(PackageAssetsPath)%(PackageAsset.RelativePath)" />

</Target>


<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="$(MicrosoftCodeAnalysisCSharpVersion)" />
<PackageReference Include="Microsoft.CSharp" Version="$(MicrosoftCSharpVersion)" />
Expand Down

0 comments on commit d8b4f9e

Please sign in to comment.