-
Notifications
You must be signed in to change notification settings - Fork 278
/
Poedit.Targets
120 lines (102 loc) · 4.98 KB
/
Poedit.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"
ToolsVersion="4.0">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<DebugSuffix>d</DebugSuffix>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<DebugSuffix></DebugSuffix>
</PropertyGroup>
<PropertyGroup>
<ResourcesOutDir>$(OutDir)Resources\</ResourcesOutDir>
<TranslationsOutDir>$(OutDir)Translations\</TranslationsOutDir>
<GettextOutDir>$(OutDir)GettextTools\</GettextOutDir>
<GettextNugetDir>$(GettextToolsDir)..\</GettextNugetDir>
<Msgfmt>$(GettextToolsDir)msgfmt.exe -c</Msgfmt>
<PoDirPoedit>locales</PoDirPoedit>
<PoDirWX>deps\wx\locale</PoDirWX>
<PoDirWXMSW>deps\wx\locale\msw</PoDirWXMSW>
</PropertyGroup>
<ItemGroup>
<DataFiles Include="src\resources\*.xrc" />
<DataFiles Include="artwork\*.png" />
<DataFiles Include="artwork\windows\*.png" />
<DataFiles Include="artwork\windows\*.ico" />
</ItemGroup>
<ItemGroup>
<TranslationFiles Include="$(PoDirPoedit)\*.po" />
<TranslationFilesWX Include="$(PoDirWX)\*.po" />
<TranslationFilesWXMSW Include="$(PoDirWXMSW)\*.po" />
</ItemGroup>
<ItemGroup>
<GettextBinFiles Include="$(GettextToolsDir)\msgcat.exe" />
<GettextBinFiles Include="$(GettextToolsDir)\msgfmt.exe" />
<GettextBinFiles Include="$(GettextToolsDir)\msgunfmt.exe" />
<GettextBinFiles Include="$(GettextToolsDir)\msguniq.exe" />
<GettextBinFiles Include="$(GettextToolsDir)\msgmerge.exe" />
<GettextBinFiles Include="$(GettextToolsDir)\xgettext.exe" />
<GettextBinFiles Include="$(GettextToolsDir)\*.dll" />
<GettextDataFiles Include="$(GettextNugetDir)\share\**\*.*" />
</ItemGroup>
<PropertyGroup>
<GitBuildNumberFile>$(IntermediateOutputPath)\git_build_number.h</GitBuildNumberFile>
<GitBuildNumberOldDefine Condition="Exists('$(GitBuildNumberFile)')">$([System.IO.File]::ReadAllText($(GitBuildNumberFile)).Trim())</GitBuildNumberOldDefine>
</PropertyGroup>
<Target Name="GetGitVersion" BeforeTargets="ClCompile">
<GitCommits>
<Output TaskParameter="CommitsCount" PropertyName="GitBuildNumber" />
</GitCommits>
<CreateProperty Value="#define POEDIT_GIT_BUILD_NUMBER $(GitBuildNumber)">
<Output TaskParameter="Value" PropertyName="GitBuildNumberDefine"/>
</CreateProperty>
<Message Importance="High" Text="Updating git build number to $(GitBuildNumber)..."
Condition="$(GitBuildNumberDefine)!=$(GitBuildNumberOldDefine)" />
<WriteLinesToFile File="$(GitBuildNumberFile)" Lines="$(GitBuildNumberDefine)" Overwrite="true"
Condition="$(GitBuildNumberDefine)!=$(GitBuildNumberOldDefine)" />
</Target>
<Target Name="CopyDataFiles" BeforeTargets="ClCompile">
<Message Importance="High" Text="Copying resources to $(ResourcesOutDir)" />
<MakeDir Directories="$(ResourcesOutDir)" />
<Copy
SourceFiles="@(DataFiles)"
DestinationFolder="$(ResourcesOutDir)"
SkipUnchangedFiles="true"
/>
</Target>
<Target Name="CopyTranslations_Poedit" BeforeTargets="ClCompile"
Inputs="@(TranslationFiles)"
Outputs="@(TranslationFiles->'$(TranslationsOutDir)%(Filename)\poedit.mo')">
<MakeDir Directories="@(TranslationFiles->'$(TranslationsOutDir)\%(Filename)')" />
<Exec Command='$(Msgfmt) -o "$(TranslationsOutDir)%(TranslationFiles.Filename)\poedit.mo" @(TranslationFiles)' />
</Target>
<Target Name="CopyTranslations_WX" BeforeTargets="ClCompile"
Inputs="@(TranslationFilesWX)"
Outputs="@(TranslationFilesWX->'$(TranslationsOutDir)%(Filename)\wxstd.mo')">
<MakeDir Directories="@(TranslationFilesWX->'$(TranslationsOutDir)\%(Filename)')" />
<Exec Command='$(Msgfmt) -o "$(TranslationsOutDir)%(TranslationFilesWX.Filename)\wxstd.mo" @(TranslationFilesWX)' />
</Target>
<Target Name="CleanDataFiles" AfterTargets="Clean">
<Message Importance="High" Text="Cleaning resources, translations etc." />
<RemoveDir Directories="$(ResourcesOutDir)" />
<RemoveDir Directories="$(TranslationsOutDir)" />
<RemoveDir Directories="$(GettextOutDir)" />
</Target>
<Target Name="CopyGettextTools" BeforeTargets="ClCompile"
Inputs="@(GettextBinFiles);@(GettextDataFiles)"
Outputs="@(GettextBinFiles->'$(GettextOutDir)\bin\%(Filename)%(Extension)');@(GettextDataFiles->'$(GettextOutDir)\share\%(RecursiveDir)%(Filename)%(Extension)')"
>
<Message Importance="High" Text="Copying gettext tools binaries to $(GettextOutDir)" />
<MakeDir Directories="$(GettextOutDir)\bin" />
<MakeDir Directories="$(GettextOutDir)\share" />
<Copy
SourceFiles="@(GettextBinFiles)"
DestinationFolder="$(GettextOutDir)\bin"
SkipUnchangedFiles="true"
/>
<Copy
SourceFiles="@(GettextDataFiles)"
DestinationFolder="$(GettextOutDir)\share\%(RecursiveDir)"
SkipUnchangedFiles="true"
/>
</Target>
</Project>