Trying to fix UpdateLanguageFiles to point to correct files - thx xylographe :)

This commit is contained in:
niksedk 2015-09-18 19:50:47 +02:00
parent 07ecad1367
commit 500e93336e
4 changed files with 9 additions and 15 deletions

View File

@ -439,9 +439,8 @@
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup> <PropertyGroup>
<PreBuildEvent>IF NOT EXIST "$(ProjectDir)Properties\AssemblyInfo.cs" ( <PreBuildEvent>IF NOT EXIST "$(ProjectDir)Properties\AssemblyInfo.cs" (COPY "$(ProjectDir)Properties\AssemblyInfo.cs.template" "$(ProjectDir)Properties\AssemblyInfo.cs")
COPY "$(ProjectDir)Properties\AssemblyInfo.cs.template" "$(ProjectDir)Properties\AssemblyInfo.cs" "$(ProjectDir)..\build_helpers.bat" rev $(ConfigurationName) &amp;&amp; "$(ProjectDir)..\build_helpers.bat" lang $(ConfigurationName)</PreBuildEvent>
)</PreBuildEvent>
</PropertyGroup> </PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.

View File

@ -1601,14 +1601,11 @@
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup> <PropertyGroup>
<PreBuildEvent>"$(ProjectDir)..\build_helpers.bat" rev $(ConfigurationName) &amp;&amp; "$(ProjectDir)..\build_helpers.bat" lang $(ConfigurationName)</PreBuildEvent> <PreBuildEvent>"$(ProjectDir)..\build_helpers.bat" rev $(ConfigurationName)</PreBuildEvent>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<PostBuildEvent>COPY /Y /V "$(ProjectDir)packages\NHunspell.1.2.5554.16953\content\*.dll" "$(TargetDir)" <PostBuildEvent>COPY /Y /V "$(ProjectDir)packages\NHunspell.1.2.5554.16953\content\*.dll" "$(TargetDir)"
IF NOT EXIST "$(ProjectDir)Properties\AssemblyInfo.cs" (COPY "$(ProjectDir)Properties\AssemblyInfo.cs.template" "$(ProjectDir)Properties\AssemblyInfo.cs") IF NOT EXIST "$(ProjectDir)Properties\AssemblyInfo.cs" (COPY "$(ProjectDir)Properties\AssemblyInfo.cs.template" "$(ProjectDir)Properties\AssemblyInfo.cs")</PostBuildEvent>
REM "$(ProjectDir)packages\ILRepack.2.0.1\tools\ILRepack.exe" /out:"$(TargetDir)$(TargetName).exe" "$(TargetDir)$(TargetName).exe" "$(ProjectDir)packages\NHunspell.1.2.5554.16953\lib\net\NHunspell.dll" "$(ProjectDir)packages\zlib.net.1.0.4.0\lib\zlib.net.dll" "$(ProjectDir)DLLs\Interop.QuartzTypeLib.dll" /targetplatform:v4 /internalize /parallel
</PostBuildEvent>
</PropertyGroup> </PropertyGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup> <PropertyGroup>

View File

@ -177,7 +177,6 @@ namespace UpdateAssemblyInfo
UpdateAssemblyInfo(seTemplateFileName, newVersionInfo); UpdateAssemblyInfo(seTemplateFileName, newVersionInfo);
UpdateAssemblyInfo(libSeTmplateFileName, newVersionInfo); UpdateAssemblyInfo(libSeTmplateFileName, newVersionInfo);
return 0; return 0;
} }
Console.WriteLine("no changes"); Console.WriteLine("no changes");

View File

@ -7,7 +7,7 @@ namespace UpdateLanguageFiles
internal class Program internal class Program
{ {
private static string workInProgress = "Updating language files..."; private const string WorkInProgress = "Updating language files...";
private static int Main(string[] args) private static int Main(string[] args)
{ {
@ -25,14 +25,13 @@ namespace UpdateLanguageFiles
return 1; return 1;
} }
Console.Write(workInProgress); Console.Write(WorkInProgress);
try try
{ {
int noOfChanges = 0; int noOfChanges = 0;
var language = new Nikse.SubtitleEdit.Core.Language(); var language = new Nikse.SubtitleEdit.Core.Language { General = { Version = FindVersionNumber() } };
language.General.Version = FindVersionNumber();
var languageAsXml = language.GetCurrentLanguageAsXml(); var languageAsXml = language.GetCurrentLanguageAsXml();
var oldLanguageAsXml = string.Empty; var oldLanguageAsXml = string.Empty;
if (File.Exists(args[0])) if (File.Exists(args[0]))
@ -94,7 +93,7 @@ namespace UpdateLanguageFiles
if (File.Exists(fileName)) if (File.Exists(fileName))
{ {
var text = File.ReadAllText(fileName); var text = File.ReadAllText(fileName);
var pattern = @"\[assembly: AssemblyVersion\(""(\d+\.\d+\.\d+)\.\[REVNO]""\)]"; const string pattern = @"\[assembly: AssemblyVersion\(""(\d+\.\d+\.\d+)\.\[REVNO]""\)]";
var version = System.Text.RegularExpressions.Regex.Match(text, pattern); var version = System.Text.RegularExpressions.Regex.Match(text, pattern);
if (version.Success) if (version.Success)
{ {
@ -108,7 +107,7 @@ namespace UpdateLanguageFiles
} }
Console.WriteLine(); Console.WriteLine();
Console.WriteLine("WARNING: " + warning); Console.WriteLine("WARNING: " + warning);
Console.Write(workInProgress); Console.Write(WorkInProgress);
return "unknown"; return "unknown";
} }