Build - remove Umbraco MSBuild tasks

This commit is contained in:
Stephan
2017-07-24 12:03:43 +02:00
parent 7dce104afb
commit 5d1c0d916c
5 changed files with 0 additions and 218 deletions

View File

@@ -1,53 +0,0 @@
using System;
using System.IO;
using System.Text.RegularExpressions;
using Microsoft.Build.Framework;
namespace Umbraco.MSBuild.Tasks
{
public class GetAssemblyFileVersion : ITask
{
[Required]
public string strFilePathAssemblyInfo { get; set; }
[Output]
public string strAssemblyFileVersion { get; set; }
public bool Execute()
{
StreamReader streamreaderAssemblyInfo = null;
Match matchVersion;
Group groupVersion;
string strLine;
strAssemblyFileVersion = String.Empty;
try
{
streamreaderAssemblyInfo = new StreamReader(strFilePathAssemblyInfo);
while ((strLine = streamreaderAssemblyInfo.ReadLine()) != null)
{
matchVersion = Regex.Match(strLine, @"(?:AssemblyFileVersion\("")(?<ver>(\d*)\.(\d*)(\.(\d*)(\.(\d*))?)?)(?:""\))", RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace | RegexOptions.Singleline | RegexOptions.ExplicitCapture);
if (matchVersion.Success)
{
groupVersion = matchVersion.Groups["ver"];
if ((groupVersion.Success) && (!String.IsNullOrEmpty(groupVersion.Value)))
{
strAssemblyFileVersion = groupVersion.Value;
break;
}
}
}
}
catch (Exception e)
{
BuildMessageEventArgs args = new BuildMessageEventArgs(e.Message, string.Empty, "GetAssemblyFileVersion", MessageImportance.High);
BuildEngine.LogMessageEvent(args);
}
finally { if (streamreaderAssemblyInfo != null) streamreaderAssemblyInfo.Close(); }
return (true);
}
public IBuildEngine BuildEngine { get; set; }
public ITaskHost HostObject { get; set; }
}
}

View File

@@ -1,36 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Umbraco.MSBuild.Tasks")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("Umbraco.MSBuild.Tasks")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2011")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("a4741c02-d938-4b29-a9b3-66ade85c95b5")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -1,45 +0,0 @@
using System;
using System.IO;
using System.Xml;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using System.Text.RegularExpressions;
namespace Umbraco.MSBuild.Tasks
{
public class TimestampOffset : Task
{
[Required]
public int Offset { get; set; }
public ITaskItem[] Files { get; set; }
public override bool Execute()
{
try
{
if (Files != null && Files.Length > 0)
{
foreach (var file in Files)
{
if (File.Exists(file.ItemSpec))
{
var creationDate = File.GetCreationTimeUtc(file.ItemSpec);
var modifiedDate = File.GetLastWriteTimeUtc(file.ItemSpec);
File.SetCreationTimeUtc(file.ItemSpec, creationDate.AddHours(Offset));
File.SetLastWriteTimeUtc(file.ItemSpec, modifiedDate.AddHours(Offset));
}
}
}
return true;
}
catch(Exception e)
{
Log.LogErrorFromException(e);
return false;
}
}
}
}

View File

@@ -1,12 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<UmbracoMSBuildTasksPath Condition="'$(UmbracoMSBuildTasksPath)' == ''">$(MSBuildProjectDirectory)\Lib\UmbracoMSBuildTasks</UmbracoMSBuildTasksPath>
<UmbracoMSBuildTasksLib>$(UmbracoMSBuildTasksPath)\Umbraco.MSBuild.Tasks.dll</UmbracoMSBuildTasksLib>
</PropertyGroup>
<UsingTask AssemblyFile="$(UmbracoMSBuildTasksLib)" TaskName="Umbraco.MSBuild.Tasks.TimestampOffset" />
<UsingTask AssemblyFile="$(UmbracoMSBuildTasksLib)" TaskName="Umbraco.MSBuild.Tasks.GetAssemblyFileVersion" />
</Project>

View File

@@ -1,72 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{68AC9679-2439-4DA9-86BC-E36579594EFB}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Umbraco.MSBuild.Tasks</RootNamespace>
<AssemblyName>Umbraco.MSBuild.Tasks</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Build.Framework" />
<Reference Include="Microsoft.Build.Utilities.v4.0" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="GetAssemblyFileVersion.cs" />
<Compile Include="TimestampOffset.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Umbraco.MSBuild.Tasks.Targets">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<SubType>Designer</SubType>
</None>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>robocopy "$(TargetDir) " "$(SolutionDir)..\lib\Umbraco\UmbracoMSBuildTasks " "*Umbraco.MSBuild.Tasks.dll" "*Umbraco.MSBuild.Tasks.targets" /NP /NJS
if errorlevel 4 goto BuildEventFailed
if errorlevel 0 goto end
:BuildEventFailed echo FILECOPY for $(ProjectName) FAILED
exit 1
:end echo FILECOPY for $(ProjectName) COMPLETED OK
exit 0</PostBuildEvent>
</PropertyGroup>
<!-- 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.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>