diff --git a/data/templates/project/CSharp/SharpDevelopCustomTool.xpt b/data/templates/project/CSharp/SharpDevelopCustomTool.xpt index 161f70020f..b42b8e9bd6 100644 --- a/data/templates/project/CSharp/SharpDevelopCustomTool.xpt +++ b/data/templates/project/CSharp/SharpDevelopCustomTool.xpt @@ -125,8 +125,8 @@ namespace ${StandardNamespace} // This makes the generation code much more concise. // EasyCodeDom classes derive from the System.CodeDom types or have an implicit conversion operator, so // use can use EasyCodeDom objects whereever CodeDom is expected. - EasyCompileUnit ccu = new EasyCompileUnit(); - EasyTypeDeclaration generatedClass = ccu.AddNamespace(targetNamespace).AddType(className); + CodeCompileUnit ccu = new CodeCompileUnit(); + CodeTypeDeclaration generatedClass = ccu.AddNamespace(targetNamespace).AddType(className); EasyMethod m = generatedClass.AddMethod("Create"); m.ReturnType = Easy.TypeRef(doc.DocumentElement.Name); m.Attributes = MemberAttributes.Static | MemberAttributes.Public; diff --git a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/MemberLookupHelper.cs b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/MemberLookupHelper.cs index 7df5a3b6e3..1928dbb058 100644 --- a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/MemberLookupHelper.cs +++ b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/MemberLookupHelper.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; namespace ICSharpCode.SharpDevelop.Dom @@ -873,7 +874,7 @@ namespace ICSharpCode.SharpDevelop.Dom [System.Diagnostics.ConditionalAttribute("DEBUG")] internal static void Log(string text) { - Console.WriteLine(text); + Debug.WriteLine(text); } [System.Diagnostics.ConditionalAttribute("DEBUG")] diff --git a/src/Tools/UpdateAssemblyInfo/Main.cs b/src/Tools/UpdateAssemblyInfo/Main.cs index 39eb7ec05a..7c1e4b1f79 100644 --- a/src/Tools/UpdateAssemblyInfo/Main.cs +++ b/src/Tools/UpdateAssemblyInfo/Main.cs @@ -54,9 +54,8 @@ namespace UpdateAssemblyInfo Console.WriteLine("Working directory must be SharpDevelop\\src!"); return 2; } - File.Copy(Path.Combine(subversionLibraryDir, "SharpSvn.dll"), - Path.Combine(exeDir, "SharpSvn.dll"), - true); + FileCopy(Path.Combine(subversionLibraryDir, "SharpSvn.dll"), + Path.Combine(exeDir, "SharpSvn.dll")); RetrieveRevisionNumber(); string versionNumber = GetMajorVersion() + "." + revisionNumber; UpdateStartup(); @@ -69,6 +68,16 @@ namespace UpdateAssemblyInfo } } + static void FileCopy(string source, string target) + { + if (File.Exists(target)) { + // don't copy file if it is up-to-date: repeatedly copying a 3 MB file slows down the build + if (File.GetLastWriteTimeUtc(source) == File.GetLastWriteTimeUtc(target)) + return; + } + File.Copy(source, target, true); + } + static void UpdateStartup() { string content; @@ -189,10 +198,12 @@ namespace UpdateAssemblyInfo // Change working dir so that the subversion libraries can be found Environment.CurrentDirectory = Path.Combine(Environment.CurrentDirectory, subversionLibraryDir); - SvnWorkingCopyClient client = new SvnWorkingCopyClient(); - SvnWorkingCopyVersion version; - if (client.GetVersion(oldWorkingDir, out version)) { - revisionNumber = version.Start.ToString(CultureInfo.InvariantCulture); + using (SvnClient client = new SvnClient()) { + client.Info( + oldWorkingDir, + (sender, info) => { + revisionNumber = info.Revision.ToString(CultureInfo.InvariantCulture); + }); } } catch (Exception e) { Console.WriteLine("Reading revision number with SharpSvn failed: " + e.ToString()); diff --git a/src/Tools/UpdateAssemblyInfo/bin/Debug/UpdateAssemblyInfo.exe b/src/Tools/UpdateAssemblyInfo/bin/Debug/UpdateAssemblyInfo.exe index 47f0a4681e..f5c77169f8 100755 Binary files a/src/Tools/UpdateAssemblyInfo/bin/Debug/UpdateAssemblyInfo.exe and b/src/Tools/UpdateAssemblyInfo/bin/Debug/UpdateAssemblyInfo.exe differ diff --git a/src/Tools/UpdateSetupInfo/Main.cs b/src/Tools/UpdateSetupInfo/Main.cs index 72e4417013..33ed23f861 100644 --- a/src/Tools/UpdateSetupInfo/Main.cs +++ b/src/Tools/UpdateSetupInfo/Main.cs @@ -78,13 +78,23 @@ namespace UpdateSetupInfo previousRevisionFolder = Path.Combine(setupProjectFolder, @"bin"); previousRevisionFileName = Path.Combine(previousRevisionFolder, "REVISION"); - File.Copy(Path.Combine(Path.Combine(applicationFolder, subversionLibraryDir), "SharpSvn.dll"), - Path.Combine(applicationFolder, "SharpSvn.dll"), true); + FileCopy(Path.Combine(Path.Combine(applicationFolder, subversionLibraryDir), "SharpSvn.dll"), + Path.Combine(applicationFolder, "SharpSvn.dll")); // Set current directory to a folder that is in the repository. Environment.CurrentDirectory = setupProjectFolder; } + static void FileCopy(string source, string target) + { + if (File.Exists(target)) { + // don't copy file if it is up-to-date: repeatedly copying a 3 MB file slows down the build + if (File.GetLastWriteTimeUtc(source) == File.GetLastWriteTimeUtc(target)) + return; + } + File.Copy(source, target, true); + } + public static int Main(string[] args) { try { @@ -164,10 +174,12 @@ namespace UpdateSetupInfo // Set working directory so msvcp70.dll and msvcr70.dll can be found Environment.CurrentDirectory = Path.Combine(applicationFolder, subversionLibraryDir); - SvnWorkingCopyClient client = new SvnWorkingCopyClient(); - SvnWorkingCopyVersion version; - if (client.GetVersion(oldWorkingDir, out version)) { - revisionNumber = version.Start.ToString(CultureInfo.InvariantCulture); + using (SvnClient client = new SvnClient()) { + client.Info( + oldWorkingDir, + (sender, info) => { + revisionNumber = info.Revision.ToString(CultureInfo.InvariantCulture); + }); } } catch (Exception e) { Console.WriteLine("Reading revision number with Svn.Net failed: " + e.ToString());