From fc1500dd8790607a8e39279b9fea55f15459a32d Mon Sep 17 00:00:00 2001
From: Michael Krisper <michael.krisper@tugraz.at>
Date: Tue, 1 Mar 2016 17:40:07 +0100
Subject: [PATCH] updated licence header to display more information

---
 LicenceHeader/Program.cs                    | 45 ++++++++++++++-------
 LicenceHeader/Properties/AssemblyInfo.cs    |  1 -
 VectoCore/InputData/EngineeringInputData.cs | 33 ++++++++++++++-
 3 files changed, 63 insertions(+), 16 deletions(-)

diff --git a/LicenceHeader/Program.cs b/LicenceHeader/Program.cs
index a4d66a6b51..5b2c255de7 100644
--- a/LicenceHeader/Program.cs
+++ b/LicenceHeader/Program.cs
@@ -31,6 +31,7 @@
 
 using System;
 using System.IO;
+using System.Linq;
 using System.Text;
 using System.Text.RegularExpressions;
 
@@ -45,25 +46,41 @@ namespace LicenceHeader
 
 		private static void Main()
 		{
+			Console.ForegroundColor = ConsoleColor.White;
+			Console.WriteLine("Updating Licence-Headers in Sourcefiles.");
+			Console.ResetColor();
+			Console.WriteLine();
+			Console.WriteLine("Search Directory: {0}", Path.GetFullPath(SolutionRootDirectory));
+			Console.WriteLine("Filter: *.cs, Excluded Dirs: \\obj, \\bin");
+			Console.WriteLine("Header-File: {0}", Path.GetFullPath("header.txt"));
+
 			var licence = File.ReadAllText("header.txt", Encoding.UTF8);
-			var count = 0;
+			var re = new Regex("^.*?(?=using|namespace)", RegexOptions.Singleline);
 
-			foreach (var file in Directory.EnumerateFiles(SolutionRootDirectory, "*.cs", SearchOption.AllDirectories)) {
-				Console.WriteLine(file);
-				if (file.Contains("\\obj\\") || file.Contains("\\bin\\")) {
-					continue;
-				}
+			var updatedFiles = Directory.EnumerateFiles(SolutionRootDirectory, "*.cs", SearchOption.AllDirectories)
+				.AsParallel()
+				.Where(f => !(f.Contains("\\obj\\") || f.Contains("\\bin\\")))
+				.Select(f => {
+					var content = File.ReadAllText(f, Encoding.UTF8);
+					return new { name = f, content, replacedContent = re.Replace(content, licence) };
+				})
+				.Where(f => f.content != f.replacedContent)
+				.Select(f => {
+					File.WriteAllText(f.name, f.replacedContent, Encoding.UTF8);
+					return f.name;
+				});
 
-				var re = new Regex("^.*?(?=using|namespace)", RegexOptions.Singleline);
-				var content = File.ReadAllText(file, Encoding.UTF8);
-				var updatedContent = re.Replace(content, licence);
-				if (updatedContent != content) {
-					File.WriteAllText(file, updatedContent, Encoding.UTF8);
-					Console.WriteLine("Updated " + file);
-					count++;
-				}
+			var count = 0;
+			foreach (var f in updatedFiles) {
+				count++;
+				Console.WriteLine(f.Substring(SolutionRootDirectory.Length - 1));
 			}
+
+			Console.WriteLine();
+			Console.ForegroundColor = ConsoleColor.White;
 			Console.WriteLine("Finished. Updated {0} files.", count);
+			Console.ResetColor();
+
 			Console.ReadKey();
 		}
 	}
diff --git a/LicenceHeader/Properties/AssemblyInfo.cs b/LicenceHeader/Properties/AssemblyInfo.cs
index 1d7d66dfbb..0c281df26e 100644
--- a/LicenceHeader/Properties/AssemblyInfo.cs
+++ b/LicenceHeader/Properties/AssemblyInfo.cs
@@ -29,7 +29,6 @@
 *   Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology
 */
 
-
 using System.Reflection;
 using System.Runtime.InteropServices;
 
diff --git a/VectoCore/InputData/EngineeringInputData.cs b/VectoCore/InputData/EngineeringInputData.cs
index 109c043ddf..eeee69ceff 100644
--- a/VectoCore/InputData/EngineeringInputData.cs
+++ b/VectoCore/InputData/EngineeringInputData.cs
@@ -1,4 +1,35 @@
-using System.Collections.Generic;
+/*
+* This file is part of VECTO.
+*
+* Copyright © 2012-2016 European Union
+*
+* Developed by Graz University of Technology,
+*              Institute of Internal Combustion Engines and Thermodynamics,
+*              Institute of Technical Informatics
+*
+* VECTO is licensed under the EUPL, Version 1.1 or - as soon they will be approved
+* by the European Commission - subsequent versions of the EUPL (the "Licence");
+* You may not use VECTO except in compliance with the Licence.
+* You may obtain a copy of the Licence at:
+*
+* https://joinup.ec.europa.eu/community/eupl/og_page/eupl
+*
+* Unless required by applicable law or agreed to in writing, VECTO
+* distributed under the Licence is distributed on an "AS IS" basis,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the Licence for the specific language governing permissions and
+* limitations under the Licence.
+*
+* Authors:
+*   Stefan Hausberger, hausberger@ivt.tugraz.at, IVT, Graz University of Technology
+*   Christian Kreiner, christian.kreiner@tugraz.at, ITI, Graz University of Technology
+*   Michael Krisper, michael.krisper@tugraz.at, ITI, Graz University of Technology
+*   Raphael Luz, luz@ivt.tugraz.at, IVT, Graz University of Technology
+*   Markus Quaritsch, markus.quaritsch@tugraz.at, IVT, Graz University of Technology
+*   Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology
+*/
+
+using System.Collections.Generic;
 using System.Data;
 using TUGraz.VectoCore.Models.SimulationComponent.Data;
 using TUGraz.VectoCore.Utils;
-- 
GitLab