From fbb09a7e4a7f04aa8cf7300b23af25f6e11fe590 Mon Sep 17 00:00:00 2001
From: Morten Aune Lyrstad <4653628+malware-dev@users.noreply.github.com>
Date: Sun, 7 May 2023 19:07:33 +0200
Subject: [PATCH] The scripting system I used to run the information generator
has died, meaning bad version info got into the thing. Replaced it.
---
Source/MDK/MDK.csproj | 37 ++++++++++++++++++++++++
Source/MDK/MDKPackage.GeneratedInfo.cs | 6 ++--
Source/MDK/MDKPackage.GeneratedInfo.csx | 20 +++++++++----
Source/MDK/source.extension.vsixmanifest | 2 +-
4 files changed, 56 insertions(+), 9 deletions(-)
diff --git a/Source/MDK/MDK.csproj b/Source/MDK/MDK.csproj
index a66d356..a8d1035 100644
--- a/Source/MDK/MDK.csproj
+++ b/Source/MDK/MDK.csproj
@@ -420,6 +420,43 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
"$(ProjectDir)deploy.bat" $(ConfigurationName) "$(ProjectDir)..\..\Release" "$(TargetDir)$(TargetName).vsix"
diff --git a/Source/MDK/MDKPackage.GeneratedInfo.cs b/Source/MDK/MDKPackage.GeneratedInfo.cs
index ab8e4fb..30a7c1d 100644
--- a/Source/MDK/MDKPackage.GeneratedInfo.cs
+++ b/Source/MDK/MDKPackage.GeneratedInfo.cs
@@ -4,13 +4,13 @@
namespace MDK
{
- [InstalledProductRegistration("#110", "#112", "1.4", IconResourceID = 400)] // Info on this package for Help/About
+ [InstalledProductRegistration("#110", "#112", "1.5", IconResourceID = 400)] // Info on this package for Help/About
public partial class MDKPackage
{
///
/// The current package version
///
- public static readonly Version Version = new Version("1.4.14");
+ public static readonly Version Version = new Version("1.5.16");
///
/// The required IDE version
@@ -69,4 +69,4 @@ public partial class MDKPackage
}.ToImmutableArray();
}
-}
+}
\ No newline at end of file
diff --git a/Source/MDK/MDKPackage.GeneratedInfo.csx b/Source/MDK/MDKPackage.GeneratedInfo.csx
index 8e1ac6f..b214302 100644
--- a/Source/MDK/MDKPackage.GeneratedInfo.csx
+++ b/Source/MDK/MDKPackage.GeneratedInfo.csx
@@ -1,4 +1,7 @@
-using System;
+#r "System.Xml"
+#r "System.Xml.Linq"
+
+using System;
using System.Collections.Generic;
using System.IO;
using System.Xml;
@@ -6,9 +9,12 @@ using System.Xml.Linq;
using System.Xml.XPath;
const string Xmlns = "http://schemas.microsoft.com/developer/msbuild/2003";
+readonly string ProjectFilePath = Path.GetFullPath("MDK.csproj");
+
+Console.WriteLine("GENERATING PACKAGE INFORMATION");
var namespaceName = "MDK";
-var manifest = XDocument.Load(Path.Combine(Path.GetDirectoryName(Context.ProjectFilePath), "source.extension.vsixmanifest"));
+var manifest = XDocument.Load(Path.Combine(Path.GetDirectoryName(ProjectFilePath), "source.extension.vsixmanifest"));
var identity = manifest
.Element(XName.Get("PackageManifest", "http://schemas.microsoft.com/developer/vsx-schema/2011"))
.Element(XName.Get("Metadata", "http://schemas.microsoft.com/developer/vsx-schema/2011"))
@@ -20,7 +26,7 @@ var gameAssemblies = new List();
var utilityAssemblies = new List();
var gameFiles = new List();
var utilityFiles = new List();
-var projectTemplate = XDocument.Load(Path.Combine(Path.GetDirectoryName(Context.ProjectFilePath), "..\\IngameScriptTemplate\\ProjectTemplate.csproj"));
+var projectTemplate = XDocument.Load(Path.Combine(Path.GetDirectoryName(ProjectFilePath), "..\\IngameScriptTemplate\\ProjectTemplate.csproj"));
var xmlns = new XmlNamespaceManager(new NameTable());
xmlns.AddNamespace("ms", Xmlns);
foreach (var element in projectTemplate.XPathSelectElements("/ms:Project/ms:ItemGroup/ms:Reference", xmlns))
@@ -40,14 +46,18 @@ foreach (var element in projectTemplate.XPathSelectElements("/ms:Project/ms:Item
utilityFiles.Add($"\"{include.Substring(16).Replace("\\", "\\\\")}\"");
}
-var other = XDocument.Load(Path.Combine(Path.GetDirectoryName(Context.ProjectFilePath), "other.xml"));
+var other = XDocument.Load(Path.Combine(Path.GetDirectoryName(ProjectFilePath), "other.xml"));
var isPrerelease = string.Equals(other.XPathSelectElement("/Other/IsPrerelease")?.Value ?? "True", "true", StringComparison.CurrentCultureIgnoreCase)? "true" : "false";
var helpPageUrl = other.XPathSelectElement("/Other/HelpPageUrl")?.Value ?? "";
var releasePageUrl = other.XPathSelectElement("/Other/ReleasePageUrl")?.Value ?? "";
var issuesPageUrl = other.XPathSelectElement("/Other/IssuesPageUrl")?.Value ?? "";
var requiredIdeVersion = other.XPathSelectElement("/Other/RequiredIdeVersion")?.Value ?? "";
-Context.Output.WriteLine($@"using System;
+
+readonly string TargetFileName = Path.Combine(Path.GetDirectoryName(ProjectFilePath), "MDKPackage.GeneratedInfo.cs");
+Console.WriteLine(TargetFileName);
+
+File.WriteAllText(TargetFileName, $@"using System;
using System.Collections.Immutable;
using Microsoft.VisualStudio.Shell;
diff --git a/Source/MDK/source.extension.vsixmanifest b/Source/MDK/source.extension.vsixmanifest
index 32a9fd3..8eb56e8 100644
--- a/Source/MDK/source.extension.vsixmanifest
+++ b/Source/MDK/source.extension.vsixmanifest
@@ -1,7 +1,7 @@
-
+
MDK/SE
A toolkit to help with ingame script (programmable block) development for Keen Software House's space sandbox Space Engineers.