Run TSVN's SubWCRev as part of the build.

The detection of the tool location is tricky and doesn't seem to work entirely as it should. It Works For Me as it is now, though the property page setting doesn't show the correct default.

Originally committed to SVN as r5222.
This commit is contained in:
Niels Martin Hansen 2011-01-16 22:42:30 +00:00
parent f2df585797
commit 1e7718d30b
4 changed files with 213 additions and 5 deletions

View File

@ -0,0 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (c) 2011 Niels Martin Hansen
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the Aegisub Group nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Aegisub Project http://www.aegisub.org/
$Id$
-->
<ProjectSchemaDefinitions
xmlns="http://schemas.microsoft.com/build/2009/properties">
<ContentType
Name="SUBWCRevTemplate"
DisplayName="SUBWCRev template"
ItemType="SubWCRev">
</ContentType>
<ItemType Name="SubWCRev" DisplayName="TortoiseSVN SubWCRev" />
</ProjectSchemaDefinitions>

View File

@ -0,0 +1,75 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (c) 2011 Niels Martin Hansen
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the Aegisub Group nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Aegisub Project http://www.aegisub.org/
$Id$
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<TSVNDir Condition="'$(TSVNDir)'==''">$(registry:HKEY_LOCAL_MACHINE\SOFTWARE\TortoiseSVN@Directory)</TSVNDir>
<TSVNDir Condition="'$(TSVNDir)'==''">$(registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\TortoiseSVN@Directory)</TSVNDir>
<SubWCRevExe Condition="'$(SubWCRevExe)'==''">$(registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\SubWCRev.exe)</SubWCRevExe>
<SubWCRevExe Condition="'$(SubWCRevExe)'==''">$(registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\App Paths\SubWCRev.exe)</SubWCRevExe>
<SubWCRevExe Condition="'$(SubWCRevExe)'==''">$(TSVNDir)\bin\SubWCRev.exe</SubWCRevExe>
</PropertyGroup>
<Target
Name="SubWCRev"
BeforeTargets="ClCompile"
DependsOnTargets="PrepareForBuild"
>
<Error
Condition="!Exists('$(SubWCRevExe)')"
Text="The SubWCRev.exe program was not found. If you already have TortoiseSVN installed, override the SubWCRevExe property to the location of the program."
/>
<Error
Condition="!Exists('%(SubWCRev.Repository)')"
Text="The working copy was not found. Location specified: %(SubWCRev.Repository)"
/>
<Error
Condition="!Exists('%(SubWCRev.InputFile)')"
Text="The template file was not found. Location specified: %(SubWCRev.InputFile)"
/>
<Exec
Command="&quot;$(SubWCRevExe)&quot; &quot;%(SubWCRev.Repository)&quot; &quot;%(SubWCRev.InputFile)&quot; &quot;%(SubWCRev.OutputFile)&quot;"
Outputs="%(SubWCRevExe.Output)"
/>
</Target>
<ItemGroup>
<PropertyPageSchema Include="$(MSBuildThisFileDirectory)Aegisub.SubWCRev.ProjectItems.xml" />
<PropertyPageSchema Include="$(MSBuildThisFileDirectory)Aegisub.SubWCRev.xml" />
<ProjectTools Include="SubWCRev" />
<AvailableItemName Include="SubWCRev">
<Targets>SubWCRev</Targets>
</AvailableItemName>
</ItemGroup>
</Project>

View File

@ -0,0 +1,81 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (c) 2011 Niels Martin Hansen
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the Aegisub Group nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Aegisub Project http://www.aegisub.org/
$Id$
-->
<Rule Name="SubWCRev"
DisplayName="TortoiseSVN SubWCRev"
Order="110"
PageTemplate="tool"
xmlns="http://schemas.microsoft.com/build/2009/properties">
<Rule.Categories>
<Category Name="General" DisplayName="General" Description="General" />
</Rule.Categories>
<Rule.DataSource>
<DataSource Persistence="ProjectFile" ItemType="SubWCRev" HasConfigurationCondition="false" />
</Rule.DataSource>
<StringProperty
Name="SubWCRevExe"
Category="General"
DisplayName="SubWCRev.exe"
Description="Location of the SubWCRev.exe file used to process SVN working copies. Changes to this setting are stored in user settings, not in the main project file."
Default="$(SubWCRevExe)"
>
<StringProperty.DataSource>
<DataSource Persistence="UserFile" ItemType="" HasConfigurationCondition="false" />
</StringProperty.DataSource>
</StringProperty>
<StringProperty
Name="InputFile"
Category="General"
DisplayName="Input file"
Description="Template file to insert data to."
/>
<StringProperty
Name="OutputFile"
Category="General"
DisplayName="Output file"
Description="File to generate from the template file."
/>
<StringProperty
Name="Repository"
Category="General"
DisplayName="Working copy location"
Description="Location of SVN working copy to extract data from."
/>
</Rule>

View File

@ -35,16 +35,15 @@
<Import Project="$(MSBuildThisFileDirectory)..\aegisub.props" /> <Import Project="$(MSBuildThisFileDirectory)..\aegisub.props" />
</ImportGroup> </ImportGroup>
<!-- Project specific configuration --> <!-- Project specific configuration -->
<Import Project="$(MSBuildThisFileDirectory)Aegisub.SubWCRev.targets" />
<PropertyGroup> <PropertyGroup>
<TargetName>aegisub$(AegisubPlatformSuffix)</TargetName> <TargetName>aegisub$(AegisubPlatformSuffix)</TargetName>
</PropertyGroup> </PropertyGroup>
<ItemDefinitionGroup> <ItemDefinitionGroup>
<SubWCRev>
</SubWCRev>
<ClCompile> <ClCompile>
<PreprocessorDefinitions>__STDC_FORMAT_MACROS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>__STDC_FORMAT_MACROS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories> <AdditionalIncludeDirectories>
$(SrcDir); $(SrcDir);
$(SrcDir)include\; $(SrcDir)include\;
@ -78,8 +77,16 @@
%(AdditionalDependencies) %(AdditionalDependencies)
</AdditionalDependencies> </AdditionalDependencies>
</Link> </Link>
<SubWCRev>
<InputFile >$(AegisubSourceBase)build\svn-revision-base.h</InputFile>
<OutputFile>$(AegisubSourceBase)build\svn-revision.h</OutputFile>
<Repository>$(AegisubSourceBase)\.</Repository>
</SubWCRev>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<!-- Source file --> <!-- Source files -->
<ItemGroup>
<SubWCRev Include="$(AegisubSourceBase)build\svn-revision-base.h" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="$(SrcDir)aegisublocale.h" /> <ClInclude Include="$(SrcDir)aegisublocale.h" />
<ClInclude Include="$(SrcDir)aegisub_endian.h" /> <ClInclude Include="$(SrcDir)aegisub_endian.h" />