Browse Source

Fix automated build.

pull/1/head
Daniel Grunwald 15 years ago
parent
commit
79e2ce1402
  1. 17
      src/Automated.proj
  2. 10
      src/Tools/Tools.build
  3. 22
      src/Tools/UpdateAssemblyInfo/Main.cs
  4. 13
      src/Tools/UpdateAssemblyInfo/UpdateAssemblyInfo.csproj

17
src/Automated.proj

@ -11,7 +11,7 @@ @@ -11,7 +11,7 @@
<SharpDevelopSrc>$(ProjectDir)\src</SharpDevelopSrc>
<SharpDevelopBin>$(ProjectDir)\bin</SharpDevelopBin>
<MSBuildCommunityTasksPath>$(MSBuildProjectDirectory)\Tools\MSBuildCommunityTasks</MSBuildCommunityTasksPath>
<ArtefactPrefix>SharpDevelop_3.2.0.</ArtefactPrefix>
<ArtefactPrefix>SharpDevelop_</ArtefactPrefix>
<NUnitToolPath>$(MSBuildProjectDirectory)\Tools\NUnit</NUnitToolPath>
<NUnitTempToolPath>$(SharpDevelopBin)\Tools\x86NUnit</NUnitTempToolPath>
<ProfilerSrc>$(SharpDevelopSrc)\AddIns\Misc\Profiler</ProfilerSrc>
@ -56,13 +56,11 @@ @@ -56,13 +56,11 @@
Targets="PrepareRelease"
Properties="Configuration=Release"/>
<!-- read content of REVISION into $(BuildNumer) -->
<ReadLinesFromFile File="$(ProjectDir)\REVISION">
<Output TaskParameter="Lines" ItemName="REVISIONLines"/>
</ReadLinesFromFile>
<CreateProperty Value="@(REVISIONLines)">
<Output TaskParameter="Value" PropertyName="BuildNumber"/>
</CreateProperty>
<!-- read content of REVISION into $(BuildNumber) -->
<XmlRead XPath="/versionInfo/version"
XmlFileName="$(ProjectDir)\REVISION">
<Output TaskParameter="Value" PropertyName="BuildNumber" />
</XmlRead>
<Message Importance="high" Text="BuildNumber=$(BuildNumber)"/>
<Copy SourceFiles="$(ProjectDir)\REVISION"
@ -121,9 +119,6 @@ @@ -121,9 +119,6 @@
</Target>
<Target Name="createsetup">
<Exec WorkingDirectory="$(SharpDevelopSrc)\Tools\UpdateSetupInfo\bin\"
Command="UpdateSetupInfo.exe"/>
<Exec WorkingDirectory="$(SharpDevelopSrc)\Setup"
Command="$(MSBuildExecutable) SharpDevelop.Setup.sln $(BuildProperties)"/>

10
src/Tools/Tools.build

@ -40,15 +40,9 @@ @@ -40,15 +40,9 @@
<Target Name="Rebuild" DependsOnTargets="Build"/>
<ItemGroup>
<PrepareReleaseProject Include="SVNChangeLogToXml\SVNChangeLogToXml.csproj" />
</ItemGroup>
<Target Name="PrepareRelease">
<MSBuild Projects="@(PrepareReleaseProject)" Targets="Build"/>
<Exec Command="SVNChangelogToXml.exe --REVISION --START 3800" WorkingDirectory = "SVNChangeLogToXml\bin\Release" Timeout = "60000" IgnoreExitCode = "false"/>
<RemoveDir Directories="SVNChangeLogToXml\bin" />
<RemoveDir Directories="SVNChangeLogToXml\obj" />
<!--<MSBuild Projects="@(PrepareReleaseProject)" Targets="Build"/>-->
<Exec Command="UpdateAssemblyInfo.exe --REVISION" WorkingDirectory = "UpdateAssemblyInfo\bin\Debug" Timeout = "60000" IgnoreExitCode = "false"/>
</Target>
<ItemGroup>

22
src/Tools/UpdateAssemblyInfo/Main.cs

@ -9,12 +9,13 @@ using System.Collections.Specialized; @@ -9,12 +9,13 @@ using System.Collections.Specialized;
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 System.Threading;
using System.Xml.Linq;
namespace UpdateAssemblyInfo
{
@ -80,6 +81,15 @@ namespace UpdateAssemblyInfo @@ -80,6 +81,15 @@ namespace UpdateAssemblyInfo
}
RetrieveRevisionNumber();
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;
}
} catch (Exception ex) {
@ -90,7 +100,6 @@ namespace UpdateAssemblyInfo @@ -90,7 +100,6 @@ namespace UpdateAssemblyInfo
static void UpdateFiles()
{
string fullVersionNumber = GetMajorVersion() + "." + revisionNumber;
foreach (var file in templateFiles) {
string content;
using (StreamReader r = new StreamReader(file.Input)) {
@ -161,6 +170,7 @@ namespace UpdateAssemblyInfo @@ -161,6 +170,7 @@ namespace UpdateAssemblyInfo
#region Retrieve Revision Number
static string revisionNumber;
static string fullVersionNumber;
static string gitCommitHash;
static void RetrieveRevisionNumber()
@ -174,6 +184,7 @@ namespace UpdateAssemblyInfo @@ -174,6 +184,7 @@ namespace UpdateAssemblyInfo
if (revisionNumber == null) {
ReadRevisionFromFile();
}
fullVersionNumber = GetMajorVersion() + "." + revisionNumber;
}
static void ReadRevisionNumberFromGit()
@ -201,10 +212,9 @@ namespace UpdateAssemblyInfo @@ -201,10 +212,9 @@ namespace UpdateAssemblyInfo
static void ReadRevisionFromFile()
{
try {
using (StreamReader reader = new StreamReader(@"..\REVISION")) {
revisionNumber = reader.ReadLine();
gitCommitHash = reader.ReadLine();
}
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();

13
src/Tools/UpdateAssemblyInfo/UpdateAssemblyInfo.csproj

@ -18,9 +18,10 @@ @@ -18,9 +18,10 @@
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<NoWarn>1607</NoWarn>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<ApplicationManifest>app.manifest</ApplicationManifest>
<SourceAnalysisOverrideSettingsFile>C:\Users\Daniel\AppData\Roaming\ICSharpCode/SharpDevelop3.0\Settings.SourceAnalysis</SourceAnalysisOverrideSettingsFile>
<StartArguments>--REVISION</StartArguments>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<OutputPath>bin\Debug\</OutputPath>
@ -35,6 +36,7 @@ @@ -35,6 +36,7 @@
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugType>Full</DebugType>
<DebugSymbols>true</DebugSymbols>
<StartAction>Project</StartAction>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DebugType>None</DebugType>
@ -42,8 +44,17 @@ @@ -42,8 +44,17 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Data.DataSetExtensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Main.cs" />

Loading…
Cancel
Save