Produce a default config_windows.h file if one doesn't already exist.

Allow setting the BUILD_CREDIT define through a property page.

Originally committed to SVN as r5224.
This commit is contained in:
Niels Martin Hansen 2011-01-16 23:51:41 +00:00
parent 652a8c7806
commit 7713ea20e0
3 changed files with 80 additions and 20 deletions

View file

@ -63,12 +63,44 @@
/> />
</Target> </Target>
<Target
Name="CreateDefaultConfigurationHeader"
BeforeTargets="PrepareForBuild"
Condition="'@(CreateDefaultConfigurationHeader)' != ''"
>
<PropertyGroup>
<AegisubMustCreateConfigurationHeader Condition="!Exists('%(CreateDefaultConfigurationHeader.TargetFile)')">true</AegisubMustCreateConfigurationHeader>
</PropertyGroup>
<Warning
Condition="'$(AegisubMustCreateConfigurationHeader)'=='true'"
Text="Creating default configuration file. You should edit this file to customise the build."
/>
<Error
Condition="!Exists('%(CreateDefaultConfigurationHeader.TemplateFile)') and '$(AegisubMustCreateConfigurationHeader)'=='true'"
Text="The configuration file template was not found."
/>
<Copy
Condition="'$(AegisubMustCreateConfigurationHeader)'=='true'"
SourceFiles="%(CreateDefaultConfigurationHeader.TemplateFile)"
DestinationFiles="%(CreateDefaultConfigurationHeader.TargetFile)"
/>
<Message
Condition="'$(AegisubMustCreateConfigurationHeader)'=='true'"
Text="Created %(CreateDefaultConfigurationHeader.TargetFile)"
/>
</Target>
<ItemDefinitionGroup Condition="'$(AegisubBuildCredit)'!=''">
<ClCompile>
<PreprocessorDefinitions>BUILD_CREDIT="$(AegisubBuildCredit)";%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup> <ItemGroup>
<PropertyPageSchema Include="$(MSBuildThisFileDirectory)Aegisub.xml" /> <PropertyPageSchema Include="$(MSBuildThisFileDirectory)Aegisub.xml" />
<ProjectTools Include="SubWCRev" /> <ProjectTools Include="SubWCRev;CreateDefaultConfigurationHeader" />
<AvailableItemName Include="SubWCRev">
<Targets>SubWCRev</Targets>
</AvailableItemName>
</ItemGroup> </ItemGroup>
</Project> </Project>

View file

@ -82,10 +82,15 @@
<OutputFile>$(AegisubSourceBase)build\svn-revision.h</OutputFile> <OutputFile>$(AegisubSourceBase)build\svn-revision.h</OutputFile>
<Repository>$(AegisubSourceBase)\.</Repository> <Repository>$(AegisubSourceBase)\.</Repository>
</SubWCRev> </SubWCRev>
<CreateDefaultConfigurationHeader>
<TemplateFile>$(AegisubSourceBase)src\config\config_windows0.h</TemplateFile>
<TargetFile>$(AegisubSourceBase)src\config\config_windows.h</TargetFile>
</CreateDefaultConfigurationHeader>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<!-- Source files --> <!-- Source files -->
<ItemGroup> <ItemGroup>
<SubWCRev Include="$(AegisubSourceBase)build\svn-revision-base.h" /> <SubWCRev Include="$(AegisubSourceBase)build\svn-revision-base.h" />
<CreateDefaultConfigurationHeader Include="$(AegisubSourceBase)src\config\config_windows.h" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="$(SrcDir)aegisublocale.h" /> <ClInclude Include="$(SrcDir)aegisublocale.h" />

View file

@ -32,24 +32,32 @@
$Id$ $Id$
--> -->
<Rule Name="SubWCRev" <Rule Name="SubWCRev"
DisplayName="TortoiseSVN SubWCRev" DisplayName="Aegisub"
Order="110" Order="110"
PageTemplate="tool" PageTemplate="tool"
xmlns="http://schemas.microsoft.com/build/2009/properties"> xmlns="http://schemas.microsoft.com/build/2009/properties">
<Rule.Categories> <Rule.Categories>
<Category Name="General" DisplayName="General" Description="General" /> <Category Name="BuildInfo" DisplayName="Build information" Description="Embed build information" />
</Rule.Categories> </Rule.Categories>
<Rule.DataSource> <StringProperty
<DataSource Persistence="ProjectFile" ItemType="SubWCRev" HasConfigurationCondition="false" /> Name="AegisubBuildCredit"
</Rule.DataSource> Category="BuildInfo"
DisplayName="Build credit"
Description="Name the build should be credited to. Appears in the about box, and in the title bar of development builds."
Default="Anonymous"
>
<StringProperty.DataSource>
<DataSource Persistence="UserFile" ItemType="" HasConfigurationCondition="false" />
</StringProperty.DataSource>
</StringProperty>
<StringProperty <StringProperty
Name="SubWCRevExe" Name="SubWCRevExe"
Subtype="file" Subtype="file"
Category="General" Category="BuildInfo"
DisplayName="SubWCRev.exe" 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." 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="SubWCRev.exe" Default="SubWCRev.exe"
@ -61,25 +69,40 @@
<StringProperty <StringProperty
Name="InputFile" Name="InputFile"
Subtype="file" Subtype="file"
Category="General" Category="BuildInfo"
DisplayName="Input file" DisplayName="Input file"
Description="Template file to insert data to." Description="Template file to insert data to."
/> ReadOnly="true"
>
<StringProperty.DataSource>
<DataSource Persistence="ProjectFile" ItemType="SubWCRev" HasConfigurationCondition="false" />
</StringProperty.DataSource>
</StringProperty>
<StringProperty <StringProperty
Name="OutputFile" Name="OutputFile"
Subtype="file" Subtype="file"
Category="General" Category="BuildInfo"
DisplayName="Output file" DisplayName="Output file"
Description="File to generate from the template file." Description="File to generate from the template file."
/> ReadOnly="true"
>
<StringProperty.DataSource>
<DataSource Persistence="ProjectFile" ItemType="SubWCRev" HasConfigurationCondition="false" />
</StringProperty.DataSource>
</StringProperty>
<StringProperty <StringProperty
Name="Repository" Name="Repository"
Subtype="folder" Subtype="folder"
Category="General" Category="BuildInfo"
DisplayName="Working copy location" DisplayName="Working copy location"
Description="Location of SVN working copy to extract data from." Description="Location of SVN working copy to extract data from."
/> ReadOnly="true"
>
<StringProperty.DataSource>
<DataSource Persistence="ProjectFile" ItemType="SubWCRev" HasConfigurationCondition="false" />
</StringProperty.DataSource>
</StringProperty>
</Rule> </Rule>