-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMarkerMetro.WindowsPhone.AppResLibGenerator.targets
48 lines (42 loc) · 2.25 KB
/
MarkerMetro.WindowsPhone.AppResLibGenerator.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
46
47
48
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<AppResLibGenerator>$(MSBuildThisFileDirectory)\AppResLibGenerator.exe</AppResLibGenerator>
<LocaleCSV>$(MSBuildThisFileDirectory)\LocaleMappings.csv</LocaleCSV>
</PropertyGroup>
<Target Name="CheckPrerequisites">
<!-- Raise an error if we're unable to locate nuget.exe -->
<Error Condition="'$(AppResLibGenerator)' != 'true' AND !Exists('$(AppResLibGenerator)')" Text="Unable to locate '$(AppResLibGenerator)'" />
</Target>
<ItemGroup>
<AppResLibDlls Include="$(MSBuildProjectDirectory)\AppResLib.dll"/>
<AppResLibDlls Include="$(MSBuildProjectDirectory)\AppResLib.dll.*.mui"/>
</ItemGroup>
<Target Name="GenerateAppResLibDlls"
Inputs="@(EmbeddedResource)"
Outputs="@(AppResLibDlls)"
DependsOnTargets="CheckPrerequisites"
BeforeTargets="PrepareForBuild">
<Message Text="Generating AppResLib.dll files..." />
<AppResLibGenerator.Generator
ResXFileName="%(EmbeddedResource.Identity)"
Condition="'%(Extension)'=='.resx'"
LocaleMappingsFileName="$(LocaleCSV)"
WarnOnMappingNotFound="true"
Resource100Key="ApplicationDisplayName"
Resource101Key="ApplicationDescription"
Resource102Key="ApplicationTileTitle">
<Output TaskParameter="AppResLibFileName" ItemName="GeneratedAppResLibFiles"/>
<Output TaskParameter="Locale" ItemName="GeneratedAppResLocales"/>
</AppResLibGenerator.Generator>
<Message Text="Generated: @(GeneratedAppResLibFiles)" Condition="'@(GeneratedAppResLibFiles)'!=''" />
<Message Text="AppResLib.dll and .mui generated for: @(GeneratedAppResLocales)" Importance="High" Condition="'@(GeneratedAppResLocales)'!=''"/>
<Warning Text="No AppResLib.dll generated as no EmbededResource .resx files were found in the project" Condition="'@(GeneratedAppResLocales)'==''"/>
</Target>
<Target Name="CleanAppResLibDlls"
AfterTargets="Clean">
<Message Text="Cleaning: @(AppResLibDlls)" />
<Delete Files="@(AppResLibDlls)"/>
</Target>
<UsingTask AssemblyFile="$(AppResLibGenerator)" TaskName="AppResLibGenerator.Generator" />
</Project>