forked from vslavik/poedit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Poedit.Targets
143 lines (121 loc) · 5.8 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"
ToolsVersion="4.0">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<DebugSuffix>d</DebugSuffix>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<DebugSuffix></DebugSuffix>
</PropertyGroup>
<PropertyGroup>
<ResourcesOutDir>$(OutDir)Resources\</ResourcesOutDir>
<TranslationsOutDir>$(OutDir)Translations\</TranslationsOutDir>
<GettextOutDir>$(OutDir)GettextTools\</GettextOutDir>
<GettextNugetDir>$(SolutionDir)\packages\Gettext.Tools.0.19.8.1\tools\</GettextNugetDir>
<GettextBinDir>$(GettextNugetDir)bin\</GettextBinDir>
<Msgfmt>$(GettextBinDir)msgfmt.exe -c</Msgfmt>
<PoDirPoedit>locales</PoDirPoedit>
<PoDirWX>deps\wx\locale</PoDirWX>
<PoDirWXMSW>deps\wx\locale\msw</PoDirWXMSW>
</PropertyGroup>
<ItemGroup>
<DLLs Include="deps\icu4c\bin\icudt??.dll" />
<DLLs Include="deps\icu4c\bin\icuuc??$(DebugSuffix).dll" />
<DLLs Include="deps\icu4c\bin\icuin??$(DebugSuffix).dll" />
<DLLs Include="deps\icu4c\source\data\in\icudt*.dat" />
</ItemGroup>
<ItemGroup>
<DataFiles Include="src\resources\*.xrc" />
<DataFiles Include="artwork\*.png" />
<DataFiles Include="artwork\windows\*.png" />
<DataFiles Include="artwork\windows\*.ico" />
<DataFiles Include="artwork\windows\vista\*.ico" />
</ItemGroup>
<ItemGroup>
<TranslationFiles Include="$(PoDirPoedit)\*.po" />
<TranslationFilesWX Include="$(PoDirWX)\*.po" />
<TranslationFilesWXMSW Include="$(PoDirWXMSW)\*.po" />
</ItemGroup>
<ItemGroup>
<GettextBinFiles Include="$(GettextBinDir)\msgcat.exe" />
<GettextBinFiles Include="$(GettextBinDir)\msgfmt.exe" />
<GettextBinFiles Include="$(GettextBinDir)\msgunfmt.exe" />
<GettextBinFiles Include="$(GettextBinDir)\msguniq.exe" />
<GettextBinFiles Include="$(GettextBinDir)\msgmerge.exe" />
<GettextBinFiles Include="$(GettextBinDir)\xgettext.exe" />
<GettextBinFiles Include="$(GettextBinDir)\*.dll" />
<GettextDataFiles Include="$(GettextNugetDir)\share\**\*.*" />
</ItemGroup>
<PropertyGroup>
<GitBuildNumberFile>$(MSBuildProjectDirectory)\$(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="CopyDLLs" AfterTargets="Link">
<Message Importance="High" Text="Copying 3rd party DLLs to $(OutDir)" />
<Copy
SourceFiles="@(DLLs)"
DestinationFolder="$(OutDir)"
SkipUnchangedFiles="true"
/>
</Target>
<Target Name="CopyDataFiles" AfterTargets="Link">
<Message Importance="High" Text="Copying resources to $(ResourcesOutDir)" />
<MakeDir Directories="$(ResourcesOutDir)" />
<Copy
SourceFiles="@(DataFiles)"
DestinationFolder="$(ResourcesOutDir)"
SkipUnchangedFiles="true"
/>
</Target>
<Target Name="CopyTranslations_Poedit" AfterTargets="Link"
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" AfterTargets="Link"
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="CopyTranslations_WXMSW" AfterTargets="Link"
Inputs="@(TranslationFilesWXMSW)"
Outputs="@(TranslationFilesWXMSW->'$(TranslationsOutDir)%(Filename)\wxmsw.mo')">
<MakeDir Directories="@(TranslationFilesWXMSW->'$(TranslationsOutDir)\%(Filename)')" />
<Exec Command='$(Msgfmt) -o "$(TranslationsOutDir)%(TranslationFilesWXMSW.Filename)\wxmsw.mo" @(TranslationFilesWXMSW)' />
</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" AfterTargets="Link">
<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>