mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-12-12 10:54:07 +00:00
b7da546dd5
Run the following string-replacement command in my GNU/Linux system: git grep -l Goldendict | xargs sed -i 's/Goldendict/GoldenDict/g'
44 lines
1.6 KiB
XML
44 lines
1.6 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
|
|
<PropertyGroup>
|
|
<VersionFile>$(ProjectDir)version.txt</VersionFile>
|
|
<NewVersionFile>$(IntDir)version.txt</NewVersionFile>
|
|
</PropertyGroup>
|
|
|
|
<!-- Update the version.txt file, but only if needed, when the version really changes -->
|
|
<Target Name="GenerateGitVersionFile" AfterTargets="InitializeBuildStatus">
|
|
<WriteLinesToFile
|
|
File="$(VersionFile)"
|
|
Lines="1.5+git"
|
|
Overwrite="true"
|
|
Encoding="ASCII"
|
|
Condition="!Exists($(VersionFile))" />
|
|
|
|
<Exec Command="git describe --tags --always --dirty > $(NewVersionFile)"
|
|
IgnoreExitCode="True" />
|
|
|
|
<PropertyGroup>
|
|
<GoldenDictVersion>$([System.IO.File]::ReadAllText($(VersionFile)).Trim())</GoldenDictVersion>
|
|
<NewGoldenDictVersion>$([System.IO.File]::ReadAllText($(NewVersionFile)).Trim())</NewGoldenDictVersion>
|
|
</PropertyGroup>
|
|
|
|
<Message Text="Version change: $(GoldenDictVersion) ~> $(NewGoldenDictVersion)"
|
|
Importance="high"
|
|
Condition="('$(NewGoldenDictVersion)' != '') And
|
|
('$(NewGoldenDictVersion)' != '$(GoldenDictVersion)')" />
|
|
|
|
<Copy
|
|
SourceFiles="$(NewVersionFile)"
|
|
DestinationFiles="$(VersionFile)"
|
|
Condition="('$(NewGoldenDictVersion)' != '') And
|
|
('$(NewGoldenDictVersion)' != '$(GoldenDictVersion)')"
|
|
/>
|
|
</Target>
|
|
|
|
<Target Name="CleanVersionFiles" AfterTargets="Clean">
|
|
<Delete Files="$(VersionFile);$(NewVersionFile)" />
|
|
</Target>
|
|
|
|
</Project>
|