Unpack dotnet sdk zipfile and add documentation file to nupkg
[platform/core/dotnet/build-tools.git] / Tizen.GBS.BuildTasks / Tizen.GBS.ImportAfter.targets
1 <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2
3   <PropertyGroup>
4     <UseTizenGBSImportAfterTarget>false</UseTizenGBSImportAfterTarget>
5     <UseTizenGBSImportAfterTarget Condition="'$(TargetFrameworkIdentifier)' == '.NETStandard' or '$(TargetFrameworkIdentifier)' == 'Tizen'">true</UseTizenGBSImportAfterTarget>
6   </PropertyGroup>
7
8   <!-- Set DocumentationFile -->
9   <PropertyGroup Condition="'$(UseTizenGBSImportAfterTarget)' == 'true'">
10     <DocumentationFile Condition="'$(DocumentationFile)' == ''">$(OutputPath)$(AssemblyName).xml</DocumentationFile>
11   </PropertyGroup>
12
13   <!-- Set TargetFramework -->
14   <PropertyGroup Condition="'$(TargetFramework)' == ''">
15     <_ShortTargetFrameworkIdentifier Condition="'$(TargetFrameworkIdentifier)' == '.NETStandard'">netstandard</_ShortTargetFrameworkIdentifier>
16     <_ShortTargetFrameworkIdentifier Condition="'$(TargetFrameworkIdentifier)' == 'Tizen'">tizen</_ShortTargetFrameworkIdentifier>
17     <_TargetFrameworkVersionWithoutV Condition="$(TargetFrameworkVersion.StartsWith('v'))">$(TargetFrameworkVersion.Substring(1))</_TargetFrameworkVersionWithoutV>
18     <TargetFramework Condition="'$(_ShortTargetFrameworkIdentifier)' != ''">$(_ShortTargetFrameworkIdentifier)$(_TargetFrameworkVersionWithoutV)</TargetFramework>
19   </PropertyGroup>
20
21   <!-- NuSpec File -->
22   <PropertyGroup>
23     <NuSpecFile>$(MSBuildProjectDirectory)/$(AssemblyName).nuspec</NuSpecFile>
24   </PropertyGroup>
25
26   <!-- Additional files to append to .nuspec -->
27   <ItemGroup>
28     <NuGetAssemblyFile Include="$(OutputPath)$(TargetFileName)" />
29     <NuGetAssemblyFile Include="$(DocumentationFile)" />
30   </ItemGroup>
31
32   <PropertyGroup Condition="'$(UseTizenGBSImportAfterTarget)' == 'true'">
33     <BuildDependsOn>
34       __AppendNuGetFiles;
35       $(BuildDependsOn);
36       __CleanUpIntemediate;
37     </BuildDependsOn>
38   </PropertyGroup>
39
40   <!-- Cleanup Intermediate files after build -->
41         <Target Name="__CleanUpIntemediate">
42                 <RemoveDir Directories="$(BaseIntermediateOutputPath)" />
43   </Target>
44
45   <!-- Append _NuGetFiles to .nuspec file -->
46   <Target Name="__AppendNuGetFiles" Condition="Exists('$(NuSpecFile)')">
47     <Exec Command="dotnet-build nuspec_addfile &quot;$(NuSpecFile)&quot; &quot;%(NuGetAssemblyFile.Identity)&quot; &quot;lib/$(TargetFramework)&quot;" />
48   </Target>
49
50 </Project>