From 5d1c0d916c6c5acadf77e859569639b194bebfb3 Mon Sep 17 00:00:00 2001 From: Stephan Date: Mon, 24 Jul 2017 12:03:43 +0200 Subject: [PATCH] Build - remove Umbraco MSBuild tasks --- .../GetAssemblyFileVersion.cs | 53 -------------- .../Properties/AssemblyInfo.cs | 36 ---------- src/Umbraco.MSBuild.Tasks/TimestampOffset.cs | 45 ------------ .../Umbraco.MSBuild.Tasks.Targets | 12 ---- .../Umbraco.MSBuild.Tasks.csproj | 72 ------------------- 5 files changed, 218 deletions(-) delete mode 100644 src/Umbraco.MSBuild.Tasks/GetAssemblyFileVersion.cs delete mode 100644 src/Umbraco.MSBuild.Tasks/Properties/AssemblyInfo.cs delete mode 100644 src/Umbraco.MSBuild.Tasks/TimestampOffset.cs delete mode 100644 src/Umbraco.MSBuild.Tasks/Umbraco.MSBuild.Tasks.Targets delete mode 100644 src/Umbraco.MSBuild.Tasks/Umbraco.MSBuild.Tasks.csproj diff --git a/src/Umbraco.MSBuild.Tasks/GetAssemblyFileVersion.cs b/src/Umbraco.MSBuild.Tasks/GetAssemblyFileVersion.cs deleted file mode 100644 index 2251470e41..0000000000 --- a/src/Umbraco.MSBuild.Tasks/GetAssemblyFileVersion.cs +++ /dev/null @@ -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\("")(?(\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; } - } -} diff --git a/src/Umbraco.MSBuild.Tasks/Properties/AssemblyInfo.cs b/src/Umbraco.MSBuild.Tasks/Properties/AssemblyInfo.cs deleted file mode 100644 index 48dcc9cec7..0000000000 --- a/src/Umbraco.MSBuild.Tasks/Properties/AssemblyInfo.cs +++ /dev/null @@ -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")] diff --git a/src/Umbraco.MSBuild.Tasks/TimestampOffset.cs b/src/Umbraco.MSBuild.Tasks/TimestampOffset.cs deleted file mode 100644 index e1569ad1f8..0000000000 --- a/src/Umbraco.MSBuild.Tasks/TimestampOffset.cs +++ /dev/null @@ -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; - } - } - } -} diff --git a/src/Umbraco.MSBuild.Tasks/Umbraco.MSBuild.Tasks.Targets b/src/Umbraco.MSBuild.Tasks/Umbraco.MSBuild.Tasks.Targets deleted file mode 100644 index 2015db188e..0000000000 --- a/src/Umbraco.MSBuild.Tasks/Umbraco.MSBuild.Tasks.Targets +++ /dev/null @@ -1,12 +0,0 @@ - - - - - $(MSBuildProjectDirectory)\Lib\UmbracoMSBuildTasks - $(UmbracoMSBuildTasksPath)\Umbraco.MSBuild.Tasks.dll - - - - - - diff --git a/src/Umbraco.MSBuild.Tasks/Umbraco.MSBuild.Tasks.csproj b/src/Umbraco.MSBuild.Tasks/Umbraco.MSBuild.Tasks.csproj deleted file mode 100644 index 1a4cd2bc49..0000000000 --- a/src/Umbraco.MSBuild.Tasks/Umbraco.MSBuild.Tasks.csproj +++ /dev/null @@ -1,72 +0,0 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {68AC9679-2439-4DA9-86BC-E36579594EFB} - Library - Properties - Umbraco.MSBuild.Tasks - Umbraco.MSBuild.Tasks - v4.0 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - - Always - Designer - - - - - 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 - - - \ No newline at end of file