26 changed files with 1211 additions and 811 deletions
@ -1,6 +0,0 @@
@@ -1,6 +0,0 @@
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"> |
||||
<PropertyGroup> |
||||
<SetupProductBuildVersion>1</SetupProductBuildVersion> |
||||
<DefineConstants>PRODUCTBUILDVERSION=$(SetupProductBuildVersion)</DefineConstants> |
||||
</PropertyGroup> |
||||
</Project> |
@ -1,6 +1,6 @@
@@ -1,6 +1,6 @@
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"> |
||||
<PropertyGroup> |
||||
<SetupProductBuildVersion>$INSERTPRODUCTBUILDVERSION$</SetupProductBuildVersion> |
||||
<SetupProductBuildVersion>$INSERTREVISION$</SetupProductBuildVersion> |
||||
<DefineConstants>PRODUCTBUILDVERSION=$(SetupProductBuildVersion)</DefineConstants> |
||||
</PropertyGroup> |
||||
</Project> |
@ -1,4 +1,4 @@
@@ -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 |
@ -1,118 +0,0 @@
@@ -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"); |
||||
} |
||||
} |
@ -1,61 +0,0 @@
@@ -1,61 +0,0 @@
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> |
||||
<PropertyGroup> |
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
||||
<ProductVersion>8.0.40607</ProductVersion> |
||||
<SchemaVersion>2.0</SchemaVersion> |
||||
<ProjectGuid>{c6159c5e-f6ef-4a63-b152-0e49159b6059}</ProjectGuid> |
||||
<RootNamespace>SVNChangelogToXml</RootNamespace> |
||||
<AssemblyName>SVNChangelogToXml</AssemblyName> |
||||
<OutputTarget>Exe</OutputTarget> |
||||
<NoStdLib>False</NoStdLib> |
||||
<NoConfig>False</NoConfig> |
||||
<RunPostBuildEvent>OnSuccessfulBuild</RunPostBuildEvent> |
||||
<RegisterForComInterop>False</RegisterForComInterop> |
||||
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies> |
||||
<BaseAddress>4194304</BaseAddress> |
||||
<PlatformTarget>x86</PlatformTarget> |
||||
<FileAlignment>4096</FileAlignment> |
||||
<WarningLevel>4</WarningLevel> |
||||
<NoWarn>1607</NoWarn> |
||||
<StartArguments>--REVISION --START 100</StartArguments> |
||||
<SourceAnalysisOverrideSettingsFile>C:\Users\Daniel\AppData\Roaming\ICSharpCode/SharpDevelop3.0\Settings.SourceAnalysis</SourceAnalysisOverrideSettingsFile> |
||||
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> |
||||
<DebugSymbols>true</DebugSymbols> |
||||
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow> |
||||
<OutputPath>bin\Debug\</OutputPath> |
||||
<Optimize>False</Optimize> |
||||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks> |
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors> |
||||
<DebugType>Full</DebugType> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> |
||||
<DebugSymbols>False</DebugSymbols> |
||||
<Optimize>True</Optimize> |
||||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks> |
||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow> |
||||
<OutputPath>bin\Release\</OutputPath> |
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> |
||||
</PropertyGroup> |
||||
<ItemGroup> |
||||
<Reference Include="SharpSvn"> |
||||
<HintPath>..\..\Libraries\SharpSvn\SharpSvn.dll</HintPath> |
||||
</Reference> |
||||
<Reference Include="System" /> |
||||
<Reference Include="System.Data" /> |
||||
<Reference Include="System.Drawing" /> |
||||
<Reference Include="System.Windows.Forms" /> |
||||
<Reference Include="System.Xml" /> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<Compile Include="Main.cs" /> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<None Include="SVNChangelogToXml.xsl"> |
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> |
||||
</None> |
||||
</ItemGroup> |
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" /> |
||||
</Project> |
@ -1 +0,0 @@
@@ -1 +0,0 @@
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" /> |
@ -1,18 +0,0 @@
@@ -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 |
@ -1,115 +0,0 @@
@@ -1,115 +0,0 @@
|
||||
<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> |
||||
<xsl:template match="log"> |
||||
<ChangeLog project="SharpDevelop"> |
||||
<xsl:for-each select="./logentry"> |
||||
<Change> |
||||
<xsl:attribute name="author"> |
||||
<xsl:variable name="orig_author" select="./author" /> |
||||
<xsl:variable name="author"> |
||||
<xsl:choose> |
||||
<xsl:when test="$orig_author = 'mikekrueger'"> |
||||
<xsl:text>Mike Krüger</xsl:text> |
||||
</xsl:when> |
||||
<xsl:when test="$orig_author = 'roma'"> |
||||
<xsl:text>Roman Taranchenko</xsl:text> |
||||
</xsl:when> |
||||
<xsl:when test="$orig_author = 'georgb'"> |
||||
<xsl:text>Georg Brandl</xsl:text> |
||||
</xsl:when> |
||||
<xsl:when test="$orig_author = 'andreapaatz'"> |
||||
<xsl:text>Andrea Paatz</xsl:text> |
||||
</xsl:when> |
||||
<xsl:when test="$orig_author = 'danielgrunwald'"> |
||||
<xsl:text>Daniel Grunwald</xsl:text> |
||||
</xsl:when> |
||||
<xsl:when test="$orig_author = 'denise'"> |
||||
<xsl:text>Denis Erchoff</xsl:text> |
||||
</xsl:when> |
||||
<xsl:when test="$orig_author = 'markuspalme'"> |
||||
<xsl:text>Markus Palme</xsl:text> |
||||
</xsl:when> |
||||
<xsl:when test="$orig_author = 'ivoko'"> |
||||
<xsl:text>Ivo Kovacka</xsl:text> |
||||
</xsl:when> |
||||
<xsl:when test="$orig_author = 'jfreilly'"> |
||||
<xsl:text>John Reilly</xsl:text> |
||||
</xsl:when> |
||||
<xsl:when test="$orig_author = 'christophw'"> |
||||
<xsl:text>Christoph Wille</xsl:text> |
||||
</xsl:when> |
||||
<xsl:when test="$orig_author = 'alexandre'"> |
||||
<xsl:text>Alexandre Semenov</xsl:text> |
||||
</xsl:when> |
||||
<xsl:when test="$orig_author = 'nikola'"> |
||||
<xsl:text>Nikola Kavaldjiev</xsl:text> |
||||
</xsl:when> |
||||
<xsl:when test="$orig_author = 'mattward'"> |
||||
<xsl:text>Matt Ward</xsl:text> |
||||
</xsl:when> |
||||
<xsl:when test="$orig_author = 'mathiassimmack'"> |
||||
<xsl:text>Mathias Simmack</xsl:text> |
||||
</xsl:when> |
||||
<xsl:when test="$orig_author = 'davidsrbecky'"> |
||||
<xsl:text>David Srbecký</xsl:text> |
||||
</xsl:when> |
||||
<xsl:when test="$orig_author = 'davidalpert'"> |
||||
<xsl:text>David Alpert</xsl:text> |
||||
</xsl:when> |
||||
<xsl:when test="$orig_author = 'peterforstmeier'"> |
||||
<xsl:text>Peter Forstmeier</xsl:text> |
||||
</xsl:when> |
||||
<xsl:when test="$orig_author = 'scottferrett'"> |
||||
<xsl:text>Scott Ferrett</xsl:text> |
||||
</xsl:when> |
||||
<xsl:when test="$orig_author = 'dickonfield'"> |
||||
<xsl:text>Dickon Field</xsl:text> |
||||
</xsl:when> |
||||
<xsl:when test="$orig_author = 'itaibarhaim'"> |
||||
<xsl:text>Itai Bar-Haim</xsl:text> |
||||
</xsl:when> |
||||
<xsl:when test="$orig_author = 'christianhornung'"> |
||||
<xsl:text>Christian Hornung</xsl:text> |
||||
</xsl:when> |
||||
<xsl:when test="$orig_author = 'justindearing'"> |
||||
<xsl:text>Justin Dearing</xsl:text> |
||||
</xsl:when> |
||||
<xsl:when test="$orig_author = 'russellwilkins'"> |
||||
<xsl:text>Russell Wilkins</xsl:text> |
||||
</xsl:when> |
||||
<xsl:when test="$orig_author = 'robertpickering'"> |
||||
<xsl:text>Robert Pickering</xsl:text> |
||||
</xsl:when> |
||||
<xsl:when test="$orig_author = 'siegfriedpammer'"> |
||||
<xsl:text>Siegfried Pammer</xsl:text> |
||||
</xsl:when> |
||||
<xsl:when test="$orig_author = 'ivanshumilin'"> |
||||
<xsl:text>Ivan Shumilin</xsl:text> |
||||
</xsl:when> |
||||
<xsl:when test="$orig_author = 'philippmaihart'"> |
||||
<xsl:text>Philipp Maihart</xsl:text> |
||||
</xsl:when> |
||||
<xsl:when test="$orig_author = 'martinkonicek'"> |
||||
<xsl:text>Martin Koníček</xsl:text> |
||||
</xsl:when> |
||||
<xsl:when test="$orig_author = 'tomasztretkowski'"> |
||||
<xsl:text>Tomasz Tretkowski</xsl:text> |
||||
</xsl:when> |
||||
<xsl:when test="$orig_author = 'sergejandrejev'"> |
||||
<xsl:text>Sergej Andrejev</xsl:text> |
||||
</xsl:when> |
||||
<xsl:otherwise> |
||||
<xsl:value-of select="./author" /> |
||||
</xsl:otherwise> |
||||
</xsl:choose> |
||||
</xsl:variable> |
||||
<xsl:value-of select="$author" /> |
||||
</xsl:attribute> |
||||
<xsl:attribute name="date"> |
||||
<xsl:value-of select="./date" /> |
||||
</xsl:attribute> |
||||
<xsl:value-of select="./msg" /> |
||||
</Change> |
||||
</xsl:for-each> |
||||
</ChangeLog> |
||||
</xsl:template> |
||||
</xsl:transform> |
@ -1 +1,35 @@
@@ -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. |
||||
|
||||
|
||||
|
Binary file not shown.
@ -1,232 +0,0 @@
@@ -1,232 +0,0 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
using System.Globalization; |
||||
using System.IO; |
||||
using System.Text; |
||||
|
||||
using SharpSvn; |
||||
|
||||
namespace UpdateSetupInfo |
||||
{ |
||||
/// <summary>
|
||||
/// Creates the SharpDevelop.Setup.wixproj.user file based on the
|
||||
/// SharpDevelop.Setup.wixproj.user.template.
|
||||
/// </summary>
|
||||
class UpdateApplication |
||||
{ |
||||
/// <summary>
|
||||
/// Path to the setup project relative to the UpdateSetupInfo.exe file.
|
||||
/// </summary>
|
||||
const string SetupProjectFolderRelativePath = @"..\..\..\Setup"; |
||||
|
||||
/// <summary>
|
||||
/// Name of the setup template file.
|
||||
/// </summary>
|
||||
const string SetupTemplateFileName = "SharpDevelop.Setup.wixproj.user.template"; |
||||
|
||||
/// <summary>
|
||||
/// Name of the setup project user file that will be generated.
|
||||
/// </summary>
|
||||
const string SetupProjectUserFileName = "SharpDevelop.Setup.wixproj.user"; |
||||
|
||||
const int SetupTemplateFileNotFoundReturnCode = 1; |
||||
const int UpdateSetupInfoExceptionReturnCode = 2; |
||||
|
||||
/// <summary>
|
||||
/// The full filename including path to the setup template file.
|
||||
/// </summary>
|
||||
string setupTemplateFullFileName; |
||||
|
||||
/// <summary>
|
||||
/// The full filename including path to the setup project user file that
|
||||
/// will be generated.
|
||||
/// </summary>
|
||||
string setupProjectUserFullFileName; |
||||
|
||||
/// <summary>
|
||||
/// The folder containing the UpdateSetupInfo application.
|
||||
/// </summary>
|
||||
string applicationFolder; |
||||
|
||||
/// <summary>
|
||||
/// The file that contains the last revision number used to update the
|
||||
/// template.
|
||||
/// </summary>
|
||||
string previousRevisionFileName; |
||||
|
||||
/// <summary>
|
||||
/// The folder that contains the last revision number used to update the
|
||||
/// template.
|
||||
/// </summary>
|
||||
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"; |
||||
|
||||
/// <summary>
|
||||
/// Code taken directly from UpdateAssemblyInfo and the paths slightly modified.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The product build version maps to the Subversion revision number.
|
||||
/// </remarks>
|
||||
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(); |
||||
} |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Checks that the current revision matches the revision last used to
|
||||
/// update the SharpDevelop.Setup.wixproj.user file.
|
||||
/// </summary>
|
||||
bool RevisionExists(string currentRevision) |
||||
{ |
||||
// Read previous revision.
|
||||
string previousRevision = ReadPreviousRevision(); |
||||
if (previousRevision != null) { |
||||
return previousRevision == currentRevision; |
||||
} |
||||
return false; |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Reads the previous revision number from the Setup\bin\REVISION file.
|
||||
/// </summary>
|
||||
string ReadPreviousRevision() |
||||
{ |
||||
if (File.Exists(previousRevisionFileName)) { |
||||
using (StreamReader reader = new StreamReader(previousRevisionFileName, true)) { |
||||
return reader.ReadLine(); |
||||
} |
||||
} |
||||
return null; |
||||
} |
||||
} |
||||
} |
@ -1,36 +0,0 @@
@@ -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. |
||||
|
||||
|
@ -1,52 +0,0 @@
@@ -1,52 +0,0 @@
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> |
||||
<PropertyGroup> |
||||
<OutputType>Exe</OutputType> |
||||
<RootNamespace>UpdateSetupInfo</RootNamespace> |
||||
<AssemblyName>UpdateSetupInfo</AssemblyName> |
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
||||
<ProjectGuid>{75E6D78C-DC66-40F1-90AC-F9F97ADE3506}</ProjectGuid> |
||||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks> |
||||
<NoStdLib>False</NoStdLib> |
||||
<RegisterForComInterop>False</RegisterForComInterop> |
||||
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies> |
||||
<BaseAddress>4194304</BaseAddress> |
||||
<PlatformTarget>x86</PlatformTarget> |
||||
<FileAlignment>4096</FileAlignment> |
||||
<WarningLevel>4</WarningLevel> |
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors> |
||||
<OutputPath>bin</OutputPath> |
||||
<SourceAnalysisOverrideSettingsFile>C:\Users\Daniel\AppData\Roaming\ICSharpCode/SharpDevelop3.0\Settings.SourceAnalysis</SourceAnalysisOverrideSettingsFile> |
||||
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> |
||||
<IntermediateOutputPath>obj\Debug\</IntermediateOutputPath> |
||||
<Optimize>False</Optimize> |
||||
<DefineConstants>DEBUG;TRACE</DefineConstants> |
||||
<DebugSymbols>true</DebugSymbols> |
||||
<DebugType>Full</DebugType> |
||||
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' "> |
||||
<IntermediateOutputPath>obj\Release\</IntermediateOutputPath> |
||||
<Optimize>True</Optimize> |
||||
<DefineConstants>TRACE</DefineConstants> |
||||
<DebugSymbols>False</DebugSymbols> |
||||
<DebugType>None</DebugType> |
||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow> |
||||
</PropertyGroup> |
||||
<ItemGroup> |
||||
<Reference Include="SharpSvn"> |
||||
<HintPath>..\..\Libraries\SharpSvn\SharpSvn.dll</HintPath> |
||||
<Private>False</Private> |
||||
</Reference> |
||||
<Reference Include="System" /> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<Compile Include="Main.cs" /> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<Content Include="Readme.txt" /> |
||||
</ItemGroup> |
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" /> |
||||
</Project> |
@ -1,18 +0,0 @@
@@ -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 |
Loading…
Reference in new issue