Skip to content

Commit

Permalink
Add analayzer to nuget (#999)
Browse files Browse the repository at this point in the history
* Add analayzer to nuget
* Generalize target file to enable easier analayzer inclusions in future
  • Loading branch information
TomFinley authored Sep 24, 2018
1 parent eb26489 commit fe07907
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions pkg/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

<ItemGroup>
<Content Include="$(PackageAssetsPath)$(PackageIdFolderName)\lib\**\*" Pack="true" PackagePath="lib" />
<Content Include="$(PackageAssetsPath)$(PackageIdFolderName)\analyzers\**\*" Pack="true" PackagePath="analyzers" />
<Content Include="$(PackageAssetsPath)$(PackageIdFolderName)\runtimes\**\*" Pack="true" PackagePath="runtimes" />
</ItemGroup>

Expand Down
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
1 change: 1 addition & 0 deletions src/Microsoft.ML.Analyzer/Microsoft.ML.Analyzer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<PropertyGroup>
<TargetFramework>netstandard1.3</TargetFramework>
<IncludeAnalyzerInPackage>Microsoft.ML</IncludeAnalyzerInPackage>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit fe07907

Please sign in to comment.