forked from NuGet/NuGet.Client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
NuGet.Localization.csproj
63 lines (55 loc) · 2.89 KB
/
NuGet.Localization.csproj
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<Project>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'NuGet.sln'))\build\common.props" />
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
<PropertyGroup>
<TargetFramework>$(NetStandardVersion)</TargetFramework>
<Shipping>true</Shipping>
<PackProject>true</PackProject>
<PackProject Condition="!Exists('$(LocalizationRootDirectory)')">false</PackProject>
<Description>NuGet localization package for dotnet CLI.</Description>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<UsePublicApiAnalyzer>false</UsePublicApiAnalyzer>
<LocalizationOutputDirectory>$(ArtifactsDirectory)LocalizedFiles</LocalizationOutputDirectory>
</PropertyGroup>
<PropertyGroup>
<NuspecFile>NuGet.Localization.nuspec</NuspecFile>
<NuspecProperties>
Version=$(Version);
configuration=$(Configuration);
LocalizationOutputDirectory=$(LocalizationOutputDirectory);
PackageIcon=$(PackageIcon);
PackageIconPath=$([System.IO.Path]::Combine($(RepositoryRootDirectory),$(PackageIcon)))
</NuspecProperties>
</PropertyGroup>
<!--
============================================================
Get localized files from all projects and move them to a common location.
It is conditioned on the existence of the NuGet.Build.Localization repository which will
only be on the CI Machines as an empty repository is checked out locally.
============================================================
-->
<Target Name="MoveLocalizedFilesToLocalizedArtifacts" Condition="Exists($(LocalizationRootDirectory)) " BeforeTargets="GenerateNuspec">
<MakeDir
Directories="$(LocalizationOutputDirectory)"/>
<ItemGroup>
<LocalizationProjects Include="@(SolutionProjectsWithoutVSIX)" Exclude="$(NuGetCoreSrcDirectory)NuGet.Build.Tasks.Pack\NuGet.Build.Tasks.Pack.csproj"/>
</ItemGroup>
<Message Text="Localization Projects: @(LocalizationProjects, '%0a')" Importance="High" />
<MSBuild Projects="@(LocalizationProjects)"
Properties="BuildProjectReferences=false;
Configuration=$(Configuration);
AppendTargetFrameworkToOutputPath=false"
Targets="GetNetCoreLocalizedFilesInProjectOutputPath">
<Output TaskParameter="TargetOutputs"
ItemName="_LocalizedFilesForLocalizationPackage" />
</MSBuild>
<ItemGroup>
<_LocalizedFilePaths Include="@(_LocalizedFilesForLocalizationPackage)">
<TargetPath>$(LocalizationOutputDirectory)\%(_LocalizedFilesForLocalizationPackage.RelativeTargetPath)</TargetPath>
</_LocalizedFilePaths>
</ItemGroup>
<Copy SourceFiles="@(_LocalizedFilePaths->'%(Identity)')" DestinationFiles="@(_LocalizedFilePaths->'%(TargetPath)')" />
</Target>
<Import Project="$(BuildCommonDirectory)common.targets"/>
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
</Project>