From 327382375ba657415a33ec1ee4aed89878e051f8 Mon Sep 17 00:00:00 2001
From: Markus Quaritsch <markus.quaritsch@tugraz.at>
Date: Thu, 3 Jan 2019 09:38:29 +0100
Subject: [PATCH] Change defines for dev-build/release candidate. default build
 is dev version. add solution-wide defines

---
 Build/CommonSettings.targets                              | 6 ++++++
 VECTO/VECTO.vbproj                                        | 1 +
 VectoCommon/VectoCommon/VectoCommon.csproj                | 4 ++++
 VectoCore/VectoCore/OutputData/XML/XMLCustomerReport.cs   | 4 +++-
 .../VectoCore/OutputData/XML/XMLManufacturerReport.cs     | 4 +++-
 VectoCore/VectoCore/Utils/VectoVersionCore.cs             | 8 ++++++--
 VectoCore/VectoCore/Utils/VectoVersionCore.tt             | 7 ++++---
 VectoCore/VectoCore/VectoCore.csproj                      | 4 ++++
 8 files changed, 31 insertions(+), 7 deletions(-)
 create mode 100644 Build/CommonSettings.targets

diff --git a/Build/CommonSettings.targets b/Build/CommonSettings.targets
new file mode 100644
index 0000000000..3e2ec287de
--- /dev/null
+++ b/Build/CommonSettings.targets
@@ -0,0 +1,6 @@
+<Project DefaultTargets = "Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" >
+  <PropertyGroup>
+	<DefineConstants>$(DefineConstants),RELEASE_CANDIDATE</DefineConstants>
+	<!-- <DefineConstants>$(DefineConstants),CERTIFICATION_RELEASE</DefineConstants> -->
+  </PropertyGroup>
+</Project>
\ No newline at end of file
diff --git a/VECTO/VECTO.vbproj b/VECTO/VECTO.vbproj
index 0a898998ad..00596fb26a 100644
--- a/VECTO/VECTO.vbproj
+++ b/VECTO/VECTO.vbproj
@@ -560,4 +560,5 @@
   -->
   <Import Project="$(SolutionDir)Build\TextPreProcessing.targets" />
   <Import Project="$(SolutionDir)Build\Packaging.targets" />
+  <Import Project="$(SolutionDir)Build\CommonSettings.targets" />
 </Project>
\ No newline at end of file
diff --git a/VectoCommon/VectoCommon/VectoCommon.csproj b/VectoCommon/VectoCommon/VectoCommon.csproj
index ada7b6397c..6467ccd9c7 100644
--- a/VectoCommon/VectoCommon/VectoCommon.csproj
+++ b/VectoCommon/VectoCommon/VectoCommon.csproj
@@ -127,4 +127,8 @@
   </Target>
   -->
   <Import Project="$(SolutionDir)Build\TextPreProcessing.targets" />
+  <PropertyGroup Condition="'$(SolutionDir)' == '' or '$(SolutionDir)' == '*undefined*'">
+      <SolutionDir>..\..\</SolutionDir>
+  </PropertyGroup>
+  <Import Project="$(SolutionDir)Build\CommonSettings.targets" />
 </Project>
\ No newline at end of file
diff --git a/VectoCore/VectoCore/OutputData/XML/XMLCustomerReport.cs b/VectoCore/VectoCore/OutputData/XML/XMLCustomerReport.cs
index 1aa6958174..6e00b0a7d0 100644
--- a/VectoCore/VectoCore/OutputData/XML/XMLCustomerReport.cs
+++ b/VectoCore/VectoCore/OutputData/XML/XMLCustomerReport.cs
@@ -207,7 +207,9 @@ namespace TUGraz.VectoCore.OutputData.XML
 		private XElement GetApplicationInfo()
 		{
 			var versionNumber = VectoSimulationCore.VersionNumber;
-#if RELEASE_CANDIDATE
+#if CERTIFICATION_RELEASE
+			// add nothing to version number
+#else
 			versionNumber += " !!NOT FOR CERTIFICATION!!";
 #endif
 			return new XElement(tns + XMLNames.Report_ApplicationInfo_ApplicationInformation,
diff --git a/VectoCore/VectoCore/OutputData/XML/XMLManufacturerReport.cs b/VectoCore/VectoCore/OutputData/XML/XMLManufacturerReport.cs
index 59c39dfb2b..1c58cf6f4d 100644
--- a/VectoCore/VectoCore/OutputData/XML/XMLManufacturerReport.cs
+++ b/VectoCore/VectoCore/OutputData/XML/XMLManufacturerReport.cs
@@ -384,7 +384,9 @@ namespace TUGraz.VectoCore.OutputData.XML
 		private XElement GetApplicationInfo()
 		{
 			var versionNumber = VectoSimulationCore.VersionNumber;
-#if RELEASE_CANDIDATE
+#if CERTIFICATION_RELEASE
+// add nothing to version number
+#else
 			versionNumber += " !!NOT FOR CERTIFICATION!!";
 #endif
 			return new XElement(tns + XMLNames.Report_ApplicationInfo_ApplicationInformation,
diff --git a/VectoCore/VectoCore/Utils/VectoVersionCore.cs b/VectoCore/VectoCore/Utils/VectoVersionCore.cs
index 7d230b6772..4098e7eead 100644
--- a/VectoCore/VectoCore/Utils/VectoVersionCore.cs
+++ b/VectoCore/VectoCore/Utils/VectoVersionCore.cs
@@ -34,16 +34,20 @@ namespace TUGraz.VectoCore.Utils
 	public static class VectoSimulationCore
 	{
 
+#if CERTIFICATION_RELEASE
+		private const string SUFFIX = "";
+#else
 #if RELEASE_CANDIDATE
 		private const string SUFFIX = "-RC";
 #else
-		private const string SUFFIX = "";
+		private const string SUFFIX = "-DEV";
+#endif
 #endif
 
 		public static string VersionNumber
 		{
 			get {
-				return "3.3.0.1433" + SUFFIX;
+				return "3.3.1.1463" + SUFFIX;
 			}
 		}
 
diff --git a/VectoCore/VectoCore/Utils/VectoVersionCore.tt b/VectoCore/VectoCore/Utils/VectoVersionCore.tt
index 1a06dcd847..8b3c70c80b 100644
--- a/VectoCore/VectoCore/Utils/VectoVersionCore.tt
+++ b/VectoCore/VectoCore/Utils/VectoVersionCore.tt
@@ -37,13 +37,14 @@ namespace TUGraz.VectoCore.Utils
 	public static class VectoSimulationCore
 	{
 
-#if BETA_RELEASE
-		private const string SUFFIX = "-DEV";
+#if CERTIFICATION_RELEASE
+		private const string SUFFIX = "";
 #else
 #if RELEASE_CANDIDATE
 		private const string SUFFIX = "-RC";
+#else
+		private const string SUFFIX = "-DEV";
 #endif
-		private const string SUFFIX = "";
 #endif
 
 		public static string VersionNumber
diff --git a/VectoCore/VectoCore/VectoCore.csproj b/VectoCore/VectoCore/VectoCore.csproj
index 6842dba8c8..cd16bd897e 100644
--- a/VectoCore/VectoCore/VectoCore.csproj
+++ b/VectoCore/VectoCore/VectoCore.csproj
@@ -528,4 +528,8 @@
   </Target>
   -->
   <Import Project="$(SolutionDir)Build\TextPreProcessing.targets" />
+  <PropertyGroup Condition="'$(SolutionDir)' == '' or '$(SolutionDir)' == '*undefined*'">
+      <SolutionDir>..\..\</SolutionDir>
+  </PropertyGroup>
+  <Import Project="$(SolutionDir)Build\CommonSettings.targets" />
 </Project>
\ No newline at end of file
-- 
GitLab