forked from Azure/azure-sdk-for-net
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApiListing.targets
45 lines (35 loc) · 1.79 KB
/
ApiListing.targets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<Project>
<PropertyGroup>
<_RefSourceOutputPath>$([System.IO.Directory]::GetParent('$(MSBuildProjectDirectory)'))/api/</_RefSourceOutputPath>
<GenAPIAdditionalParameters>--exclude-attributes-list "$(MSBuildThisFileDirectory)ApiListing.exclude-attributes.txt" $(GenAPIAdditionalParameters)</GenAPIAdditionalParameters>
<GenAPITargetPath>$(_RefSourceOutputPath)$(AssemblyName).$(TargetFramework).cs</GenAPITargetPath>
</PropertyGroup>
<Target Name="RemoveExistingListings">
<ItemGroup>
<!-- Remove all files that don't start with $(AssemblyName) and the current target -->
<_ListingsToRemove Include="$(_RefSourceOutputPath)*" Exclude="$(_RefSourceOutputPath)$(AssemblyName).*.cs" />
<_ListingsToRemove Include="$(GenAPITargetPath)" />
</ItemGroup>
<Delete Files="@(_ListingsToRemove)" />
<MakeDir Directories="$(_RefSourceOutputPath)"/>
</Target>
<Target Name="_SetExportApiInnerTarget">
<PropertyGroup>
<InnerTargets>ExportApi</InnerTargets>
</PropertyGroup>
</Target>
<Target
Name="ExportApiCrossTarget"
DependsOnTargets="_SetExportApiInnerTarget;DispatchToInnerBuilds"
Condition="'$(IsCrossTargetingBuild)' == 'true'" />
<Target
Name="ExportApiInner"
DependsOnTargets="Build;RemoveExistingListings;GenerateReferenceAssemblySource"
Condition="'$(IsInnerBuild)' == 'true'" />
<Target Name="ExportApi" DependsOnTargets="ExportApiCrossTarget;ExportApiInner" Condition="'$(GenerateAPIListing)' == 'true'" />
<Target Name="_CheckGenerateAPIListingValue" AfterTargets="Build">
<Error
Condition="'$(IsShippingClientLibrary)' == 'true' AND '$(GenerateAPIListing)' != 'true' AND '$(HasReleaseVersion)' != 'false'"
Text="GenerateAPIListing must be set to true for non preview version" />
</Target>
</Project>