diff --git a/doc/ChangeLog.template.html b/doc/ChangeLog.template.html new file mode 100644 index 00000000000..1f4fab202e4 --- /dev/null +++ b/doc/ChangeLog.template.html @@ -0,0 +1,1018 @@ + + + SharpDevelop ChangeLog + + +

+ SharpDevelop $INSERTVERSION$ ($INSERTDATE$) +

+

+ + + +

+ SharpDevelop 3.2 [3.2.0.5777] (05/08/2010) +

+

+ +

+ SharpDevelop 3.2 RC2 [3.2.0.5698] (4/14/2010) +

+

+ +

+ SharpDevelop 3.2 RC 1 [3.2.0.5505] (2/14/2010) +

+

+ +

+ SharpDevelop 3.2 CTP [3.2.0.5396] (1/13/2010) +

+

+ +

+ SharpDevelop 3.1.1 [3.1.1.5327] (12/12/2009) + +

+

+ +

+ SharpDevelop 3.1 [3.1.0.4977] (09/21/2009) +

+

+ +

+ SharpDevelop 3.1 RC 2 [3.1.0.4890] (09/06/2009) +

+

+ +

+ SharpDevelop 3.1 RC 1 [3.1.0.4545] (07/26/2009) +

+

+ +

+ SharpDevelop 3.1 Beta 1 [3.1.0.4077] (05/14/2009) +

+

+ + +

+ SharpDevelop 3.0 Final [3.0.0.3800] (02/10/2009) +

+

+ + +

+ SharpDevelop 3.0 Release Candidate [3.0.0.3775] (01/22/2009) +

+

+ + +

+ SharpDevelop 3.0 Beta 3 [3.0.0.3683] (12/15/2008) +

+

+ + +

+ SharpDevelop 3.0 Beta 2 [3.0.0.3437] (8/22/2008) +

+

+ +

+ SharpDevelop 3.0 Beta 1 [3.0.0.2970] (2/19/2008) +

+

+ +

+ SharpDevelop 2.2.1.2648 (8/8/2007) +

+

+ +

+ SharpDevelop 2.2.1.2639 (8/8/2007) +

+

+ +

+ SharpDevelop 2.2.0.2595 (6/28/2007) +

+

+ +

+ SharpDevelop 2.1.0.2429 (3/7/2007 - Final) +

+

+ +

+ SharpDevelop 2.1.0.2376 (2/9/2007 - RC1) +

+

+ +

+ SharpDevelop 2.1.0.2201 (12/23/2006 - Beta 3) +

+

+ +

+ + SharpDevelop 2.1.0.2006 (11/2/2006 - Beta 2) +

+

+ +

+ SharpDevelop 2.1.0.1825 (9/19/2006 - Beta 1) +

+

+ +

+ SharpDevelop 2.0.1.1710 (8/24/2006) +

+

+ +

+ SharpDevelop 2.0.0.1591 (7/17/2006 - RTW) +

+

+ +

+ SharpDevelop 2.0.0.1462 (6/5/2006 - RC2) +

+

+ +

+ SharpDevelop 2.0.0.1413 (5/17/2006) +

+

+ + +

+ SharpDevelop 2.0.0.1291 (4/12/2006) +

+

+ +

+ #develop 1.1.0.2124 (2/14/2006) +

+

+ +

+ SharpDevelop 2.0.0.1135 (2/12/2006) +

+

+ +

+ #develop 1.1.0.2118 (12/12/2005) +

+

+ +

+ #develop 1.1.0.2081 (9/25/2005) +

+

+ +

+ #develop 1.1.0.2019 (8/7/2005) +

+

+ +

+ #develop 1.1.0.1964 (5/19/2005) +

+

+ +

+ #develop 1.1.0.1913 (4/28/2005) +

+

+ +

+ #develop 1.0.3.1761 (12/21/2004) +

+

+ +

+ #develop 1.0.2.1709a (11/30/2004) +

+

+ +

+ #develop 1.0.2.1709 (11/10/2004) +

+

+ +

+ #develop 1.0.1.1649 (10/07/2004) +

+ +

+ +

+ #develop 1.0.0.1550 (9/12/2004) +

+

+ +

+ #develop 1.0.0.1543 (9/11/2004) +

+

+ +

+ #develop Fidalgo RC3 (8/23/2004) +

+

+ +

+ #develop Fidalgo RC2 (6/27/2004) +

+

+ +

+ #develop Fidalgo RC1 (6/16/2004) +

+ +

+ + +

+ #develop Fidalgo Beta 1 (5/5/2004) +

+

+ +

+ 0.99b Beta (3/3/2004) +

+

+ +

+ 0.99 Beta (2/20/2004) + +

+

+ +

+ 0.98 Beta (10/23/2003) +

+

+ +

+ 0.97 Beta (09/12/2003) +

+

+ +

+ 0.96 Beta (08/23/2003) +

+

+ +

+ 0.95 Beta (04/30/2003) +

+

+ +

+ 0.94b Beta (02/03/2003) +

+

+ +

+ 0.94 Beta (01/30/2003) +

+

+ +

+ 0.93 Beta (12/19/2002) +

+

+ +

+ 0.92 Beta (10/25/2002) +

+

+ +

+ 0.91 Beta (9/22/2002) +

+

+ +

+ 0.90 Beta (9/5/2002) +

+

+ +

+ 0.89 Beta (8/18/2002) +

+

+ +

+ 0.88b Beta (5/29/2002) +

+

+ +

+ 0.88a Beta (4/24/2002) +

+

+ +

+ 0.87c Beta (2/20/2002) +

+

+ +

+ 0.87b Beta (2/3/2002) +

+ +

+ +

+ 0.87a Beta (1/22/2002) +

+

+ +

+ 0.85 Milestone (12/14/2001) +

+

+ +

+ 0.80 Milestone (9/28/2001) +

+

+ +

+ 0.75 Beta, Interim Beta (8/3/2001) +

+

+ +

+ 0.70 Beta, .NET SDK Beta 2 Release (6/20/2001) +

+

+ +

+ 0.60beta Milestone 1 (2/7/2001) +

+

+ +

+ 0.52beta (12/15/2000) +

+

+ +

+ 0.51beta + +

+

+ +

+ 0.5beta +

+

+ +

+ 0.41beta - some bugfixes : + +

+ +

+ 0.4beta +

+

+ +

+ 0.3beta +

+

+ +

+ 0.2alpha +

+

+ +

+ 09/11/2000 - Project Start +

+ + \ No newline at end of file diff --git a/src/AddIns/Misc/StartPage/Project/Src/StartPageControl.xaml b/src/AddIns/Misc/StartPage/Project/Src/StartPageControl.xaml index d8d60444761..f827b613273 100644 --- a/src/AddIns/Misc/StartPage/Project/Src/StartPageControl.xaml +++ b/src/AddIns/Misc/StartPage/Project/Src/StartPageControl.xaml @@ -74,9 +74,7 @@ Grid.Row="2" Padding="4,0,4,0" TextWrapping="WrapWithOverflow"> - Copyright © - IC#SharpCode + Copyright © diff --git a/src/AddIns/Misc/StartPage/Project/Src/StartPageControl.xaml.cs b/src/AddIns/Misc/StartPage/Project/Src/StartPageControl.xaml.cs index d6c26954968..6fac805891c 100644 --- a/src/AddIns/Misc/StartPage/Project/Src/StartPageControl.xaml.cs +++ b/src/AddIns/Misc/StartPage/Project/Src/StartPageControl.xaml.cs @@ -11,6 +11,7 @@ using System.Windows.Controls; using ICSharpCode.Core; +using ICSharpCode.SharpDevelop.Gui; namespace ICSharpCode.StartPage { @@ -27,8 +28,8 @@ public StartPageControl() List entries = items.ConvertAll(control => new BoxEntry { Control = control } ); startPageItems.ItemsSource = entries; - var aca = (AssemblyCopyrightAttribute)typeof(StartPageControl).Assembly.GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false)[0]; - copyrightYearRange.Text = aca.Copyright.Substring(0, 9); + var aca = (AssemblyCopyrightAttribute)typeof(CommonAboutDialog).Assembly.GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false)[0]; + copyrightText.Text = aca.Copyright; } sealed class BoxEntry diff --git a/src/Automated.proj b/src/Automated.proj index a245663ff10..a7c18388078 100644 --- a/src/Automated.proj +++ b/src/Automated.proj @@ -11,7 +11,7 @@ $(ProjectDir)\src $(ProjectDir)\bin $(MSBuildProjectDirectory)\Tools\MSBuildCommunityTasks - SharpDevelop_4.0.0. + SharpDevelop_ $(MSBuildProjectDirectory)\Tools\NUnit $(SharpDevelopBin)\Tools\x86NUnit $(SharpDevelopSrc)\AddIns\Misc\Profiler @@ -57,13 +57,11 @@ Targets="PrepareRelease" Properties="Configuration=Release"/> - - - - - - - + + + + - - diff --git a/src/Main/Base/Project/Resources/CommonAboutDialog.xfrm b/src/Main/Base/Project/Resources/CommonAboutDialog.xfrm index 24e163c1e1b..c23922536ae 100644 --- a/src/Main/Base/Project/Resources/CommonAboutDialog.xfrm +++ b/src/Main/Base/Project/Resources/CommonAboutDialog.xfrm @@ -26,7 +26,7 @@ - + diff --git a/src/Main/Base/Project/Src/Gui/Dialogs/CommonAboutDialog.cs b/src/Main/Base/Project/Src/Gui/Dialogs/CommonAboutDialog.cs index b382e2fb38b..7595db9518e 100644 --- a/src/Main/Base/Project/Src/Gui/Dialogs/CommonAboutDialog.cs +++ b/src/Main/Base/Project/Src/Gui/Dialogs/CommonAboutDialog.cs @@ -7,8 +7,9 @@ using System; using System.Drawing; +using System.Reflection; +using System.Text.RegularExpressions; using System.Windows.Forms; - using ICSharpCode.Core.WinForms; using ICSharpCode.SharpDevelop.Gui.XmlForms; @@ -132,6 +133,8 @@ public class CommonAboutDialog : XmlForm public CommonAboutDialog() { SetupFromXmlStream(this.GetType().Assembly.GetManifestResourceStream("Resources.CommonAboutDialog.xfrm")); + var aca = (AssemblyCopyrightAttribute)typeof(CommonAboutDialog).Assembly.GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false)[0]; + ControlDictionary["copyrightLabel"].Text = "Copyright " + aca.Copyright; } protected override void SetupXmlLoader() diff --git a/src/Main/Core/Project/ICSharpCode.Core.csproj b/src/Main/Core/Project/ICSharpCode.Core.csproj index a5e7a419629..6d32033051e 100644 --- a/src/Main/Core/Project/ICSharpCode.Core.csproj +++ b/src/Main/Core/Project/ICSharpCode.Core.csproj @@ -140,4 +140,8 @@ ..\src\Tools\UpdateAssemblyInfo\bin\Debug\UpdateAssemblyInfo.exe + + + + \ No newline at end of file diff --git a/src/Main/GlobalAssemblyInfo.template b/src/Main/GlobalAssemblyInfo.template index 5ddb81e4f99..791a1c132aa 100644 --- a/src/Main/GlobalAssemblyInfo.template +++ b/src/Main/GlobalAssemblyInfo.template @@ -20,7 +20,7 @@ using System.Reflection; [assembly: System.Runtime.InteropServices.ComVisible(false)] [assembly: AssemblyCompany("ic#code")] [assembly: AssemblyProduct("SharpDevelop")] -[assembly: AssemblyCopyright("2000-2010 AlphaSierraPapa")] +[assembly: AssemblyCopyright("2000-$INSERTYEAR$ AlphaSierraPapa for the SharpDevelop Team")] [assembly: AssemblyVersion(RevisionClass.FullVersion)] [assembly: NeutralResourcesLanguage("en-US")] @@ -29,7 +29,7 @@ internal static class RevisionClass public const string Major = "4"; public const string Minor = "0"; public const string Build = "0"; - public const string Revision = "-INSERTREVISION-"; + public const string Revision = "$INSERTREVISION$"; public const string MainVersion = Major + "." + Minor; public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision; diff --git a/src/Setup/Files.wxs b/src/Setup/Files.wxs index 8eac25972d3..bb9fe81f412 100644 --- a/src/Setup/Files.wxs +++ b/src/Setup/Files.wxs @@ -442,6 +442,7 @@ + diff --git a/src/Setup/SharpDevelop.Setup.wixproj.user b/src/Setup/SharpDevelop.Setup.wixproj.user deleted file mode 100644 index cef0184e869..00000000000 --- a/src/Setup/SharpDevelop.Setup.wixproj.user +++ /dev/null @@ -1,6 +0,0 @@ - - - 1 - PRODUCTBUILDVERSION=$(SetupProductBuildVersion) - - \ No newline at end of file diff --git a/src/Setup/SharpDevelop.Setup.wixproj.user.template b/src/Setup/SharpDevelop.Setup.wixproj.user.template index 16d4aba0823..a5901a87e90 100644 --- a/src/Setup/SharpDevelop.Setup.wixproj.user.template +++ b/src/Setup/SharpDevelop.Setup.wixproj.user.template @@ -1,6 +1,6 @@ - $INSERTPRODUCTBUILDVERSION$ + $INSERTREVISION$ PRODUCTBUILDVERSION=$(SetupProductBuildVersion) \ No newline at end of file diff --git a/src/Setup/buildSetup.bat b/src/Setup/buildSetup.bat index 12bccf14610..93a566be4d8 100755 --- a/src/Setup/buildSetup.bat +++ b/src/Setup/buildSetup.bat @@ -1,4 +1,4 @@ del "bin\SharpDevelop.msi" -"..\Tools\UpdateSetupInfo\bin\UpdateSetupInfo.exe" +"..\Tools\UpdateAssemblyInfo\bin\Debug\UpdateAssemblyInfo.exe" %windir%\microsoft.net\framework\v4.0.30319\msbuild SharpDevelop.Setup.sln "/p:SharpDevelopBinPath=%CD%\..\..\bin" @IF %ERRORLEVEL% NEQ 0 PAUSE \ No newline at end of file diff --git a/src/Tools/SVNChangeLogToXml/Main.cs b/src/Tools/SVNChangeLogToXml/Main.cs deleted file mode 100644 index 2850a2a693c..00000000000 --- a/src/Tools/SVNChangeLogToXml/Main.cs +++ /dev/null @@ -1,118 +0,0 @@ -using System; -using System.ComponentModel; -using System.Globalization; -using System.IO; -using System.Reflection; -using System.Text; -using System.Text.RegularExpressions; -using System.Windows.Forms; -using System.Xml; -using System.Xml.Xsl; - -using SharpSvn; - -class MainClass -{ - public static int Main(string[] args) - { - Console.WriteLine("Initializing changelog application..."); - try { - if (!File.Exists("SharpDevelop.sln")) { - if (File.Exists(@"..\..\..\..\..\SharpDevelop.sln")) { - Directory.SetCurrentDirectory(@"..\..\..\..\.."); - } - } - if (!File.Exists("SharpDevelop.sln")) { - Console.WriteLine("Working directory must be 'SharpDevelop'"); - return 2; - } - - int start = 2; - for(int i = 0; i < args.Length; i++) - { - if(args[i] == "--REVISION") - { - CreateRevisionFile(); - } - else if(args[i] == "--START") { - Int32.TryParse(args[i + 1], out start); - } - } - ConvertChangeLog(start); - return 0; - } catch (Exception ex) { - Console.WriteLine(ex); - return 1; - } - } - - static void CreateRevisionFile() - { - Console.Write("Writing revision to file: "); - - long rev = 0; - string filename = Path.GetFullPath("."); - SvnWorkingCopyClient client = new SvnWorkingCopyClient(); - SvnWorkingCopyVersion version; - if (client.GetVersion(filename, out version)) { - rev = version.Start; - } - Console.WriteLine(rev); - using (StreamWriter writer = new StreamWriter("REVISION")) { - writer.Write(rev.ToString()); - } - } - - static void ConvertChangeLog(int startRevision) - { - Console.WriteLine("Reading SVN changelog, this might take a while..."); - - SvnClient client = new SvnClient(); - - StringWriter writer = new StringWriter(); - XmlTextWriter xmlWriter = new XmlTextWriter(writer); - xmlWriter.Formatting = Formatting.Indented; - xmlWriter.WriteStartDocument(); - xmlWriter.WriteStartElement("log"); - int progressCount = 0; - client.Log( - Environment.CurrentDirectory, - new SvnLogArgs { - // retrieve log in reverse order - Start = SvnRevision.Base, - End = new SvnRevision(startRevision) - }, - delegate(object sender, SvnLogEventArgs e) { - if (++progressCount == 10) { - Console.Write("."); - progressCount = 0; - } - xmlWriter.WriteStartElement("logentry"); - xmlWriter.WriteAttributeString("revision", e.Revision.ToString(CultureInfo.InvariantCulture)); - xmlWriter.WriteElementString("author", e.Author); - xmlWriter.WriteElementString("date", e.Time.ToUniversalTime().ToString("MM/dd/yyyy", System.Globalization.CultureInfo.InvariantCulture)); - xmlWriter.WriteElementString("msg", e.LogMessage); - xmlWriter.WriteEndElement(); - } - ); - xmlWriter.WriteEndDocument(); - - Console.WriteLine(); - - XmlTextReader input = new XmlTextReader(new StringReader(writer.ToString())); - - XslCompiledTransform xsl = new XslCompiledTransform(); - xsl.Load(Path.Combine(Path.GetDirectoryName(typeof(MainClass).Assembly.Location), "SVNChangelogToXml.xsl")); - - StreamWriter tw = new StreamWriter(@"doc\ChangeLog.xml", false, Encoding.UTF8); - xmlWriter = new XmlTextWriter(tw); - xmlWriter.Formatting = Formatting.Indented; - xsl.Transform(input, xmlWriter); - xmlWriter.Close(); - tw.Close(); - - client.Dispose(); - - Console.WriteLine("Finished"); - } -} diff --git a/src/Tools/SVNChangeLogToXml/SVNChangelogToXml.csproj b/src/Tools/SVNChangeLogToXml/SVNChangelogToXml.csproj deleted file mode 100644 index cbd378e2c51..00000000000 --- a/src/Tools/SVNChangeLogToXml/SVNChangelogToXml.csproj +++ /dev/null @@ -1,61 +0,0 @@ - - - Debug - AnyCPU - 8.0.40607 - 2.0 - {c6159c5e-f6ef-4a63-b152-0e49159b6059} - SVNChangelogToXml - SVNChangelogToXml - Exe - False - False - OnSuccessfulBuild - False - Auto - 4194304 - x86 - 4096 - 4 - 1607 - --REVISION --START 100 - C:\Users\Daniel\AppData\Roaming\ICSharpCode/SharpDevelop3.0\Settings.SourceAnalysis - v2.0 - - - true - True - bin\Debug\ - False - False - false - Full - - - False - True - False - False - bin\Release\ - true - - - - ..\..\Libraries\SharpSvn\SharpSvn.dll - - - - - - - - - - - - - Always - - - - \ No newline at end of file diff --git a/src/Tools/SVNChangeLogToXml/SVNChangelogToXml.csproj.user b/src/Tools/SVNChangeLogToXml/SVNChangelogToXml.csproj.user deleted file mode 100644 index 7ff3943f7c3..00000000000 --- a/src/Tools/SVNChangeLogToXml/SVNChangelogToXml.csproj.user +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/Tools/SVNChangeLogToXml/SVNChangelogToXml.sln b/src/Tools/SVNChangeLogToXml/SVNChangelogToXml.sln deleted file mode 100644 index 11ff38b8716..00000000000 --- a/src/Tools/SVNChangeLogToXml/SVNChangelogToXml.sln +++ /dev/null @@ -1,18 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -# SharpDevelop 4.0.0.4979 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SVNChangelogToXml", "SVNChangelogToXml.csproj", "{c6159c5e-f6ef-4a63-b152-0e49159b6059}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {C6159C5E-F6EF-4A63-B152-0E49159B6059}.Debug|Any CPU.Build.0 = Debug|AnyCPU - {C6159C5E-F6EF-4A63-B152-0E49159B6059}.Debug|Any CPU.ActiveCfg = Debug|AnyCPU - {C6159C5E-F6EF-4A63-B152-0E49159B6059}.Release|Any CPU.Build.0 = Release|AnyCPU - {C6159C5E-F6EF-4A63-B152-0E49159B6059}.Release|Any CPU.ActiveCfg = Release|AnyCPU - EndGlobalSection -EndGlobal diff --git a/src/Tools/SVNChangeLogToXml/SVNChangelogToXml.xsl b/src/Tools/SVNChangeLogToXml/SVNChangelogToXml.xsl deleted file mode 100644 index 8a5a20b4b78..00000000000 --- a/src/Tools/SVNChangeLogToXml/SVNChangelogToXml.xsl +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - - - - - - Mike Krüger - - - Roman Taranchenko - - - Georg Brandl - - - Andrea Paatz - - - Daniel Grunwald - - - Denis Erchoff - - - Markus Palme - - - Ivo Kovacka - - - John Reilly - - - Christoph Wille - - - Alexandre Semenov - - - Nikola Kavaldjiev - - - Matt Ward - - - Mathias Simmack - - - David Srbecký - - - David Alpert - - - Peter Forstmeier - - - Scott Ferrett - - - Dickon Field - - - Itai Bar-Haim - - - Christian Hornung - - - Justin Dearing - - - Russell Wilkins - - - Robert Pickering - - - Siegfried Pammer - - - Ivan Shumilin - - - Philipp Maihart - - - Martin Koníček - - - Tomasz Tretkowski - - - Sergej Andrejev - - - - - - - - - - - - - - - - - diff --git a/src/Tools/Tools.build b/src/Tools/Tools.build index a1cbea64abe..4fdcad2c9a2 100644 --- a/src/Tools/Tools.build +++ b/src/Tools/Tools.build @@ -52,16 +52,9 @@ - - - - - - - - - + + diff --git a/src/Tools/UpdateAssemblyInfo/Main.cs b/src/Tools/UpdateAssemblyInfo/Main.cs index fc03c936d32..d2fadcd9044 100644 --- a/src/Tools/UpdateAssemblyInfo/Main.cs +++ b/src/Tools/UpdateAssemblyInfo/Main.cs @@ -9,25 +9,50 @@ using System.Diagnostics; using System.Globalization; using System.IO; +using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Text; using System.Text.RegularExpressions; - -using SharpSvn; using System.Threading; +using System.Xml.Linq; namespace UpdateAssemblyInfo { // Updates the version numbers in the assembly information. class MainClass { - const string templateFile = "src/Main/GlobalAssemblyInfo.template"; - const string globalAssemblyInfo = "src/Main/GlobalAssemblyInfo.cs"; - const string configTemplateFile = "src/Main/StartUp/Project/app.template.config"; - const string configFile = "src/Main/StartUp/Project/SharpDevelop.exe.config"; - const string configFile2 = "src/Main/ICSharpCode.SharpDevelop.Sda/ICSharpCode.SharpDevelop.Sda.dll.config"; - const string subversionLibraryDir = "src/Libraries/SharpSvn"; + const string BaseCommit = "f118057b0f20994c272aba765b54db10d5c1c793"; + const int BaseCommitRev = 6366; + + const string globalAssemblyInfoTemplateFile = "src/Main/GlobalAssemblyInfo.template"; + static readonly TemplateFile[] templateFiles = { + new TemplateFile { + Input = globalAssemblyInfoTemplateFile, + Output = "src/Main/GlobalAssemblyInfo.cs" + }, + new TemplateFile { + Input = "src/Main/StartUp/Project/app.template.config", + Output = "src/Main/StartUp/Project/SharpDevelop.exe.config" + }, + new TemplateFile { + Input = "src/Main/StartUp/Project/app.template.config", + Output = "src/Main/ICSharpCode.SharpDevelop.Sda/ICSharpCode.SharpDevelop.Sda.dll.config" + }, + new TemplateFile { + Input = "src/Setup/SharpDevelop.Setup.wixproj.user.template", + Output = "src/Setup/SharpDevelop.Setup.wixproj.user" + }, + new TemplateFile { + Input = "doc/ChangeLog.template.html", + Output = "doc/ChangeLog.html" + }, + }; + + class TemplateFile + { + public string Input, Output; + } public static int Main(string[] args) { @@ -54,18 +79,16 @@ public static int Main(string[] args) Console.WriteLine("Working directory must be SharpDevelop!"); return 2; } - FileCopy(Path.Combine(subversionLibraryDir, "SharpSvn.dll"), - Path.Combine(exeDir, "SharpSvn.dll")); RetrieveRevisionNumber(); - string versionNumber = GetMajorVersion() + "." + revisionNumber; - UpdateStartup(); - UpdateRedirectionConfig(versionNumber); - foreach (string arg in args) { - if (arg == "--REVISION") { - using (StreamWriter writer = new StreamWriter("REVISION")) { - writer.Write(revisionNumber); - } - } + UpdateFiles(); + if (args.Contains("--REVISION")) { + var doc = new XDocument(new XElement( + "versionInfo", + new XElement("version", fullVersionNumber), + new XElement("revision", revisionNumber), + new XElement("commitHash", gitCommitHash) + )); + doc.Save("REVISION"); } return 0; } @@ -75,58 +98,30 @@ public static int Main(string[] args) } } - 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() + static void UpdateFiles() { - string content; - using (StreamReader r = new StreamReader(templateFile)) { - content = r.ReadToEnd(); - } - content = content.Replace("-INSERTREVISION-", revisionNumber); - if (File.Exists(globalAssemblyInfo)) { - using (StreamReader r = new StreamReader(globalAssemblyInfo)) { - if (r.ReadToEnd() == content) { - // nothing changed, do not overwrite file to prevent recompilation - // every time. - return; - } + foreach (var file in templateFiles) { + string content; + using (StreamReader r = new StreamReader(file.Input)) { + content = r.ReadToEnd(); } - } - using (StreamWriter w = new StreamWriter(globalAssemblyInfo, false, Encoding.UTF8)) { - w.Write(content); - } - } - - static void UpdateRedirectionConfig(string fullVersionNumber) - { - string content; - using (StreamReader r = new StreamReader(configTemplateFile)) { - content = r.ReadToEnd(); - } - content = content.Replace("$INSERTVERSION$", fullVersionNumber); - if (File.Exists(configFile) && File.Exists(configFile2)) { - using (StreamReader r = new StreamReader(configFile)) { - if (r.ReadToEnd() == content) { - // nothing changed, do not overwrite file to prevent recompilation - // every time. - return; + content = content.Replace("$INSERTVERSION$", fullVersionNumber); + content = content.Replace("$INSERTREVISION$", revisionNumber); + content = content.Replace("$INSERTCOMMITHASH$", gitCommitHash); + content = content.Replace("$INSERTDATE$", DateTime.Now.ToString("MM/dd/yyyy", CultureInfo.InvariantCulture)); + content = content.Replace("$INSERTYEAR$", DateTime.Now.Year.ToString()); + if (File.Exists(file.Output)) { + using (StreamReader r = new StreamReader(file.Output)) { + if (r.ReadToEnd() == content) { + // nothing changed, do not overwrite file to prevent recompilation + // every time. + continue; + } } } - } - using (StreamWriter w = new StreamWriter(configFile, false, Encoding.UTF8)) { - w.Write(content); - } - using (StreamWriter w = new StreamWriter(configFile2, false, Encoding.UTF8)) { - w.Write(content); + using (StreamWriter w = new StreamWriter(file.Output, false, Encoding.UTF8)) { + w.Write(content); + } } } @@ -134,7 +129,7 @@ static string GetMajorVersion() { string version = "?"; // Get main version from startup - using (StreamReader r = new StreamReader(templateFile)) { + using (StreamReader r = new StreamReader(globalAssemblyInfoTemplateFile)) { string line; while ((line = r.ReadLine()) != null) { string search = "string Major = \""; @@ -175,60 +170,61 @@ static void SetVersionInfo(string fileName, Regex regex, string replacement) } #region Retrieve Revision Number - static string revisionNumber = "0"; - static string ReadRevisionFromFile() + static string revisionNumber; + static string fullVersionNumber; + static string gitCommitHash; + + static void RetrieveRevisionNumber() { - try { - using (StreamReader reader = new StreamReader(@"REVISION")) { - return reader.ReadLine(); + if (revisionNumber == null) { + if (Directory.Exists("..\\.git")) { + ReadRevisionNumberFromGit(); } - } catch (Exception e) { - Console.WriteLine(e.Message); - Console.WriteLine(); - Console.WriteLine("The revision number of the SharpDevelop version being compiled could not be retrieved."); - Console.WriteLine(); - Console.WriteLine("Build continues with revision number '0'..."); - return "0"; } + + if (revisionNumber == null) { + ReadRevisionFromFile(); + } + fullVersionNumber = GetMajorVersion() + "." + revisionNumber; } - static void RetrieveRevisionNumber() + + static void ReadRevisionNumberFromGit() { - if (Directory.Exists(".svn")) { - string oldWorkingDir = Environment.CurrentDirectory; - try { - // Change working dir so that the subversion libraries can be found - Environment.CurrentDirectory = Path.Combine(Environment.CurrentDirectory, subversionLibraryDir); - - 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()); - } finally { - Environment.CurrentDirectory = oldWorkingDir; - } - } - if (revisionNumber == null || revisionNumber.Length == 0 || revisionNumber == "0") { - if (Directory.Exists("..\\.git")) { - ProcessStartInfo info = new ProcessStartInfo("cmd", "/c git log HEAD~20..HEAD --no-color"); - info.RedirectStandardOutput = true; - info.UseShellExecute = false; - using (Process p = Process.Start(info)) { - string output = p.StandardOutput.ReadToEnd(); - var m = Regex.Match(output, @"git-svn-id:.*@(\d+) [0-9a-f]{8}-"); - if (m.Success) { - revisionNumber = m.Groups[1].Value; - } + ProcessStartInfo info = new ProcessStartInfo("cmd", "/c git rev-list --first-parent " + BaseCommit + "..HEAD"); + info.RedirectStandardOutput = true; + info.UseShellExecute = false; + using (Process p = Process.Start(info)) { + string line; + int revNum = BaseCommitRev; + while ((line = p.StandardOutput.ReadLine()) != null) { + if (gitCommitHash == null) { + // first entry is HEAD + gitCommitHash = line; } + revNum++; } + revisionNumber = revNum.ToString(); + p.WaitForExit(); + if (p.ExitCode != 0) + throw new Exception("git-rev-list exit code was " + p.ExitCode); } - - if (revisionNumber == null || revisionNumber.Length == 0 || revisionNumber == "0") { - revisionNumber = ReadRevisionFromFile(); + } + + static void ReadRevisionFromFile() + { + try { + XDocument doc = XDocument.Load("REVISION"); + revisionNumber = (string)doc.Root.Element("revision"); + gitCommitHash = (string)doc.Root.Element("commitHash"); + } catch (Exception e) { + Console.WriteLine(e.Message); + Console.WriteLine(); + Console.WriteLine("The revision number of the SharpDevelop version being compiled could not be retrieved."); + Console.WriteLine(); + Console.WriteLine("Build continues with revision number '0'..."); + + revisionNumber = "0"; + gitCommitHash = null; } if (revisionNumber == null || revisionNumber.Length == 0) { revisionNumber = "0"; diff --git a/src/Tools/UpdateAssemblyInfo/Readme.txt b/src/Tools/UpdateAssemblyInfo/Readme.txt index 96b74528492..a089969917a 100644 --- a/src/Tools/UpdateAssemblyInfo/Readme.txt +++ b/src/Tools/UpdateAssemblyInfo/Readme.txt @@ -1 +1,35 @@ -Read doc/technotes/Versioning.html +Assembly versioning: Please read doc/technotes/Versioning.html + + +Updates the SharpDevelop Setup information +------------------------------------------ + +Product Revision (Subversion revision number) + +With WiX 3 the package code and product code guids do not need to be generated by +this tool and can be autogenerated by WiX. + +The build server and the buildSetup.bat executes the UpdateSetupInfo tool before +building SharpDevelop.Setup.sln. The SharpDevelop.Setup project does not use the tool. + +Operation +--------- + +1) The SharpDevelop.Setup.wixproj.user is is generated each time the tool is run +based on the SharpDevelop.Setup.wixproj.user.template file. The product revision is inserted +into the newly generated file. + +2) The build server and buildSetup.bat will run the UpdateSetupInfo tool. +This is not done by the SharpDevelop.Setup project itself intentionally so +nothing changes when building the project from inside SharpDevelop. The +modified SharpDevelop.Setup.wixproj.user need not be checked into the +repository on each build on the build server. + +Creating Releases +----------------- + +When creating a release either the setup msi from the build server should be +used or that generated after running buildSetup.bat. This will revision number +if the current revision has changed. + + diff --git a/src/Tools/UpdateAssemblyInfo/UpdateAssemblyInfo.csproj b/src/Tools/UpdateAssemblyInfo/UpdateAssemblyInfo.csproj index 63121d2731e..37a89f20cd4 100644 --- a/src/Tools/UpdateAssemblyInfo/UpdateAssemblyInfo.csproj +++ b/src/Tools/UpdateAssemblyInfo/UpdateAssemblyInfo.csproj @@ -1,4 +1,5 @@ - + + Exe UpdateAssemblyInfo @@ -9,7 +10,6 @@ False False False - PdbOnly False Auto 4194304 @@ -17,10 +17,10 @@ 4096 4 false - false 1607 - v2.0 + v3.5 C:\Users\Daniel\AppData\Roaming\ICSharpCode/SharpDevelop3.0\Settings.SourceAnalysis + --REVISION bin\Debug\ @@ -32,14 +32,28 @@ true TRACE + + Full + true + Project + + + None + false + - - ..\..\Libraries\SharpSvn\SharpSvn.dll - False - + + 3.5 + + + 3.5 + + + 3.5 + diff --git a/src/Tools/UpdateAssemblyInfo/bin/Debug/UpdateAssemblyInfo.exe b/src/Tools/UpdateAssemblyInfo/bin/Debug/UpdateAssemblyInfo.exe deleted file mode 100755 index cc8dbb8bc0b..00000000000 Binary files a/src/Tools/UpdateAssemblyInfo/bin/Debug/UpdateAssemblyInfo.exe and /dev/null differ diff --git a/src/Tools/UpdateSetupInfo/Main.cs b/src/Tools/UpdateSetupInfo/Main.cs deleted file mode 100644 index 33ed23f861c..00000000000 --- a/src/Tools/UpdateSetupInfo/Main.cs +++ /dev/null @@ -1,232 +0,0 @@ -// -// -// -// -// $Revision$ -// - -using System; -using System.Globalization; -using System.IO; -using System.Text; - -using SharpSvn; - -namespace UpdateSetupInfo -{ - /// - /// Creates the SharpDevelop.Setup.wixproj.user file based on the - /// SharpDevelop.Setup.wixproj.user.template. - /// - class UpdateApplication - { - /// - /// Path to the setup project relative to the UpdateSetupInfo.exe file. - /// - const string SetupProjectFolderRelativePath = @"..\..\..\Setup"; - - /// - /// Name of the setup template file. - /// - const string SetupTemplateFileName = "SharpDevelop.Setup.wixproj.user.template"; - - /// - /// Name of the setup project user file that will be generated. - /// - const string SetupProjectUserFileName = "SharpDevelop.Setup.wixproj.user"; - - const int SetupTemplateFileNotFoundReturnCode = 1; - const int UpdateSetupInfoExceptionReturnCode = 2; - - /// - /// The full filename including path to the setup template file. - /// - string setupTemplateFullFileName; - - /// - /// The full filename including path to the setup project user file that - /// will be generated. - /// - string setupProjectUserFullFileName; - - /// - /// The folder containing the UpdateSetupInfo application. - /// - string applicationFolder; - - /// - /// The file that contains the last revision number used to update the - /// template. - /// - string previousRevisionFileName; - - /// - /// The folder that contains the last revision number used to update the - /// template. - /// - string previousRevisionFolder; - - public UpdateApplication() - { - // Work out filenames. - applicationFolder = Path.GetDirectoryName(GetType().Assembly.Location); - string setupProjectFolder = Path.Combine(applicationFolder, SetupProjectFolderRelativePath); - setupProjectFolder = Path.GetFullPath(setupProjectFolder); - - setupTemplateFullFileName = Path.Combine(setupProjectFolder, SetupTemplateFileName); - setupProjectUserFullFileName = Path.Combine(setupProjectFolder, SetupProjectUserFileName); - previousRevisionFolder = Path.Combine(setupProjectFolder, @"bin"); - previousRevisionFileName = Path.Combine(previousRevisionFolder, "REVISION"); - - 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 { - UpdateApplication app = new UpdateApplication(); - return app.Run(); - } catch (Exception ex) { - Console.WriteLine(ex.ToString()); - return UpdateApplication.UpdateSetupInfoExceptionReturnCode; - } - } - - public int Run() - { - // Read setup template contents. - if (!SetupTemplateFileExists) { - Console.WriteLine(String.Concat(SetupTemplateFileName, " not found. Unable to update setup information.")); - return SetupTemplateFileNotFoundReturnCode; - } - string template = ReadSetupTemplate(); - - // Get current revision. - string currentRevision = GetCurrentRevision(); - - // Populate setup template. - template = PopulateSetupTemplate(template, currentRevision); - - // Create setup user file. - SaveSetupUserFile(template); - - return 0; - } - - bool SetupUserFileExists { - get { return File.Exists(setupProjectUserFullFileName); } - } - - bool SetupTemplateFileExists { - get { return File.Exists(setupTemplateFullFileName); } - } - - string ReadSetupTemplate() { - using (StreamReader reader = new StreamReader(setupTemplateFullFileName, true)) { - return reader.ReadToEnd(); - } - } - - string PopulateSetupTemplate(string template, string revision) - { - return template.Replace("$INSERTPRODUCTBUILDVERSION$", revision); - } - - string GetNewGuid() - { - return Guid.NewGuid().ToString().ToUpperInvariant(); - } - - void SaveSetupUserFile(string contents) - { - using (StreamWriter writer = new StreamWriter(setupProjectUserFullFileName, false, Encoding.UTF8)) { - writer.Write(contents); - } - } - - const string subversionLibraryDir = @"..\..\..\Libraries\SharpSvn"; - - /// - /// Code taken directly from UpdateAssemblyInfo and the paths slightly modified. - /// - /// - /// The product build version maps to the Subversion revision number. - /// - string GetCurrentRevision() - { - string revisionNumber = null; - string oldWorkingDir = Environment.CurrentDirectory; - try { - // Set working directory so msvcp70.dll and msvcr70.dll can be found - Environment.CurrentDirectory = Path.Combine(applicationFolder, subversionLibraryDir); - - 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()); - } finally { - Environment.CurrentDirectory = oldWorkingDir; - } - if (revisionNumber == null || revisionNumber.Length == 0 || revisionNumber == "0") { - revisionNumber = ReadCurrentRevisionFromFile(); - } - if (revisionNumber == null || revisionNumber.Length == 0 || revisionNumber == "0") { - throw new ApplicationException("Error reading revision number"); - } - return revisionNumber; - } - - string ReadCurrentRevisionFromFile() - { - using (StreamReader reader = new StreamReader(Path.Combine(applicationFolder, @"..\..\..\..\REVISION"))) { - return reader.ReadLine(); - } - } - - /// - /// Checks that the current revision matches the revision last used to - /// update the SharpDevelop.Setup.wixproj.user file. - /// - bool RevisionExists(string currentRevision) - { - // Read previous revision. - string previousRevision = ReadPreviousRevision(); - if (previousRevision != null) { - return previousRevision == currentRevision; - } - return false; - } - - /// - /// Reads the previous revision number from the Setup\bin\REVISION file. - /// - string ReadPreviousRevision() - { - if (File.Exists(previousRevisionFileName)) { - using (StreamReader reader = new StreamReader(previousRevisionFileName, true)) { - return reader.ReadLine(); - } - } - return null; - } - } -} diff --git a/src/Tools/UpdateSetupInfo/Readme.txt b/src/Tools/UpdateSetupInfo/Readme.txt deleted file mode 100644 index 7dcd735ddb1..00000000000 --- a/src/Tools/UpdateSetupInfo/Readme.txt +++ /dev/null @@ -1,36 +0,0 @@ - -Updates the SharpDevelop Setup information ------------------------------------------- - -Product Revision (Subversion revision number) - -With WiX 3 the package code and product code guids do not need to be generated by -this tool and can be autogenerated by WiX. - -The build server and the buildSetup.bat executes the UpdateSetupInfo tool before -building SharpDevelop.Setup.sln. The SharpDevelop.Setup project does not use the tool. - -Operation ---------- - -1) The SharpDevelop.Setup.wixproj.user is is generated each time the tool is run -based on the SharpDevelop.Setup.wixproj.user.template file. The product revision is inserted -into the newly generated file. The last used revision is written to a REVISION -file which is put in the Setup\bin folder. This not in the repository and is only -used to stop the tool from regenerating the product guid if the revision number has not -changed. - -2) The build server and buildSetup.bat will run the UpdateSetupInfo tool. -This is not done by the SharpDevelop.Setup project itself intentionally so -nothing changes when building the project from inside SharpDevelop. The -modified SharpDevelop.Setup.wixproj.user need not be checked into the -repository on each build on the build server. - -Creating Releases ------------------ - -When creating a release either the setup msi from the build server should be -used or that generated after running buildSetup.bat. This will revision number -if the current revision has changed. - - diff --git a/src/Tools/UpdateSetupInfo/UpdateSetupInfo.csproj b/src/Tools/UpdateSetupInfo/UpdateSetupInfo.csproj deleted file mode 100644 index 67a6c9c828f..00000000000 --- a/src/Tools/UpdateSetupInfo/UpdateSetupInfo.csproj +++ /dev/null @@ -1,52 +0,0 @@ - - - Exe - UpdateSetupInfo - UpdateSetupInfo - Debug - AnyCPU - {75E6D78C-DC66-40F1-90AC-F9F97ADE3506} - False - False - False - Auto - 4194304 - x86 - 4096 - 4 - false - bin - C:\Users\Daniel\AppData\Roaming\ICSharpCode/SharpDevelop3.0\Settings.SourceAnalysis - v2.0 - - - obj\Debug\ - False - DEBUG;TRACE - true - Full - True - - - obj\Release\ - True - TRACE - False - None - False - - - - ..\..\Libraries\SharpSvn\SharpSvn.dll - False - - - - - - - - - - - \ No newline at end of file diff --git a/src/Tools/UpdateSetupInfo/UpdateSetupInfo.sln b/src/Tools/UpdateSetupInfo/UpdateSetupInfo.sln deleted file mode 100644 index 4c9a4ced8d4..00000000000 --- a/src/Tools/UpdateSetupInfo/UpdateSetupInfo.sln +++ /dev/null @@ -1,18 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -# SharpDevelop 3.1.0.3932 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UpdateSetupInfo", "UpdateSetupInfo.csproj", "{75E6D78C-DC66-40F1-90AC-F9F97ADE3506}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {75E6D78C-DC66-40F1-90AC-F9F97ADE3506}.Debug|Any CPU.Build.0 = Debug|Any CPU - {75E6D78C-DC66-40F1-90AC-F9F97ADE3506}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {75E6D78C-DC66-40F1-90AC-F9F97ADE3506}.Release|Any CPU.Build.0 = Release|Any CPU - {75E6D78C-DC66-40F1-90AC-F9F97ADE3506}.Release|Any CPU.ActiveCfg = Release|Any CPU - EndGlobalSection -EndGlobal