From 48647efceb011f052118944579a54b1d3f6a47c1 Mon Sep 17 00:00:00 2001 From: Michal Dengusiak Date: Fri, 15 May 2026 17:39:22 +0200 Subject: [PATCH 01/12] Migrate Revit JSON code to System.Text.Json --- .../SAM.Analytical.Grasshopper.Revit.csproj | 3 +- ...SAM.Architectural.Grasshopper.Revit.csproj | 3 +- .../Classes/GooConvertSettings.cs | 2 +- .../SAM.Core.Grasshopper.Revit.csproj | 3 +- .../SAM.Geometry.Grasshopper.Revit.csproj | 3 +- .../Convert/ToRevit/FamilyInstance.cs | 2 +- .../Convert/ToRevit/HostObject.cs | 2 +- .../Convert/ToRevit/Space.cs | 2 +- .../SAM.Analytical.Revit.csproj | 3 +- .../Convert/ToRevit/Level.cs | 2 +- .../SAM.Architectural.Revit.csproj | 3 +- .../SAM.Core.Revit/Classes/ConvertSettings.cs | 20 ++++----- .../SAM.Core.Revit/Classes/DesignOption.cs | 13 +++--- .../Classes/ElementBindingData.cs | 42 +++++++++---------- .../SAM.Core.Revit/Classes/RevitInstance.cs | 13 +++--- SAM_Revit/SAM.Core.Revit/Classes/RevitType.cs | 13 +++--- SAM_Revit/SAM.Core.Revit/Classes/SAMSchema.cs | 38 ++++++++--------- .../Classes/ViewSpecificRevitInstance.cs | 17 ++++---- SAM_Revit/SAM.Core.Revit/Modify/SetJArray.cs | 11 +++-- SAM_Revit/SAM.Core.Revit/Modify/SetJObject.cs | 11 +++-- SAM_Revit/SAM.Core.Revit/Modify/SetValue.cs | 2 +- SAM_Revit/SAM.Core.Revit/Query/IJSAMObject.cs | 16 +++---- SAM_Revit/SAM.Core.Revit/Query/JObject.cs | 9 ++-- .../SAM.Core.Revit/SAM.Core.Revit.csproj | 3 +- .../Classes/FilledRegion.cs | 21 ++++++---- .../Classes/FilledRegionType.cs | 5 +-- .../Classes/RevitInstance2D.cs | 12 +++--- .../Classes/RevitInstance3D.cs | 12 +++--- .../SAM.Geometry.Revit/Classes/RevitType2D.cs | 12 +++--- .../SAM.Geometry.Revit/Classes/RevitType3D.cs | 12 +++--- SAM_Revit/SAM.Geometry.Revit/Classes/Tag.cs | 28 ++++++------- .../SAM.Geometry.Revit/Classes/TagType.cs | 4 +- .../SAM.Geometry.Revit.csproj | 3 +- .../SAM.Units.Revit/SAM.Units.Revit.csproj | 3 +- 34 files changed, 177 insertions(+), 171 deletions(-) diff --git a/Grasshopper/SAM.Analytical.Grasshopper.Revit/SAM.Analytical.Grasshopper.Revit.csproj b/Grasshopper/SAM.Analytical.Grasshopper.Revit/SAM.Analytical.Grasshopper.Revit.csproj index 94957c0f..51e5ec4b 100644 --- a/Grasshopper/SAM.Analytical.Grasshopper.Revit/SAM.Analytical.Grasshopper.Revit.csproj +++ b/Grasshopper/SAM.Analytical.Grasshopper.Revit/SAM.Analytical.Grasshopper.Revit.csproj @@ -643,6 +643,7 @@ 13.0.3 + @@ -707,4 +708,4 @@ - \ No newline at end of file + diff --git a/Grasshopper/SAM.Architectural.Grasshopper.Revit/SAM.Architectural.Grasshopper.Revit.csproj b/Grasshopper/SAM.Architectural.Grasshopper.Revit/SAM.Architectural.Grasshopper.Revit.csproj index 3927edf1..efcbac71 100644 --- a/Grasshopper/SAM.Architectural.Grasshopper.Revit/SAM.Architectural.Grasshopper.Revit.csproj +++ b/Grasshopper/SAM.Architectural.Grasshopper.Revit/SAM.Architectural.Grasshopper.Revit.csproj @@ -640,6 +640,7 @@ 13.0.3 + @@ -729,4 +730,4 @@ - \ No newline at end of file + diff --git a/Grasshopper/SAM.Core.Grasshopper.Revit/Classes/GooConvertSettings.cs b/Grasshopper/SAM.Core.Grasshopper.Revit/Classes/GooConvertSettings.cs index e78cce41..1d0ec8e7 100644 --- a/Grasshopper/SAM.Core.Grasshopper.Revit/Classes/GooConvertSettings.cs +++ b/Grasshopper/SAM.Core.Grasshopper.Revit/Classes/GooConvertSettings.cs @@ -38,7 +38,7 @@ public override bool Write(GH_IWriter writer) if (Value == null) return false; - writer.SetString(typeof(ConvertSettings).FullName, Value.ToJObject().ToString()); + writer.SetString(typeof(ConvertSettings).FullName, Value.ToJsonObject().ToString()); return true; } diff --git a/Grasshopper/SAM.Core.Grasshopper.Revit/SAM.Core.Grasshopper.Revit.csproj b/Grasshopper/SAM.Core.Grasshopper.Revit/SAM.Core.Grasshopper.Revit.csproj index cffaf499..25d928e9 100644 --- a/Grasshopper/SAM.Core.Grasshopper.Revit/SAM.Core.Grasshopper.Revit.csproj +++ b/Grasshopper/SAM.Core.Grasshopper.Revit/SAM.Core.Grasshopper.Revit.csproj @@ -689,6 +689,7 @@ 13.0.3 + @@ -778,4 +779,4 @@ - \ No newline at end of file + diff --git a/Grasshopper/SAM.Geometry.Grasshopper.Revit/SAM.Geometry.Grasshopper.Revit.csproj b/Grasshopper/SAM.Geometry.Grasshopper.Revit/SAM.Geometry.Grasshopper.Revit.csproj index 80fb3faf..ed001a77 100644 --- a/Grasshopper/SAM.Geometry.Grasshopper.Revit/SAM.Geometry.Grasshopper.Revit.csproj +++ b/Grasshopper/SAM.Geometry.Grasshopper.Revit/SAM.Geometry.Grasshopper.Revit.csproj @@ -692,6 +692,7 @@ 13.0.3 + @@ -781,4 +782,4 @@ - \ No newline at end of file + diff --git a/SAM_Revit/SAM.Analytical.Revit/Convert/ToRevit/FamilyInstance.cs b/SAM_Revit/SAM.Analytical.Revit/Convert/ToRevit/FamilyInstance.cs index f258c111..167d3703 100644 --- a/SAM_Revit/SAM.Analytical.Revit/Convert/ToRevit/FamilyInstance.cs +++ b/SAM_Revit/SAM.Analytical.Revit/Convert/ToRevit/FamilyInstance.cs @@ -205,7 +205,7 @@ public static FamilyInstance ToRevit(this Aperture aperture, Document document, } Core.Revit.Modify.SetSimplified(result, simplified); - Core.Revit.Modify.SetJson(result, aperture.ToJObject()?.ToString()); + Core.Revit.Modify.SetJson(result, aperture.ToJsonObject()?.ToString()); } convertSettings?.Add(aperture.Guid, result); diff --git a/SAM_Revit/SAM.Analytical.Revit/Convert/ToRevit/HostObject.cs b/SAM_Revit/SAM.Analytical.Revit/Convert/ToRevit/HostObject.cs index bccbc5e8..a835afca 100644 --- a/SAM_Revit/SAM.Analytical.Revit/Convert/ToRevit/HostObject.cs +++ b/SAM_Revit/SAM.Analytical.Revit/Convert/ToRevit/HostObject.cs @@ -316,7 +316,7 @@ public static HostObject ToRevit(this Panel panel, Document document, Core.Revit Core.Revit.Modify.SetValues(result, panel, builtInParameters); Core.Revit.Modify.SetValues(result, panel, ActiveSetting.Setting); - Core.Revit.Modify.SetJson(result, panel.ToJObject()?.ToString()); + Core.Revit.Modify.SetJson(result, panel.ToJsonObject()?.ToString()); } //TODO: Implement proper log //System.IO.File.AppendAllText(@"C:\Users\DengusiakM\Desktop\SAM\2020-04-16 floorbug\LOG.txt", string.Format("{0}\t{1}\t{2}\n", DateTime.Now.ToString(), panel.Guid, panel.Name)); diff --git a/SAM_Revit/SAM.Analytical.Revit/Convert/ToRevit/Space.cs b/SAM_Revit/SAM.Analytical.Revit/Convert/ToRevit/Space.cs index 72bc39ef..0d8077b3 100644 --- a/SAM_Revit/SAM.Analytical.Revit/Convert/ToRevit/Space.cs +++ b/SAM_Revit/SAM.Analytical.Revit/Convert/ToRevit/Space.cs @@ -57,7 +57,7 @@ public static Autodesk.Revit.DB.Mechanical.Space ToRevit(this Space space, Docum Core.Revit.Modify.SetValues(result, space); Core.Revit.Modify.SetValues(result, space, ActiveSetting.Setting, parameters); - Core.Revit.Modify.SetJson(result, space.ToJObject()?.ToString()); + Core.Revit.Modify.SetJson(result, space.ToJsonObject()?.ToString()); } convertSettings?.Add(space.Guid, result); diff --git a/SAM_Revit/SAM.Analytical.Revit/SAM.Analytical.Revit.csproj b/SAM_Revit/SAM.Analytical.Revit/SAM.Analytical.Revit.csproj index a8e0d0e9..2b6713f4 100644 --- a/SAM_Revit/SAM.Analytical.Revit/SAM.Analytical.Revit.csproj +++ b/SAM_Revit/SAM.Analytical.Revit/SAM.Analytical.Revit.csproj @@ -220,5 +220,6 @@ + - \ No newline at end of file + diff --git a/SAM_Revit/SAM.Architectural.Revit/Convert/ToRevit/Level.cs b/SAM_Revit/SAM.Architectural.Revit/Convert/ToRevit/Level.cs index b6c21c4c..7548593f 100644 --- a/SAM_Revit/SAM.Architectural.Revit/Convert/ToRevit/Level.cs +++ b/SAM_Revit/SAM.Architectural.Revit/Convert/ToRevit/Level.cs @@ -71,7 +71,7 @@ public static Autodesk.Revit.DB.Level ToRevit(this Level level, Document documen Core.Revit.Modify.SetValues(result, level); Core.Revit.Modify.SetValues(result, level, ActiveSetting.Setting); - Core.Revit.Modify.SetJson(result, level.ToJObject()?.ToString()); + Core.Revit.Modify.SetJson(result, level.ToJsonObject()?.ToString()); } convertSettings?.Add(level.Guid, result); diff --git a/SAM_Revit/SAM.Architectural.Revit/SAM.Architectural.Revit.csproj b/SAM_Revit/SAM.Architectural.Revit/SAM.Architectural.Revit.csproj index bc0ace41..215945ef 100644 --- a/SAM_Revit/SAM.Architectural.Revit/SAM.Architectural.Revit.csproj +++ b/SAM_Revit/SAM.Architectural.Revit/SAM.Architectural.Revit.csproj @@ -151,6 +151,7 @@ + @@ -247,4 +248,4 @@ ..\..\..\SAM\build\SAM.Geometry.dll - \ No newline at end of file + diff --git a/SAM_Revit/SAM.Core.Revit/Classes/ConvertSettings.cs b/SAM_Revit/SAM.Core.Revit/Classes/ConvertSettings.cs index c3a11996..b574307f 100644 --- a/SAM_Revit/SAM.Core.Revit/Classes/ConvertSettings.cs +++ b/SAM_Revit/SAM.Core.Revit/Classes/ConvertSettings.cs @@ -1,5 +1,5 @@ using Autodesk.Revit.DB; -using Newtonsoft.Json.Linq; +using System.Text.Json.Nodes; using System.Collections.Generic; using System.Linq; @@ -50,9 +50,9 @@ public ConvertSettings(ConvertSettings convertSettings) objects = new Dictionary>(); } - public ConvertSettings(JObject jObject) + public ConvertSettings(JsonObject jObject) { - FromJObject(jObject); + FromJsonObject(jObject); } public bool ConvertGeometry @@ -111,21 +111,21 @@ public bool AddParameter(string name, object value) return true; } - public bool FromJObject(JObject jObject) + public bool FromJsonObject(JsonObject jObject) { if (jObject == null) return false; - convertGeometry = jObject.Value("ConvertGeometry"); - convertParameters = jObject.Value("ConvertParameters"); - removeExisting = jObject.Value("RemoveExisting"); - useProjectLocation = jObject.Value("UseProjectLocation"); + convertGeometry = jObject["ConvertGeometry"]?.GetValue() ?? default(bool); + convertParameters = jObject["ConvertParameters"]?.GetValue() ?? default(bool); + removeExisting = jObject["RemoveExisting"]?.GetValue() ?? default(bool); + useProjectLocation = jObject["UseProjectLocation"]?.GetValue() ?? default(bool); return true; } - public JObject ToJObject() + public JsonObject ToJsonObject() { - JObject jObject = new JObject(); + JsonObject jObject = new JsonObject(); jObject.Add("_type", Core.Query.FullTypeName(this)); jObject.Add("ConvertGeometry", convertGeometry); jObject.Add("ConvertParameters", convertParameters); diff --git a/SAM_Revit/SAM.Core.Revit/Classes/DesignOption.cs b/SAM_Revit/SAM.Core.Revit/Classes/DesignOption.cs index cb9732d9..805bfa3a 100644 --- a/SAM_Revit/SAM.Core.Revit/Classes/DesignOption.cs +++ b/SAM_Revit/SAM.Core.Revit/Classes/DesignOption.cs @@ -1,5 +1,4 @@ -using Newtonsoft.Json.Linq; - +using System.Text.Json.Nodes; namespace SAM.Core.Revit { public class DesignOption: SAMObject @@ -18,7 +17,7 @@ public DesignOption(string name, bool isPrimary) this.isPrimary = isPrimary; } - public DesignOption(JObject jObject) + public DesignOption(JsonObject jObject) : base(jObject) { @@ -32,17 +31,17 @@ public bool IsPrimary } } - public override bool FromJObject(JObject jObject) + public override bool FromJsonObject(JsonObject jObject) { - if (!base.FromJObject(jObject)) + if (!base.FromJsonObject(jObject)) return false; return true; } - public override JObject ToJObject() + public override JsonObject ToJsonObject() { - JObject jObject = base.ToJObject(); + JsonObject jObject = base.ToJsonObject(); if (jObject == null) return jObject; diff --git a/SAM_Revit/SAM.Core.Revit/Classes/ElementBindingData.cs b/SAM_Revit/SAM.Core.Revit/Classes/ElementBindingData.cs index d4ba3c1a..0544729a 100644 --- a/SAM_Revit/SAM.Core.Revit/Classes/ElementBindingData.cs +++ b/SAM_Revit/SAM.Core.Revit/Classes/ElementBindingData.cs @@ -1,5 +1,5 @@ using Autodesk.Revit.DB; -using Newtonsoft.Json.Linq; +using System.Text.Json.Nodes; using System; using System.Collections.Generic; @@ -13,9 +13,9 @@ public class ElementBindingData : IJSAMObject private BuiltInParameterGroup builtInParameterGroup; private bool instance; - public ElementBindingData(JObject jObject) + public ElementBindingData(JsonObject jObject) { - FromJObject(jObject); + FromJsonObject(jObject); } public ElementBindingData(ElementBindingData elementBindingData) @@ -96,7 +96,7 @@ public bool Instance } } - public bool FromJObject(JObject jObject) + public bool FromJsonObject(JsonObject jObject) { if (jObject == null) { @@ -105,12 +105,12 @@ public bool FromJObject(JObject jObject) if (jObject.ContainsKey("Name")) { - name = jObject.Value("Name"); + name = jObject["Name"]?.GetValue() ?? null; } if (jObject.ContainsKey("BuiltInCategories")) { - JArray jArray = jObject.Value("BuiltInCategories"); + JsonArray jArray = jObject["BuiltInCategories"] as JsonArray; if (jArray != null) { builtInCategories = new HashSet(); @@ -128,7 +128,7 @@ public bool FromJObject(JObject jObject) if (jObject.ContainsKey("BuiltInParameterGroup")) { - string value = jObject.Value("BuiltInParameterGroup"); + string value = jObject["BuiltInParameterGroup"]?.GetValue() ?? null; if (!string.IsNullOrWhiteSpace(value) && Enum.TryParse(value, out BuiltInParameterGroup builtInParameterGroup_Temp)) { builtInParameterGroup = builtInParameterGroup_Temp; @@ -137,15 +137,15 @@ public bool FromJObject(JObject jObject) if (jObject.ContainsKey("Instance")) { - instance = jObject.Value("Instance"); + instance = jObject["Instance"]?.GetValue() ?? default(bool); } return true; } - public JObject ToJObject() + public JsonObject ToJsonObject() { - JObject result = new JObject(); + JsonObject result = new JsonObject(); result.Add("_type", Core.Query.FullTypeName(this)); if (name != null) @@ -155,7 +155,7 @@ public JObject ToJObject() if (builtInCategories != null) { - JArray jArray = new JArray(); + JsonArray jArray = new JsonArray(); foreach (BuiltInCategory builtInCategory in builtInCategories) { jArray.Add(builtInCategory.ToString()); @@ -179,9 +179,9 @@ public class ElementBindingData : IJSAMObject private ForgeTypeId groupTypeId; private bool instance; - public ElementBindingData(JObject jObject) + public ElementBindingData(JsonObject jObject) { - FromJObject(jObject); + FromJsonObject(jObject); } public ElementBindingData(ElementBindingData elementBindingData) @@ -262,7 +262,7 @@ public bool Instance } } - public bool FromJObject(JObject jObject) + public bool FromJsonObject(JsonObject jObject) { if (jObject == null) { @@ -271,12 +271,12 @@ public bool FromJObject(JObject jObject) if (jObject.ContainsKey("Name")) { - name = jObject.Value("Name"); + name = jObject["Name"]?.GetValue() ?? null; } if (jObject.ContainsKey("BuiltInCategories")) { - JArray jArray = jObject.Value("BuiltInCategories"); + JsonArray jArray = jObject["BuiltInCategories"] as JsonArray; if (jArray != null) { builtInCategories = new HashSet(); @@ -294,20 +294,20 @@ public bool FromJObject(JObject jObject) if (jObject.ContainsKey("GroupTypeName")) { - groupTypeId = Query.GroupTypeId(jObject.Value("GroupTypeName")); + groupTypeId = Query.GroupTypeId(jObject["GroupTypeName"]?.GetValue() ?? null); } if (jObject.ContainsKey("Instance")) { - instance = jObject.Value("Instance"); + instance = jObject["Instance"]?.GetValue() ?? default(bool); } return true; } - public JObject ToJObject() + public JsonObject ToJsonObject() { - JObject result = new JObject(); + JsonObject result = new JsonObject(); result.Add("_type", Core.Query.FullTypeName(this)); if (name != null) @@ -317,7 +317,7 @@ public JObject ToJObject() if (builtInCategories != null) { - JArray jArray = new JArray(); + JsonArray jArray = new JsonArray(); foreach (BuiltInCategory builtInCategory in builtInCategories) { jArray.Add(builtInCategory.ToString()); diff --git a/SAM_Revit/SAM.Core.Revit/Classes/RevitInstance.cs b/SAM_Revit/SAM.Core.Revit/Classes/RevitInstance.cs index 0f7eab73..cd3b515a 100644 --- a/SAM_Revit/SAM.Core.Revit/Classes/RevitInstance.cs +++ b/SAM_Revit/SAM.Core.Revit/Classes/RevitInstance.cs @@ -1,5 +1,4 @@ -using Newtonsoft.Json.Linq; - +using System.Text.Json.Nodes; namespace SAM.Core.Revit { public class RevitInstance: SAMInstance where T: RevitType @@ -16,23 +15,23 @@ public RevitInstance(T revitType) } - public RevitInstance(JObject jObject) + public RevitInstance(JsonObject jObject) : base(jObject) { } - public override bool FromJObject(JObject jObject) + public override bool FromJsonObject(JsonObject jObject) { - if (!base.FromJObject(jObject)) + if (!base.FromJsonObject(jObject)) return false; return true; } - public override JObject ToJObject() + public override JsonObject ToJsonObject() { - JObject jObject = base.ToJObject(); + JsonObject jObject = base.ToJsonObject(); if (jObject == null) return jObject; diff --git a/SAM_Revit/SAM.Core.Revit/Classes/RevitType.cs b/SAM_Revit/SAM.Core.Revit/Classes/RevitType.cs index 9154287c..4cd3b968 100644 --- a/SAM_Revit/SAM.Core.Revit/Classes/RevitType.cs +++ b/SAM_Revit/SAM.Core.Revit/Classes/RevitType.cs @@ -1,5 +1,4 @@ -using Newtonsoft.Json.Linq; - +using System.Text.Json.Nodes; namespace SAM.Core.Revit { public class RevitType: SAMType @@ -16,23 +15,23 @@ public RevitType(string name) } - public RevitType(JObject jObject) + public RevitType(JsonObject jObject) : base(jObject) { } - public override bool FromJObject(JObject jObject) + public override bool FromJsonObject(JsonObject jObject) { - if (!base.FromJObject(jObject)) + if (!base.FromJsonObject(jObject)) return false; return true; } - public override JObject ToJObject() + public override JsonObject ToJsonObject() { - JObject jObject = base.ToJObject(); + JsonObject jObject = base.ToJsonObject(); if (jObject == null) return jObject; diff --git a/SAM_Revit/SAM.Core.Revit/Classes/SAMSchema.cs b/SAM_Revit/SAM.Core.Revit/Classes/SAMSchema.cs index c1fb5df3..8746b975 100644 --- a/SAM_Revit/SAM.Core.Revit/Classes/SAMSchema.cs +++ b/SAM_Revit/SAM.Core.Revit/Classes/SAMSchema.cs @@ -1,5 +1,5 @@ using Autodesk.Revit.DB.ExtensibleStorage; -using Newtonsoft.Json.Linq; +using System.Text.Json.Nodes; using System; using System.Collections.Generic; using System.Linq; @@ -37,10 +37,10 @@ public SAMSchema(Guid guid, } - public SAMSchema(JObject jObject) + public SAMSchema(JsonObject jObject) : base(jObject) { - FromJObject(jObject); + FromJsonObject(jObject); } public string VendorId @@ -108,32 +108,32 @@ public virtual Schema GetSchema() return schemaBuilder.Finish(); } - public override bool FromJObject(JObject jObject) + public override bool FromJsonObject(JsonObject jObject) { - if (!base.FromJObject(jObject)) + if (!base.FromJsonObject(jObject)) return false; if (jObject.ContainsKey("VendorId")) - vendorId = jObject.Value("VendorId"); + vendorId = jObject["VendorId"]?.GetValue() ?? null; if (jObject.ContainsKey("ReadAccessLevel")) - readAccessLevel = (AccessLevel)Enum.Parse(typeof(AccessLevel), jObject.Value("ReadAccessLevel")); + readAccessLevel = (AccessLevel)Enum.Parse(typeof(AccessLevel), jObject["ReadAccessLevel"]?.GetValue() ?? null); if (jObject.ContainsKey("WriteAccessLevel")) - writeAccessLevel = (AccessLevel)Enum.Parse(typeof(AccessLevel), jObject.Value("WriteAccessLevel")); + writeAccessLevel = (AccessLevel)Enum.Parse(typeof(AccessLevel), jObject["WriteAccessLevel"]?.GetValue() ?? null); if (jObject.ContainsKey("FieldName")) - fieldName = jObject.Value("FieldName"); + fieldName = jObject["FieldName"]?.GetValue() ?? null; if (jObject.ContainsKey("FieldDocumentation")) - fieldDocumentation = jObject.Value("FieldDocumentation"); + fieldDocumentation = jObject["FieldDocumentation"]?.GetValue() ?? null; return true; } - public override JObject ToJObject() + public override JsonObject ToJsonObject() { - JObject jObject = base.ToJObject(); + JsonObject jObject = base.ToJsonObject(); if (jObject == null) return jObject; @@ -170,7 +170,7 @@ public List GetIJSAMObjects(Autodesk.Revit.DB.Element element) where T : I if (string.IsNullOrWhiteSpace(json)) return null; - JArray jArray = Core.Query.JArray(json); + JsonArray jArray = JsonNode.Parse(json) as JsonArray; if (jArray == null) return null; @@ -191,11 +191,11 @@ public bool SetIJSAMObject(Autodesk.Revit.DB.Element element, IJSAMObject jSAMOb if (element == null || jSAMObject == null || string.IsNullOrEmpty(fieldName)) return false; - JObject jObject = jSAMObject.ToJObject(); + JsonObject jObject = jSAMObject.ToJsonObject(); if (jObject == null) return false; - return Modify.SetJObject(this, element, jObject); + return Modify.SetJsonObject(this, element, jObject); } public List SetIJSAMObjects(Autodesk.Revit.DB.Element element, IEnumerable jSAMObjects) @@ -204,7 +204,7 @@ public List SetIJSAMObjects(Autodesk.Revit.DB.Element element, IEnumerable return null; List result = new List(); - JArray jArray = new JArray(); + JsonArray jArray = new JsonArray(); foreach(IJSAMObject iJSAMObject in jSAMObjects) { if (iJSAMObject == null) @@ -213,7 +213,7 @@ public List SetIJSAMObjects(Autodesk.Revit.DB.Element element, IEnumerable continue; } - JObject jObject = iJSAMObject.ToJObject(); + JsonObject jObject = iJSAMObject.ToJsonObject(); if (jObject == null) { result.Add(false); @@ -224,7 +224,7 @@ public List SetIJSAMObjects(Autodesk.Revit.DB.Element element, IEnumerable result.Add(true); } - if (!Modify.SetJArray(this, element, jArray)) + if (!Modify.SetJsonArray(this, element, jArray)) return new List(); return result; @@ -301,4 +301,4 @@ public bool Clear(Autodesk.Revit.DB.Element element) return true; } } -} \ No newline at end of file +} diff --git a/SAM_Revit/SAM.Core.Revit/Classes/ViewSpecificRevitInstance.cs b/SAM_Revit/SAM.Core.Revit/Classes/ViewSpecificRevitInstance.cs index b8a10220..e5c3f2b9 100644 --- a/SAM_Revit/SAM.Core.Revit/Classes/ViewSpecificRevitInstance.cs +++ b/SAM_Revit/SAM.Core.Revit/Classes/ViewSpecificRevitInstance.cs @@ -1,5 +1,4 @@ -using Newtonsoft.Json.Linq; - +using System.Text.Json.Nodes; namespace SAM.Core.Revit { public class ViewSpecificRevitInstance: RevitInstance where T: RevitType @@ -18,34 +17,34 @@ public ViewSpecificRevitInstance(T revitType, LongId viewId) this.viewId = viewId == null ? null : new LongId(viewId); } - public ViewSpecificRevitInstance(JObject jObject) + public ViewSpecificRevitInstance(JsonObject jObject) : base(jObject) { } - public override bool FromJObject(JObject jObject) + public override bool FromJsonObject(JsonObject jObject) { - if (!base.FromJObject(jObject)) + if (!base.FromJsonObject(jObject)) return false; if (jObject.ContainsKey("ViewId")) { - viewId = new LongId(jObject.Value("ViewId")); + viewId = new LongId(jObject["ViewId"] as JsonObject); } return true; } - public override JObject ToJObject() + public override JsonObject ToJsonObject() { - JObject result = base.ToJObject(); + JsonObject result = base.ToJsonObject(); if (result == null) return result; if (viewId != null) { - result.Add("ViewId", viewId.ToJObject()); + result.Add("ViewId", viewId.ToJsonObject()); } return result; diff --git a/SAM_Revit/SAM.Core.Revit/Modify/SetJArray.cs b/SAM_Revit/SAM.Core.Revit/Modify/SetJArray.cs index fc3c8b90..e6b54c5d 100644 --- a/SAM_Revit/SAM.Core.Revit/Modify/SetJArray.cs +++ b/SAM_Revit/SAM.Core.Revit/Modify/SetJArray.cs @@ -1,12 +1,11 @@ using Autodesk.Revit.DB; using Autodesk.Revit.DB.ExtensibleStorage; -using Newtonsoft.Json.Linq; - +using System.Text.Json.Nodes; namespace SAM.Core.Revit { public static partial class Modify { - public static bool SetJArray(this SAMSchema sAMSchema, Element element, JArray jArray) + public static bool SetJsonArray(this SAMSchema sAMSchema, Element element, JsonArray jArray) { if (sAMSchema == null || element == null || jArray == null) return false; @@ -15,10 +14,10 @@ public static bool SetJArray(this SAMSchema sAMSchema, Element element, JArray j if (string.IsNullOrWhiteSpace(fieldName)) return false; - return SetJArray(sAMSchema.GetSchema(), element, jArray, fieldName); + return SetJsonArray(sAMSchema.GetSchema(), element, jArray, fieldName); } - public static bool SetJArray(this Schema schema, Element element, JArray jArray, string fieldName) + public static bool SetJsonArray(this Schema schema, Element element, JsonArray jArray, string fieldName) { if (schema == null || element == null || jArray == null) return false; @@ -36,4 +35,4 @@ public static bool SetJArray(this Schema schema, Element element, JArray jArray, return true; } } -} \ No newline at end of file +} diff --git a/SAM_Revit/SAM.Core.Revit/Modify/SetJObject.cs b/SAM_Revit/SAM.Core.Revit/Modify/SetJObject.cs index 3e8eecd9..b1f8c2f3 100644 --- a/SAM_Revit/SAM.Core.Revit/Modify/SetJObject.cs +++ b/SAM_Revit/SAM.Core.Revit/Modify/SetJObject.cs @@ -1,12 +1,11 @@ using Autodesk.Revit.DB; using Autodesk.Revit.DB.ExtensibleStorage; -using Newtonsoft.Json.Linq; - +using System.Text.Json.Nodes; namespace SAM.Core.Revit { public static partial class Modify { - public static bool SetJObject(this SAMSchema sAMSchema, Element element, JObject jObject) + public static bool SetJsonObject(this SAMSchema sAMSchema, Element element, JsonObject jObject) { if (sAMSchema == null || element == null || jObject == null) return false; @@ -15,10 +14,10 @@ public static bool SetJObject(this SAMSchema sAMSchema, Element element, JObject if (string.IsNullOrWhiteSpace(fieldName)) return false; - return SetJObject(sAMSchema.GetSchema(), element, jObject, fieldName); + return SetJsonObject(sAMSchema.GetSchema(), element, jObject, fieldName); } - public static bool SetJObject(this Schema schema, Element element, JObject jObject, string fieldName) + public static bool SetJsonObject(this Schema schema, Element element, JsonObject jObject, string fieldName) { if (schema == null || element == null || jObject == null) return false; @@ -36,4 +35,4 @@ public static bool SetJObject(this Schema schema, Element element, JObject jObje return true; } } -} \ No newline at end of file +} diff --git a/SAM_Revit/SAM.Core.Revit/Modify/SetValue.cs b/SAM_Revit/SAM.Core.Revit/Modify/SetValue.cs index 9e99f899..a8ac1a5b 100644 --- a/SAM_Revit/SAM.Core.Revit/Modify/SetValue.cs +++ b/SAM_Revit/SAM.Core.Revit/Modify/SetValue.cs @@ -46,7 +46,7 @@ private static bool SetValue_String(this Parameter parameter, object value) } else if(value is IJSAMObject) { - parameter.Set(((IJSAMObject)value).ToJObject()?.ToString()); + parameter.Set(((IJSAMObject)value).ToJsonObject()?.ToString()); } else { diff --git a/SAM_Revit/SAM.Core.Revit/Query/IJSAMObject.cs b/SAM_Revit/SAM.Core.Revit/Query/IJSAMObject.cs index a5bfa879..93be9570 100644 --- a/SAM_Revit/SAM.Core.Revit/Query/IJSAMObject.cs +++ b/SAM_Revit/SAM.Core.Revit/Query/IJSAMObject.cs @@ -1,5 +1,5 @@ using Autodesk.Revit.DB; -using Newtonsoft.Json.Linq; +using System.Text.Json.Nodes; using System.Collections.Generic; namespace SAM.Core.Revit @@ -11,25 +11,25 @@ public static List IJSAMObjects(this Element element) where T : IJSAMObjec if (element == null) return default; - JToken jToken = element.JToken(); + JsonNode jToken = element.JsonNode(); if (jToken == null) return default; - switch(jToken.Type) + switch(jToken.GetValueKind()) { - case JTokenType.Object: - T t = Core.Create.IJSAMObject(jToken as JObject); + case System.Text.Json.JsonValueKind.Object: + T t = Core.Create.IJSAMObject(jToken as JsonObject); if(t != null) { return new List() { t }; } break; - case JTokenType.Array: - return Core.Create.IJSAMObjects(jToken as JArray); + case System.Text.Json.JsonValueKind.Array: + return Core.Create.IJSAMObjects(jToken as JsonArray); } return null; } } -} \ No newline at end of file +} diff --git a/SAM_Revit/SAM.Core.Revit/Query/JObject.cs b/SAM_Revit/SAM.Core.Revit/Query/JObject.cs index d6ac9122..4348b4a6 100644 --- a/SAM_Revit/SAM.Core.Revit/Query/JObject.cs +++ b/SAM_Revit/SAM.Core.Revit/Query/JObject.cs @@ -1,11 +1,10 @@ using Autodesk.Revit.DB; -using Newtonsoft.Json.Linq; - +using System.Text.Json.Nodes; namespace SAM.Core.Revit { public static partial class Query { - public static JToken JToken(this Element element) + public static JsonNode JsonNode(this Element element) { if (element == null) return null; @@ -14,7 +13,7 @@ public static JToken JToken(this Element element) if (string.IsNullOrWhiteSpace(json)) return null; - return Newtonsoft.Json.Linq.JToken.Parse(json); + return System.Text.Json.Nodes.JsonNode.Parse(json); } } -} \ No newline at end of file +} diff --git a/SAM_Revit/SAM.Core.Revit/SAM.Core.Revit.csproj b/SAM_Revit/SAM.Core.Revit/SAM.Core.Revit.csproj index e69eae70..a8b12ce2 100644 --- a/SAM_Revit/SAM.Core.Revit/SAM.Core.Revit.csproj +++ b/SAM_Revit/SAM.Core.Revit/SAM.Core.Revit.csproj @@ -245,8 +245,9 @@ + - \ No newline at end of file + diff --git a/SAM_Revit/SAM.Geometry.Revit/Classes/FilledRegion.cs b/SAM_Revit/SAM.Geometry.Revit/Classes/FilledRegion.cs index 45347e46..0a97e090 100644 --- a/SAM_Revit/SAM.Geometry.Revit/Classes/FilledRegion.cs +++ b/SAM_Revit/SAM.Geometry.Revit/Classes/FilledRegion.cs @@ -1,4 +1,4 @@ -using Newtonsoft.Json.Linq; +using System.Text.Json.Nodes; using SAM.Core; using SAM.Geometry.Object.Planar; using SAM.Geometry.Planar; @@ -23,7 +23,7 @@ public FilledRegion(FilledRegion filledRegion) { } - public FilledRegion(JObject jObject) + public FilledRegion(JsonObject jObject) : base(jObject) { } @@ -51,24 +51,24 @@ public BoundingBox2D GetBoundingBox(double offset = 0) return new BoundingBox2D(boundingBox2Ds); } - public override bool FromJObject(JObject jObject) + public override bool FromJsonObject(JsonObject jObject) { - if(!base.FromJObject(jObject)) + if(!base.FromJsonObject(jObject)) { return false; } if(jObject.ContainsKey("Face2Ds")) { - face2Ds = Create.ISAMGeometries(jObject.Value("Face2Ds")); + face2Ds = Create.ISAMGeometries(jObject["Face2Ds"] as JsonArray); } return true; } - public override JObject ToJObject() + public override JsonObject ToJsonObject() { - JObject result = base.ToJObject(); + JsonObject result = base.ToJsonObject(); if(result == null) { return result; @@ -76,7 +76,12 @@ public override JObject ToJObject() if(face2Ds != null) { - result.Add("Face2Ds", Create.JArray(face2Ds)); + JsonArray jArray = new JsonArray(); + foreach(Face2D face2D in face2Ds) + { + jArray.Add(face2D?.ToJsonObject()); + } + result.Add("Face2Ds", jArray); } return result; diff --git a/SAM_Revit/SAM.Geometry.Revit/Classes/FilledRegionType.cs b/SAM_Revit/SAM.Geometry.Revit/Classes/FilledRegionType.cs index 68681f5a..8ad917a3 100644 --- a/SAM_Revit/SAM.Geometry.Revit/Classes/FilledRegionType.cs +++ b/SAM_Revit/SAM.Geometry.Revit/Classes/FilledRegionType.cs @@ -1,5 +1,4 @@ -using Newtonsoft.Json.Linq; - +using System.Text.Json.Nodes; namespace SAM.Geometry.Revit { public class FilledRegionType : Core.Revit.RevitType @@ -9,7 +8,7 @@ public FilledRegionType(FilledRegionType filledRegionType) { } - public FilledRegionType(JObject jObject) + public FilledRegionType(JsonObject jObject) : base(jObject) { } diff --git a/SAM_Revit/SAM.Geometry.Revit/Classes/RevitInstance2D.cs b/SAM_Revit/SAM.Geometry.Revit/Classes/RevitInstance2D.cs index c6a6a274..107f4120 100644 --- a/SAM_Revit/SAM.Geometry.Revit/Classes/RevitInstance2D.cs +++ b/SAM_Revit/SAM.Geometry.Revit/Classes/RevitInstance2D.cs @@ -1,4 +1,4 @@ -using Newtonsoft.Json.Linq; +using System.Text.Json.Nodes; using SAM.Core.Revit; using SAM.Geometry.Object.Planar; using SAM.Geometry.Planar; @@ -16,7 +16,7 @@ public RevitInstance2D(RevitInstance2D revitInstance2D) } - public RevitInstance2D(JObject jObject) + public RevitInstance2D(JsonObject jObject) : base(jObject) { @@ -35,17 +35,17 @@ public RevitInstance2D(RevitType2D revitType2D, IEnumerable geom } } - public override bool FromJObject(JObject jObject) + public override bool FromJsonObject(JsonObject jObject) { - if (!base.FromJObject(jObject)) + if (!base.FromJsonObject(jObject)) return false; return true; } - public override JObject ToJObject() + public override JsonObject ToJsonObject() { - JObject jObject = base.ToJObject(); + JsonObject jObject = base.ToJsonObject(); if (jObject == null) return jObject; diff --git a/SAM_Revit/SAM.Geometry.Revit/Classes/RevitInstance3D.cs b/SAM_Revit/SAM.Geometry.Revit/Classes/RevitInstance3D.cs index 3b4ae640..726c068e 100644 --- a/SAM_Revit/SAM.Geometry.Revit/Classes/RevitInstance3D.cs +++ b/SAM_Revit/SAM.Geometry.Revit/Classes/RevitInstance3D.cs @@ -1,4 +1,4 @@ -using Newtonsoft.Json.Linq; +using System.Text.Json.Nodes; using SAM.Core.Revit; using SAM.Geometry.Object.Spatial; using SAM.Geometry.Spatial; @@ -16,7 +16,7 @@ public RevitInstance3D(RevitInstance3D revitInstance3D) } - public RevitInstance3D(JObject jObject) + public RevitInstance3D(JsonObject jObject) : base(jObject) { @@ -43,9 +43,9 @@ public List Geometries } } - public override bool FromJObject(JObject jObject) + public override bool FromJsonObject(JsonObject jObject) { - if (!base.FromJObject(jObject)) + if (!base.FromJsonObject(jObject)) return false; return true; @@ -61,9 +61,9 @@ public void Move(Vector3D vector3D) geometries = geometries?.ConvertAll(x => x.GetMoved(vector3D)); } - public override JObject ToJObject() + public override JsonObject ToJsonObject() { - JObject jObject = base.ToJObject(); + JsonObject jObject = base.ToJsonObject(); if (jObject == null) return jObject; diff --git a/SAM_Revit/SAM.Geometry.Revit/Classes/RevitType2D.cs b/SAM_Revit/SAM.Geometry.Revit/Classes/RevitType2D.cs index 0428c1b6..044edaf5 100644 --- a/SAM_Revit/SAM.Geometry.Revit/Classes/RevitType2D.cs +++ b/SAM_Revit/SAM.Geometry.Revit/Classes/RevitType2D.cs @@ -1,4 +1,4 @@ -using Newtonsoft.Json.Linq; +using System.Text.Json.Nodes; using SAM.Core.Revit; namespace SAM.Geometry.Revit @@ -17,23 +17,23 @@ public RevitType2D(string name) } - public RevitType2D(JObject jObject) + public RevitType2D(JsonObject jObject) : base(jObject) { } - public override bool FromJObject(JObject jObject) + public override bool FromJsonObject(JsonObject jObject) { - if (!base.FromJObject(jObject)) + if (!base.FromJsonObject(jObject)) return false; return true; } - public override JObject ToJObject() + public override JsonObject ToJsonObject() { - JObject jObject = base.ToJObject(); + JsonObject jObject = base.ToJsonObject(); if (jObject == null) return jObject; diff --git a/SAM_Revit/SAM.Geometry.Revit/Classes/RevitType3D.cs b/SAM_Revit/SAM.Geometry.Revit/Classes/RevitType3D.cs index df8667e2..8751e308 100644 --- a/SAM_Revit/SAM.Geometry.Revit/Classes/RevitType3D.cs +++ b/SAM_Revit/SAM.Geometry.Revit/Classes/RevitType3D.cs @@ -1,4 +1,4 @@ -using Newtonsoft.Json.Linq; +using System.Text.Json.Nodes; using SAM.Core.Revit; namespace SAM.Geometry.Revit @@ -17,23 +17,23 @@ public RevitType3D(string name) } - public RevitType3D(JObject jObject) + public RevitType3D(JsonObject jObject) : base(jObject) { } - public override bool FromJObject(JObject jObject) + public override bool FromJsonObject(JsonObject jObject) { - if (!base.FromJObject(jObject)) + if (!base.FromJsonObject(jObject)) return false; return true; } - public override JObject ToJObject() + public override JsonObject ToJsonObject() { - JObject jObject = base.ToJObject(); + JsonObject jObject = base.ToJsonObject(); if (jObject == null) return jObject; diff --git a/SAM_Revit/SAM.Geometry.Revit/Classes/Tag.cs b/SAM_Revit/SAM.Geometry.Revit/Classes/Tag.cs index ff58504c..6cf61628 100644 --- a/SAM_Revit/SAM.Geometry.Revit/Classes/Tag.cs +++ b/SAM_Revit/SAM.Geometry.Revit/Classes/Tag.cs @@ -1,4 +1,4 @@ -using Newtonsoft.Json.Linq; +using System.Text.Json.Nodes; using SAM.Core; using SAM.Core.Revit; @@ -16,7 +16,7 @@ public Tag(Tag tag) { } - public Tag(JObject jObject) + public Tag(JsonObject jObject) : base(jObject) { @@ -38,39 +38,39 @@ public Tag(TagType tagType, LongId viewId, Planar.Point2D location, Planar.Point this.end = end == null ? null : new Planar.Point2D(end); } - public override bool FromJObject(JObject jObject) + public override bool FromJsonObject(JsonObject jObject) { - if(!base.FromJObject(jObject)) + if(!base.FromJsonObject(jObject)) { return false; } if (jObject.ContainsKey("Location")) { - location = new Planar.Point2D(jObject.Value("Location")); + location = new Planar.Point2D(jObject["Location"] as JsonObject); } if (jObject.ContainsKey("Elbow")) { - elbow = new Planar.Point2D(jObject.Value("Elbow")); + elbow = new Planar.Point2D(jObject["Elbow"] as JsonObject); } if (jObject.ContainsKey("End")) { - end = new Planar.Point2D(jObject.Value("End")); + end = new Planar.Point2D(jObject["End"] as JsonObject); } if (jObject.ContainsKey("ReferenceId")) { - referenceId = new LongId(jObject.Value("ReferenceId")); + referenceId = new LongId(jObject["ReferenceId"] as JsonObject); } return true; } - public override JObject ToJObject() + public override JsonObject ToJsonObject() { - JObject result = base.ToJObject(); + JsonObject result = base.ToJsonObject(); if(result == null) { return null; @@ -78,22 +78,22 @@ public override JObject ToJObject() if(location != null) { - result.Add("Location", location.ToJObject()); + result.Add("Location", location.ToJsonObject()); } if (elbow != null) { - result.Add("Elbow", elbow.ToJObject()); + result.Add("Elbow", elbow.ToJsonObject()); } if (end != null) { - result.Add("End", end.ToJObject()); + result.Add("End", end.ToJsonObject()); } if (referenceId != null) { - result.Add("ReferenceId", referenceId.ToJObject()); + result.Add("ReferenceId", referenceId.ToJsonObject()); } return result; diff --git a/SAM_Revit/SAM.Geometry.Revit/Classes/TagType.cs b/SAM_Revit/SAM.Geometry.Revit/Classes/TagType.cs index ef719769..a4e423c0 100644 --- a/SAM_Revit/SAM.Geometry.Revit/Classes/TagType.cs +++ b/SAM_Revit/SAM.Geometry.Revit/Classes/TagType.cs @@ -1,4 +1,4 @@ -using Newtonsoft.Json.Linq; +using System.Text.Json.Nodes; using SAM.Core.Revit; namespace SAM.Geometry.Revit @@ -10,7 +10,7 @@ public TagType(TagType tagType) { } - public TagType(JObject jObject) + public TagType(JsonObject jObject) : base(jObject) { } diff --git a/SAM_Revit/SAM.Geometry.Revit/SAM.Geometry.Revit.csproj b/SAM_Revit/SAM.Geometry.Revit/SAM.Geometry.Revit.csproj index 0313fcf4..2ffa0fdc 100644 --- a/SAM_Revit/SAM.Geometry.Revit/SAM.Geometry.Revit.csproj +++ b/SAM_Revit/SAM.Geometry.Revit/SAM.Geometry.Revit.csproj @@ -253,5 +253,6 @@ + - \ No newline at end of file + diff --git a/SAM_Revit/SAM.Units.Revit/SAM.Units.Revit.csproj b/SAM_Revit/SAM.Units.Revit/SAM.Units.Revit.csproj index f16e6211..00f95f42 100644 --- a/SAM_Revit/SAM.Units.Revit/SAM.Units.Revit.csproj +++ b/SAM_Revit/SAM.Units.Revit/SAM.Units.Revit.csproj @@ -180,6 +180,7 @@ + @@ -267,4 +268,4 @@ False - \ No newline at end of file + From f6a1792ba558b4c693440bff3710c9b3849c4507 Mon Sep 17 00:00:00 2001 From: Michal Dengusiak Date: Fri, 15 May 2026 22:01:06 +0200 Subject: [PATCH 02/12] CI: prefer sow/2026-Q2 for dep clones + trigger on it During the SAM-BIM Newtonsoft.Json -> System.Text.Json migration the quarterly sow/2026-Q2 branch carries the binary-breaking change. CI needs to consume the migrated SAM (and any sibling dep) from sow/2026-Q2, not from master, until the quarter-end merge. - Add "sow/2026-Q2" to push/pull_request branch triggers - For each dep clone, ls-remote sow/2026-Q2 and prefer it when present; fall back to default branch (e.g. master) otherwise. After the quarter merges back to master, this fallback naturally restores prior behaviour. Co-Authored-By: Claude Opus 4.7 --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8c423742..048f02f4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,9 +2,9 @@ name: Build (Windows) - SAM_Revit (2025/2026) on: push: - branches: [ "master", "main" ] + branches: [ "master", "main", "sow/2026-Q2" ] pull_request: - branches: [ "master", "main" ] + branches: [ "master", "main", "sow/2026-Q2" ] workflow_dispatch: jobs: From 1aa6e375bc08336440f0ee410116e27b1995231a Mon Sep 17 00:00:00 2001 From: Michal Dengusiak Date: Fri, 15 May 2026 22:05:47 +0200 Subject: [PATCH 03/12] CI: cascade dep clones to PR head_ref -> sow/2026-Q2 -> default Refines the previous workflow patch so CI on the migration PR can succeed before anything has been merged. Each dep repo is cloned from: 1. github.head_ref (feature/remove-newtonsoft on these PRs) - has the migration right now on every dep 2. sow/2026-Q2 - source of truth after these PRs merge 3. default branch - source of truth after quarter-end merge Co-Authored-By: Claude Opus 4.7 --- .github/workflows/build.yml | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 048f02f4..80d72daf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -85,7 +85,28 @@ jobs: 'SAM_Revit_UI' ) - foreach ($r in $deps) { Clone-Repo $r } + foreach ($r in $deps) { + if (Test-Path $r) { continue } + $headRef = '${{ github.head_ref }}' + $candidates = @() + if ($headRef) { $candidates += $headRef } + $candidates += 'sow/2026-Q2' + $cloned = $false + foreach ($cand in $candidates) { + $has = (git ls-remote --heads "https://github.com/$org/$r.git" $cand 2>$null | Out-String).Trim() + if ($has) { + Write-Host "Cloning $org/$r @ $cand" + git clone --depth 1 --branch $cand "https://github.com/$org/$r.git" $r + $cloned = $true + break + } + } + if (-not $cloned) { + Write-Host "Cloning $org/$r @ default branch" + git clone --depth 1 "https://github.com/$org/$r.git" $r + } + } + # Ensure build folders exist (some projects expect these paths) New-Item -ItemType Directory -Force -Path "SAM_Windows\build" | Out-Null From ef850e58ea0e3b50d2f3eb3263b9d2f7a62150c9 Mon Sep 17 00:00:00 2001 From: Michal Dengusiak Date: Fri, 15 May 2026 22:39:30 +0200 Subject: [PATCH 04/12] Add SPDX + copyright header to migration-touched files The SPDX-check workflow requires the top 6 lines of every changed .cs file to contain both: // SPDX-License-Identifier: LGPL-3.0-or-later // Copyright (c) 2020-2026 Michal Dengusiak & Jakub Ziolkowski and contributors (with an en-dash between the years). Migration commits modified existing files without preserving the header. Prepend the two lines now. Co-Authored-By: Claude Opus 4.7 --- .../SAM.Core.Grasshopper.Revit/Classes/GooConvertSettings.cs | 4 +++- .../SAM.Analytical.Revit/Convert/ToRevit/FamilyInstance.cs | 4 +++- SAM_Revit/SAM.Analytical.Revit/Convert/ToRevit/HostObject.cs | 4 +++- SAM_Revit/SAM.Analytical.Revit/Convert/ToRevit/Space.cs | 4 +++- SAM_Revit/SAM.Architectural.Revit/Convert/ToRevit/Level.cs | 4 +++- SAM_Revit/SAM.Core.Revit/Classes/ConvertSettings.cs | 4 +++- SAM_Revit/SAM.Core.Revit/Classes/DesignOption.cs | 4 +++- SAM_Revit/SAM.Core.Revit/Classes/ElementBindingData.cs | 4 +++- SAM_Revit/SAM.Core.Revit/Classes/RevitInstance.cs | 4 +++- SAM_Revit/SAM.Core.Revit/Classes/RevitType.cs | 4 +++- SAM_Revit/SAM.Core.Revit/Classes/SAMSchema.cs | 4 +++- SAM_Revit/SAM.Core.Revit/Classes/ViewSpecificRevitInstance.cs | 4 +++- SAM_Revit/SAM.Core.Revit/Modify/SetJArray.cs | 4 +++- SAM_Revit/SAM.Core.Revit/Modify/SetJObject.cs | 4 +++- SAM_Revit/SAM.Core.Revit/Modify/SetValue.cs | 4 +++- SAM_Revit/SAM.Core.Revit/Query/IJSAMObject.cs | 4 +++- SAM_Revit/SAM.Core.Revit/Query/JObject.cs | 4 +++- SAM_Revit/SAM.Geometry.Revit/Classes/FilledRegion.cs | 4 +++- SAM_Revit/SAM.Geometry.Revit/Classes/FilledRegionType.cs | 4 +++- SAM_Revit/SAM.Geometry.Revit/Classes/RevitInstance2D.cs | 4 +++- SAM_Revit/SAM.Geometry.Revit/Classes/RevitInstance3D.cs | 4 +++- SAM_Revit/SAM.Geometry.Revit/Classes/RevitType2D.cs | 4 +++- SAM_Revit/SAM.Geometry.Revit/Classes/RevitType3D.cs | 4 +++- SAM_Revit/SAM.Geometry.Revit/Classes/Tag.cs | 4 +++- SAM_Revit/SAM.Geometry.Revit/Classes/TagType.cs | 4 +++- 25 files changed, 75 insertions(+), 25 deletions(-) diff --git a/Grasshopper/SAM.Core.Grasshopper.Revit/Classes/GooConvertSettings.cs b/Grasshopper/SAM.Core.Grasshopper.Revit/Classes/GooConvertSettings.cs index 1d0ec8e7..1c7712d2 100644 --- a/Grasshopper/SAM.Core.Grasshopper.Revit/Classes/GooConvertSettings.cs +++ b/Grasshopper/SAM.Core.Grasshopper.Revit/Classes/GooConvertSettings.cs @@ -1,4 +1,6 @@ -using GH_IO.Serialization; +// SPDX-License-Identifier: LGPL-3.0-or-later +// Copyright (c) 2020–2026 Michal Dengusiak & Jakub Ziolkowski and contributors +using GH_IO.Serialization; using Grasshopper.Kernel; using Grasshopper.Kernel.Types; using SAM.Core.Grasshopper.Revit.Properties; diff --git a/SAM_Revit/SAM.Analytical.Revit/Convert/ToRevit/FamilyInstance.cs b/SAM_Revit/SAM.Analytical.Revit/Convert/ToRevit/FamilyInstance.cs index 167d3703..69308245 100644 --- a/SAM_Revit/SAM.Analytical.Revit/Convert/ToRevit/FamilyInstance.cs +++ b/SAM_Revit/SAM.Analytical.Revit/Convert/ToRevit/FamilyInstance.cs @@ -1,4 +1,6 @@ -using Autodesk.Revit.DB; +// SPDX-License-Identifier: LGPL-3.0-or-later +// Copyright (c) 2020–2026 Michal Dengusiak & Jakub Ziolkowski and contributors +using Autodesk.Revit.DB; using SAM.Geometry.Revit; using SAM.Geometry.Spatial; diff --git a/SAM_Revit/SAM.Analytical.Revit/Convert/ToRevit/HostObject.cs b/SAM_Revit/SAM.Analytical.Revit/Convert/ToRevit/HostObject.cs index a835afca..351ed3e4 100644 --- a/SAM_Revit/SAM.Analytical.Revit/Convert/ToRevit/HostObject.cs +++ b/SAM_Revit/SAM.Analytical.Revit/Convert/ToRevit/HostObject.cs @@ -1,4 +1,6 @@ -using Autodesk.Revit.DB; +// SPDX-License-Identifier: LGPL-3.0-or-later +// Copyright (c) 2020–2026 Michal Dengusiak & Jakub Ziolkowski and contributors +using Autodesk.Revit.DB; using SAM.Geometry.Revit; using System; using System.Collections.Generic; diff --git a/SAM_Revit/SAM.Analytical.Revit/Convert/ToRevit/Space.cs b/SAM_Revit/SAM.Analytical.Revit/Convert/ToRevit/Space.cs index 0d8077b3..6505f70e 100644 --- a/SAM_Revit/SAM.Analytical.Revit/Convert/ToRevit/Space.cs +++ b/SAM_Revit/SAM.Analytical.Revit/Convert/ToRevit/Space.cs @@ -1,4 +1,6 @@ -using Autodesk.Revit.DB; +// SPDX-License-Identifier: LGPL-3.0-or-later +// Copyright (c) 2020–2026 Michal Dengusiak & Jakub Ziolkowski and contributors +using Autodesk.Revit.DB; using SAM.Core.Revit; using System.Collections.Generic; diff --git a/SAM_Revit/SAM.Architectural.Revit/Convert/ToRevit/Level.cs b/SAM_Revit/SAM.Architectural.Revit/Convert/ToRevit/Level.cs index 7548593f..945abe50 100644 --- a/SAM_Revit/SAM.Architectural.Revit/Convert/ToRevit/Level.cs +++ b/SAM_Revit/SAM.Architectural.Revit/Convert/ToRevit/Level.cs @@ -1,4 +1,6 @@ -using Autodesk.Revit.DB; +// SPDX-License-Identifier: LGPL-3.0-or-later +// Copyright (c) 2020–2026 Michal Dengusiak & Jakub Ziolkowski and contributors +using Autodesk.Revit.DB; using SAM.Core.Revit; using System; using System.Collections.Generic; diff --git a/SAM_Revit/SAM.Core.Revit/Classes/ConvertSettings.cs b/SAM_Revit/SAM.Core.Revit/Classes/ConvertSettings.cs index b574307f..be6b4f22 100644 --- a/SAM_Revit/SAM.Core.Revit/Classes/ConvertSettings.cs +++ b/SAM_Revit/SAM.Core.Revit/Classes/ConvertSettings.cs @@ -1,4 +1,6 @@ -using Autodesk.Revit.DB; +// SPDX-License-Identifier: LGPL-3.0-or-later +// Copyright (c) 2020–2026 Michal Dengusiak & Jakub Ziolkowski and contributors +using Autodesk.Revit.DB; using System.Text.Json.Nodes; using System.Collections.Generic; using System.Linq; diff --git a/SAM_Revit/SAM.Core.Revit/Classes/DesignOption.cs b/SAM_Revit/SAM.Core.Revit/Classes/DesignOption.cs index 805bfa3a..8d952351 100644 --- a/SAM_Revit/SAM.Core.Revit/Classes/DesignOption.cs +++ b/SAM_Revit/SAM.Core.Revit/Classes/DesignOption.cs @@ -1,4 +1,6 @@ -using System.Text.Json.Nodes; +// SPDX-License-Identifier: LGPL-3.0-or-later +// Copyright (c) 2020–2026 Michal Dengusiak & Jakub Ziolkowski and contributors +using System.Text.Json.Nodes; namespace SAM.Core.Revit { public class DesignOption: SAMObject diff --git a/SAM_Revit/SAM.Core.Revit/Classes/ElementBindingData.cs b/SAM_Revit/SAM.Core.Revit/Classes/ElementBindingData.cs index 0544729a..7365ce97 100644 --- a/SAM_Revit/SAM.Core.Revit/Classes/ElementBindingData.cs +++ b/SAM_Revit/SAM.Core.Revit/Classes/ElementBindingData.cs @@ -1,4 +1,6 @@ -using Autodesk.Revit.DB; +// SPDX-License-Identifier: LGPL-3.0-or-later +// Copyright (c) 2020–2026 Michal Dengusiak & Jakub Ziolkowski and contributors +using Autodesk.Revit.DB; using System.Text.Json.Nodes; using System; using System.Collections.Generic; diff --git a/SAM_Revit/SAM.Core.Revit/Classes/RevitInstance.cs b/SAM_Revit/SAM.Core.Revit/Classes/RevitInstance.cs index cd3b515a..11b8a7a0 100644 --- a/SAM_Revit/SAM.Core.Revit/Classes/RevitInstance.cs +++ b/SAM_Revit/SAM.Core.Revit/Classes/RevitInstance.cs @@ -1,4 +1,6 @@ -using System.Text.Json.Nodes; +// SPDX-License-Identifier: LGPL-3.0-or-later +// Copyright (c) 2020–2026 Michal Dengusiak & Jakub Ziolkowski and contributors +using System.Text.Json.Nodes; namespace SAM.Core.Revit { public class RevitInstance: SAMInstance where T: RevitType diff --git a/SAM_Revit/SAM.Core.Revit/Classes/RevitType.cs b/SAM_Revit/SAM.Core.Revit/Classes/RevitType.cs index 4cd3b968..bcb55638 100644 --- a/SAM_Revit/SAM.Core.Revit/Classes/RevitType.cs +++ b/SAM_Revit/SAM.Core.Revit/Classes/RevitType.cs @@ -1,4 +1,6 @@ -using System.Text.Json.Nodes; +// SPDX-License-Identifier: LGPL-3.0-or-later +// Copyright (c) 2020–2026 Michal Dengusiak & Jakub Ziolkowski and contributors +using System.Text.Json.Nodes; namespace SAM.Core.Revit { public class RevitType: SAMType diff --git a/SAM_Revit/SAM.Core.Revit/Classes/SAMSchema.cs b/SAM_Revit/SAM.Core.Revit/Classes/SAMSchema.cs index 8746b975..a3ce22ee 100644 --- a/SAM_Revit/SAM.Core.Revit/Classes/SAMSchema.cs +++ b/SAM_Revit/SAM.Core.Revit/Classes/SAMSchema.cs @@ -1,4 +1,6 @@ -using Autodesk.Revit.DB.ExtensibleStorage; +// SPDX-License-Identifier: LGPL-3.0-or-later +// Copyright (c) 2020–2026 Michal Dengusiak & Jakub Ziolkowski and contributors +using Autodesk.Revit.DB.ExtensibleStorage; using System.Text.Json.Nodes; using System; using System.Collections.Generic; diff --git a/SAM_Revit/SAM.Core.Revit/Classes/ViewSpecificRevitInstance.cs b/SAM_Revit/SAM.Core.Revit/Classes/ViewSpecificRevitInstance.cs index e5c3f2b9..a6964a08 100644 --- a/SAM_Revit/SAM.Core.Revit/Classes/ViewSpecificRevitInstance.cs +++ b/SAM_Revit/SAM.Core.Revit/Classes/ViewSpecificRevitInstance.cs @@ -1,4 +1,6 @@ -using System.Text.Json.Nodes; +// SPDX-License-Identifier: LGPL-3.0-or-later +// Copyright (c) 2020–2026 Michal Dengusiak & Jakub Ziolkowski and contributors +using System.Text.Json.Nodes; namespace SAM.Core.Revit { public class ViewSpecificRevitInstance: RevitInstance where T: RevitType diff --git a/SAM_Revit/SAM.Core.Revit/Modify/SetJArray.cs b/SAM_Revit/SAM.Core.Revit/Modify/SetJArray.cs index e6b54c5d..785a2c9f 100644 --- a/SAM_Revit/SAM.Core.Revit/Modify/SetJArray.cs +++ b/SAM_Revit/SAM.Core.Revit/Modify/SetJArray.cs @@ -1,4 +1,6 @@ -using Autodesk.Revit.DB; +// SPDX-License-Identifier: LGPL-3.0-or-later +// Copyright (c) 2020–2026 Michal Dengusiak & Jakub Ziolkowski and contributors +using Autodesk.Revit.DB; using Autodesk.Revit.DB.ExtensibleStorage; using System.Text.Json.Nodes; namespace SAM.Core.Revit diff --git a/SAM_Revit/SAM.Core.Revit/Modify/SetJObject.cs b/SAM_Revit/SAM.Core.Revit/Modify/SetJObject.cs index b1f8c2f3..6f533750 100644 --- a/SAM_Revit/SAM.Core.Revit/Modify/SetJObject.cs +++ b/SAM_Revit/SAM.Core.Revit/Modify/SetJObject.cs @@ -1,4 +1,6 @@ -using Autodesk.Revit.DB; +// SPDX-License-Identifier: LGPL-3.0-or-later +// Copyright (c) 2020–2026 Michal Dengusiak & Jakub Ziolkowski and contributors +using Autodesk.Revit.DB; using Autodesk.Revit.DB.ExtensibleStorage; using System.Text.Json.Nodes; namespace SAM.Core.Revit diff --git a/SAM_Revit/SAM.Core.Revit/Modify/SetValue.cs b/SAM_Revit/SAM.Core.Revit/Modify/SetValue.cs index a8ac1a5b..f43f6819 100644 --- a/SAM_Revit/SAM.Core.Revit/Modify/SetValue.cs +++ b/SAM_Revit/SAM.Core.Revit/Modify/SetValue.cs @@ -1,4 +1,6 @@ -using Autodesk.Revit.DB; +// SPDX-License-Identifier: LGPL-3.0-or-later +// Copyright (c) 2020–2026 Michal Dengusiak & Jakub Ziolkowski and contributors +using Autodesk.Revit.DB; namespace SAM.Core.Revit { diff --git a/SAM_Revit/SAM.Core.Revit/Query/IJSAMObject.cs b/SAM_Revit/SAM.Core.Revit/Query/IJSAMObject.cs index 93be9570..bdf30f68 100644 --- a/SAM_Revit/SAM.Core.Revit/Query/IJSAMObject.cs +++ b/SAM_Revit/SAM.Core.Revit/Query/IJSAMObject.cs @@ -1,4 +1,6 @@ -using Autodesk.Revit.DB; +// SPDX-License-Identifier: LGPL-3.0-or-later +// Copyright (c) 2020–2026 Michal Dengusiak & Jakub Ziolkowski and contributors +using Autodesk.Revit.DB; using System.Text.Json.Nodes; using System.Collections.Generic; diff --git a/SAM_Revit/SAM.Core.Revit/Query/JObject.cs b/SAM_Revit/SAM.Core.Revit/Query/JObject.cs index 4348b4a6..cbfe035d 100644 --- a/SAM_Revit/SAM.Core.Revit/Query/JObject.cs +++ b/SAM_Revit/SAM.Core.Revit/Query/JObject.cs @@ -1,4 +1,6 @@ -using Autodesk.Revit.DB; +// SPDX-License-Identifier: LGPL-3.0-or-later +// Copyright (c) 2020–2026 Michal Dengusiak & Jakub Ziolkowski and contributors +using Autodesk.Revit.DB; using System.Text.Json.Nodes; namespace SAM.Core.Revit { diff --git a/SAM_Revit/SAM.Geometry.Revit/Classes/FilledRegion.cs b/SAM_Revit/SAM.Geometry.Revit/Classes/FilledRegion.cs index 0a97e090..321408ec 100644 --- a/SAM_Revit/SAM.Geometry.Revit/Classes/FilledRegion.cs +++ b/SAM_Revit/SAM.Geometry.Revit/Classes/FilledRegion.cs @@ -1,4 +1,6 @@ -using System.Text.Json.Nodes; +// SPDX-License-Identifier: LGPL-3.0-or-later +// Copyright (c) 2020–2026 Michal Dengusiak & Jakub Ziolkowski and contributors +using System.Text.Json.Nodes; using SAM.Core; using SAM.Geometry.Object.Planar; using SAM.Geometry.Planar; diff --git a/SAM_Revit/SAM.Geometry.Revit/Classes/FilledRegionType.cs b/SAM_Revit/SAM.Geometry.Revit/Classes/FilledRegionType.cs index 8ad917a3..bd0c5dea 100644 --- a/SAM_Revit/SAM.Geometry.Revit/Classes/FilledRegionType.cs +++ b/SAM_Revit/SAM.Geometry.Revit/Classes/FilledRegionType.cs @@ -1,4 +1,6 @@ -using System.Text.Json.Nodes; +// SPDX-License-Identifier: LGPL-3.0-or-later +// Copyright (c) 2020–2026 Michal Dengusiak & Jakub Ziolkowski and contributors +using System.Text.Json.Nodes; namespace SAM.Geometry.Revit { public class FilledRegionType : Core.Revit.RevitType diff --git a/SAM_Revit/SAM.Geometry.Revit/Classes/RevitInstance2D.cs b/SAM_Revit/SAM.Geometry.Revit/Classes/RevitInstance2D.cs index 107f4120..68bb0d52 100644 --- a/SAM_Revit/SAM.Geometry.Revit/Classes/RevitInstance2D.cs +++ b/SAM_Revit/SAM.Geometry.Revit/Classes/RevitInstance2D.cs @@ -1,4 +1,6 @@ -using System.Text.Json.Nodes; +// SPDX-License-Identifier: LGPL-3.0-or-later +// Copyright (c) 2020–2026 Michal Dengusiak & Jakub Ziolkowski and contributors +using System.Text.Json.Nodes; using SAM.Core.Revit; using SAM.Geometry.Object.Planar; using SAM.Geometry.Planar; diff --git a/SAM_Revit/SAM.Geometry.Revit/Classes/RevitInstance3D.cs b/SAM_Revit/SAM.Geometry.Revit/Classes/RevitInstance3D.cs index 726c068e..bf09c665 100644 --- a/SAM_Revit/SAM.Geometry.Revit/Classes/RevitInstance3D.cs +++ b/SAM_Revit/SAM.Geometry.Revit/Classes/RevitInstance3D.cs @@ -1,4 +1,6 @@ -using System.Text.Json.Nodes; +// SPDX-License-Identifier: LGPL-3.0-or-later +// Copyright (c) 2020–2026 Michal Dengusiak & Jakub Ziolkowski and contributors +using System.Text.Json.Nodes; using SAM.Core.Revit; using SAM.Geometry.Object.Spatial; using SAM.Geometry.Spatial; diff --git a/SAM_Revit/SAM.Geometry.Revit/Classes/RevitType2D.cs b/SAM_Revit/SAM.Geometry.Revit/Classes/RevitType2D.cs index 044edaf5..8522bfe9 100644 --- a/SAM_Revit/SAM.Geometry.Revit/Classes/RevitType2D.cs +++ b/SAM_Revit/SAM.Geometry.Revit/Classes/RevitType2D.cs @@ -1,4 +1,6 @@ -using System.Text.Json.Nodes; +// SPDX-License-Identifier: LGPL-3.0-or-later +// Copyright (c) 2020–2026 Michal Dengusiak & Jakub Ziolkowski and contributors +using System.Text.Json.Nodes; using SAM.Core.Revit; namespace SAM.Geometry.Revit diff --git a/SAM_Revit/SAM.Geometry.Revit/Classes/RevitType3D.cs b/SAM_Revit/SAM.Geometry.Revit/Classes/RevitType3D.cs index 8751e308..d68738d1 100644 --- a/SAM_Revit/SAM.Geometry.Revit/Classes/RevitType3D.cs +++ b/SAM_Revit/SAM.Geometry.Revit/Classes/RevitType3D.cs @@ -1,4 +1,6 @@ -using System.Text.Json.Nodes; +// SPDX-License-Identifier: LGPL-3.0-or-later +// Copyright (c) 2020–2026 Michal Dengusiak & Jakub Ziolkowski and contributors +using System.Text.Json.Nodes; using SAM.Core.Revit; namespace SAM.Geometry.Revit diff --git a/SAM_Revit/SAM.Geometry.Revit/Classes/Tag.cs b/SAM_Revit/SAM.Geometry.Revit/Classes/Tag.cs index 6cf61628..0fc4f077 100644 --- a/SAM_Revit/SAM.Geometry.Revit/Classes/Tag.cs +++ b/SAM_Revit/SAM.Geometry.Revit/Classes/Tag.cs @@ -1,4 +1,6 @@ -using System.Text.Json.Nodes; +// SPDX-License-Identifier: LGPL-3.0-or-later +// Copyright (c) 2020–2026 Michal Dengusiak & Jakub Ziolkowski and contributors +using System.Text.Json.Nodes; using SAM.Core; using SAM.Core.Revit; diff --git a/SAM_Revit/SAM.Geometry.Revit/Classes/TagType.cs b/SAM_Revit/SAM.Geometry.Revit/Classes/TagType.cs index a4e423c0..135d487d 100644 --- a/SAM_Revit/SAM.Geometry.Revit/Classes/TagType.cs +++ b/SAM_Revit/SAM.Geometry.Revit/Classes/TagType.cs @@ -1,4 +1,6 @@ -using System.Text.Json.Nodes; +// SPDX-License-Identifier: LGPL-3.0-or-later +// Copyright (c) 2020–2026 Michal Dengusiak & Jakub Ziolkowski and contributors +using System.Text.Json.Nodes; using SAM.Core.Revit; namespace SAM.Geometry.Revit From 0d75d8484965381fdeb0a286dbbac14076038f35 Mon Sep 17 00:00:00 2001 From: Michal Dengusiak Date: Fri, 15 May 2026 22:57:38 +0200 Subject: [PATCH 05/12] CI: pass auth token through cascade ls-remote and clone SAM_Revit / SAM_Revit_UI workflows define $token for the private SAM_Solver dep but the patched cascade loop wasn't using it - resulting in 'Cannot prompt because user interactivity has been disabled' on the ls-remote for the private repo. Pipe $token through the cascade URL and add LASTEXITCODE guards to surface clone failures clearly. Co-Authored-By: Claude Opus 4.7 --- .github/workflows/build.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 80d72daf..9444f3cb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -91,19 +91,23 @@ jobs: $candidates = @() if ($headRef) { $candidates += $headRef } $candidates += 'sow/2026-Q2' + # Use the auth-token form so private deps (e.g. SAM_Solver) don't prompt + $url = if ($token) { "https://$token@github.com/$org/$r.git" } else { "https://github.com/$org/$r.git" } $cloned = $false foreach ($cand in $candidates) { - $has = (git ls-remote --heads "https://github.com/$org/$r.git" $cand 2>$null | Out-String).Trim() + $has = (git ls-remote --heads $url $cand 2>$null | Out-String).Trim() if ($has) { Write-Host "Cloning $org/$r @ $cand" - git clone --depth 1 --branch $cand "https://github.com/$org/$r.git" $r + git clone --depth 1 --branch $cand $url $r + if ($LASTEXITCODE -ne 0) { throw "Failed to clone $r @ $cand" } $cloned = $true break } } if (-not $cloned) { Write-Host "Cloning $org/$r @ default branch" - git clone --depth 1 "https://github.com/$org/$r.git" $r + git clone --depth 1 $url $r + if ($LASTEXITCODE -ne 0) { throw "Failed to clone $r" } } } From 5610456ddac3481907bc0951b5ffb332f1ed3567 Mon Sep 17 00:00:00 2001 From: Michal Dengusiak Date: Mon, 18 May 2026 10:04:27 +0200 Subject: [PATCH 06/12] Remove defensive Newtonsoft.Json package references The original plan kept Newtonsoft.Json in SAM_Revit's csprojs on the assumption that Revit's runtime would require it. After migration, this repo's own source code has zero JObject/JArray/JToken references, and the System.Text.Json package alone is now sufficient for the build. Local verification: SAM_Revit.sln builds clean on both Debug2025 and Debug2026 with the Newtonsoft.Json package removed. Why this matters: keeping Newtonsoft loaded at runtime risks version conflicts with other Revit add-ins that also ship it (e.g. Pollination). Dropping the package eliminates the SAM-Revit-side contribution to that conflict. Co-Authored-By: Claude Opus 4.7 --- .../SAM.Analytical.Grasshopper.Revit.csproj | 4 +--- .../SAM.Architectural.Grasshopper.Revit.csproj | 4 +--- .../SAM.Core.Grasshopper.Revit.csproj | 4 +--- .../SAM.Geometry.Grasshopper.Revit.csproj | 4 +--- SAM_Revit/SAM.Analytical.Revit/SAM.Analytical.Revit.csproj | 2 +- .../SAM.Architectural.Revit/SAM.Architectural.Revit.csproj | 2 +- SAM_Revit/SAM.Core.Revit/SAM.Core.Revit.csproj | 2 +- SAM_Revit/SAM.Geometry.Revit/SAM.Geometry.Revit.csproj | 2 +- SAM_Revit/SAM.Units.Revit/SAM.Units.Revit.csproj | 2 +- 9 files changed, 9 insertions(+), 17 deletions(-) diff --git a/Grasshopper/SAM.Analytical.Grasshopper.Revit/SAM.Analytical.Grasshopper.Revit.csproj b/Grasshopper/SAM.Analytical.Grasshopper.Revit/SAM.Analytical.Grasshopper.Revit.csproj index 51e5ec4b..01e8dde3 100644 --- a/Grasshopper/SAM.Analytical.Grasshopper.Revit/SAM.Analytical.Grasshopper.Revit.csproj +++ b/Grasshopper/SAM.Analytical.Grasshopper.Revit/SAM.Analytical.Grasshopper.Revit.csproj @@ -640,9 +640,7 @@ compile; build; native; contentfiles; analyzers; buildtransitive - - 13.0.3 - + diff --git a/Grasshopper/SAM.Architectural.Grasshopper.Revit/SAM.Architectural.Grasshopper.Revit.csproj b/Grasshopper/SAM.Architectural.Grasshopper.Revit/SAM.Architectural.Grasshopper.Revit.csproj index efcbac71..c2d4f419 100644 --- a/Grasshopper/SAM.Architectural.Grasshopper.Revit/SAM.Architectural.Grasshopper.Revit.csproj +++ b/Grasshopper/SAM.Architectural.Grasshopper.Revit/SAM.Architectural.Grasshopper.Revit.csproj @@ -637,9 +637,7 @@ compile; build; native; contentfiles; analyzers; buildtransitive - - 13.0.3 - + diff --git a/Grasshopper/SAM.Core.Grasshopper.Revit/SAM.Core.Grasshopper.Revit.csproj b/Grasshopper/SAM.Core.Grasshopper.Revit/SAM.Core.Grasshopper.Revit.csproj index 25d928e9..4e2e85dd 100644 --- a/Grasshopper/SAM.Core.Grasshopper.Revit/SAM.Core.Grasshopper.Revit.csproj +++ b/Grasshopper/SAM.Core.Grasshopper.Revit/SAM.Core.Grasshopper.Revit.csproj @@ -686,9 +686,7 @@ compile; build; native; contentfiles; analyzers; buildtransitive - - 13.0.3 - + diff --git a/Grasshopper/SAM.Geometry.Grasshopper.Revit/SAM.Geometry.Grasshopper.Revit.csproj b/Grasshopper/SAM.Geometry.Grasshopper.Revit/SAM.Geometry.Grasshopper.Revit.csproj index ed001a77..a18c0b3c 100644 --- a/Grasshopper/SAM.Geometry.Grasshopper.Revit/SAM.Geometry.Grasshopper.Revit.csproj +++ b/Grasshopper/SAM.Geometry.Grasshopper.Revit/SAM.Geometry.Grasshopper.Revit.csproj @@ -689,9 +689,7 @@ compile; build; native; contentfiles; analyzers; buildtransitive - - 13.0.3 - + diff --git a/SAM_Revit/SAM.Analytical.Revit/SAM.Analytical.Revit.csproj b/SAM_Revit/SAM.Analytical.Revit/SAM.Analytical.Revit.csproj index 2b6713f4..24666820 100644 --- a/SAM_Revit/SAM.Analytical.Revit/SAM.Analytical.Revit.csproj +++ b/SAM_Revit/SAM.Analytical.Revit/SAM.Analytical.Revit.csproj @@ -219,7 +219,7 @@ - + diff --git a/SAM_Revit/SAM.Architectural.Revit/SAM.Architectural.Revit.csproj b/SAM_Revit/SAM.Architectural.Revit/SAM.Architectural.Revit.csproj index 215945ef..6c092ca5 100644 --- a/SAM_Revit/SAM.Architectural.Revit/SAM.Architectural.Revit.csproj +++ b/SAM_Revit/SAM.Architectural.Revit/SAM.Architectural.Revit.csproj @@ -150,7 +150,7 @@ - + diff --git a/SAM_Revit/SAM.Core.Revit/SAM.Core.Revit.csproj b/SAM_Revit/SAM.Core.Revit/SAM.Core.Revit.csproj index a8b12ce2..0b8a2d97 100644 --- a/SAM_Revit/SAM.Core.Revit/SAM.Core.Revit.csproj +++ b/SAM_Revit/SAM.Core.Revit/SAM.Core.Revit.csproj @@ -244,7 +244,7 @@ - + diff --git a/SAM_Revit/SAM.Geometry.Revit/SAM.Geometry.Revit.csproj b/SAM_Revit/SAM.Geometry.Revit/SAM.Geometry.Revit.csproj index 2ffa0fdc..40b03eba 100644 --- a/SAM_Revit/SAM.Geometry.Revit/SAM.Geometry.Revit.csproj +++ b/SAM_Revit/SAM.Geometry.Revit/SAM.Geometry.Revit.csproj @@ -252,7 +252,7 @@ - + diff --git a/SAM_Revit/SAM.Units.Revit/SAM.Units.Revit.csproj b/SAM_Revit/SAM.Units.Revit/SAM.Units.Revit.csproj index 00f95f42..36c87eda 100644 --- a/SAM_Revit/SAM.Units.Revit/SAM.Units.Revit.csproj +++ b/SAM_Revit/SAM.Units.Revit/SAM.Units.Revit.csproj @@ -179,7 +179,7 @@ - + From bcd0c1f9448337b5daf11f2f6133d24ba100289b Mon Sep 17 00:00:00 2001 From: Michal Dengusiak Date: Wed, 20 May 2026 10:01:48 +0200 Subject: [PATCH 07/12] Pin System.Text.Json to 8.0.5 Aligns the repo with the SAM-BIM workspace-wide pin to the LTS-aligned System.Text.Json 8.0.5, replacing the previously pinned 10.0.8 preview. --- .../SAM.Analytical.Grasshopper.Revit.csproj | 4 ++-- .../SAM.Architectural.Grasshopper.Revit.csproj | 4 ++-- .../SAM.Core.Grasshopper.Revit.csproj | 4 ++-- .../SAM.Geometry.Grasshopper.Revit.csproj | 4 ++-- Pdf/SAM.Core.Pdf.Revit/SAM.Core.Pdf.Revit.csproj | 1 + SAM_Revit/SAM.Analytical.Revit/SAM.Analytical.Revit.csproj | 4 ++-- .../SAM.Architectural.Revit/SAM.Architectural.Revit.csproj | 4 ++-- SAM_Revit/SAM.Core.Revit/SAM.Core.Revit.csproj | 3 +-- SAM_Revit/SAM.Geometry.Revit/SAM.Geometry.Revit.csproj | 4 ++-- 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Grasshopper/SAM.Analytical.Grasshopper.Revit/SAM.Analytical.Grasshopper.Revit.csproj b/Grasshopper/SAM.Analytical.Grasshopper.Revit/SAM.Analytical.Grasshopper.Revit.csproj index 01e8dde3..066ac2df 100644 --- a/Grasshopper/SAM.Analytical.Grasshopper.Revit/SAM.Analytical.Grasshopper.Revit.csproj +++ b/Grasshopper/SAM.Analytical.Grasshopper.Revit/SAM.Analytical.Grasshopper.Revit.csproj @@ -640,8 +640,8 @@ compile; build; native; contentfiles; analyzers; buildtransitive - - + + diff --git a/Grasshopper/SAM.Architectural.Grasshopper.Revit/SAM.Architectural.Grasshopper.Revit.csproj b/Grasshopper/SAM.Architectural.Grasshopper.Revit/SAM.Architectural.Grasshopper.Revit.csproj index c2d4f419..b8653c6e 100644 --- a/Grasshopper/SAM.Architectural.Grasshopper.Revit/SAM.Architectural.Grasshopper.Revit.csproj +++ b/Grasshopper/SAM.Architectural.Grasshopper.Revit/SAM.Architectural.Grasshopper.Revit.csproj @@ -637,8 +637,8 @@ compile; build; native; contentfiles; analyzers; buildtransitive - - + + diff --git a/Grasshopper/SAM.Core.Grasshopper.Revit/SAM.Core.Grasshopper.Revit.csproj b/Grasshopper/SAM.Core.Grasshopper.Revit/SAM.Core.Grasshopper.Revit.csproj index 4e2e85dd..51274c01 100644 --- a/Grasshopper/SAM.Core.Grasshopper.Revit/SAM.Core.Grasshopper.Revit.csproj +++ b/Grasshopper/SAM.Core.Grasshopper.Revit/SAM.Core.Grasshopper.Revit.csproj @@ -686,8 +686,8 @@ compile; build; native; contentfiles; analyzers; buildtransitive - - + + diff --git a/Grasshopper/SAM.Geometry.Grasshopper.Revit/SAM.Geometry.Grasshopper.Revit.csproj b/Grasshopper/SAM.Geometry.Grasshopper.Revit/SAM.Geometry.Grasshopper.Revit.csproj index a18c0b3c..9cc5baf3 100644 --- a/Grasshopper/SAM.Geometry.Grasshopper.Revit/SAM.Geometry.Grasshopper.Revit.csproj +++ b/Grasshopper/SAM.Geometry.Grasshopper.Revit/SAM.Geometry.Grasshopper.Revit.csproj @@ -689,8 +689,8 @@ compile; build; native; contentfiles; analyzers; buildtransitive - - + + diff --git a/Pdf/SAM.Core.Pdf.Revit/SAM.Core.Pdf.Revit.csproj b/Pdf/SAM.Core.Pdf.Revit/SAM.Core.Pdf.Revit.csproj index cedbdbea..83375191 100644 --- a/Pdf/SAM.Core.Pdf.Revit/SAM.Core.Pdf.Revit.csproj +++ b/Pdf/SAM.Core.Pdf.Revit/SAM.Core.Pdf.Revit.csproj @@ -9,6 +9,7 @@ net8.0-windows Library false + false true SAM.Core.Pdf.Revit SAM.Core.Pdf.Revit diff --git a/SAM_Revit/SAM.Analytical.Revit/SAM.Analytical.Revit.csproj b/SAM_Revit/SAM.Analytical.Revit/SAM.Analytical.Revit.csproj index 24666820..757fa92f 100644 --- a/SAM_Revit/SAM.Analytical.Revit/SAM.Analytical.Revit.csproj +++ b/SAM_Revit/SAM.Analytical.Revit/SAM.Analytical.Revit.csproj @@ -219,7 +219,7 @@ - - + + diff --git a/SAM_Revit/SAM.Architectural.Revit/SAM.Architectural.Revit.csproj b/SAM_Revit/SAM.Architectural.Revit/SAM.Architectural.Revit.csproj index 6c092ca5..4fea06b3 100644 --- a/SAM_Revit/SAM.Architectural.Revit/SAM.Architectural.Revit.csproj +++ b/SAM_Revit/SAM.Architectural.Revit/SAM.Architectural.Revit.csproj @@ -150,8 +150,8 @@ - - + + diff --git a/SAM_Revit/SAM.Core.Revit/SAM.Core.Revit.csproj b/SAM_Revit/SAM.Core.Revit/SAM.Core.Revit.csproj index 0b8a2d97..c02ffc0f 100644 --- a/SAM_Revit/SAM.Core.Revit/SAM.Core.Revit.csproj +++ b/SAM_Revit/SAM.Core.Revit/SAM.Core.Revit.csproj @@ -244,8 +244,7 @@ - - + diff --git a/SAM_Revit/SAM.Geometry.Revit/SAM.Geometry.Revit.csproj b/SAM_Revit/SAM.Geometry.Revit/SAM.Geometry.Revit.csproj index 40b03eba..56a138ed 100644 --- a/SAM_Revit/SAM.Geometry.Revit/SAM.Geometry.Revit.csproj +++ b/SAM_Revit/SAM.Geometry.Revit/SAM.Geometry.Revit.csproj @@ -252,7 +252,7 @@ - - + + From 85853de80d32db5dd16f28f779c9bf7a876fc995 Mon Sep 17 00:00:00 2001 From: Michal Dengusiak Date: Wed, 20 May 2026 10:01:49 +0200 Subject: [PATCH 08/12] Pin System.Text.Json to 8.0.5 and strip empty tags In SAM.Units.Revit.csproj, also remove 16 empty elements scattered across the per-Revit-year PropertyGroups. They suppress nothing (no codes listed) and only add noise to the file. --- .../SAM.Units.Revit/SAM.Units.Revit.csproj | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/SAM_Revit/SAM.Units.Revit/SAM.Units.Revit.csproj b/SAM_Revit/SAM.Units.Revit/SAM.Units.Revit.csproj index 36c87eda..3487aef8 100644 --- a/SAM_Revit/SAM.Units.Revit/SAM.Units.Revit.csproj +++ b/SAM_Revit/SAM.Units.Revit/SAM.Units.Revit.csproj @@ -22,7 +22,6 @@ ..\..\build\ 9999 - ..\..\build\ @@ -61,7 +60,6 @@ $(SolutionDir)\references\Revit 2020\Revit.exe ..\..\build\SAM.Units.Revit.xml 9999 - true @@ -70,7 +68,6 @@ ..\..\build\SAM.Units.Revit.xml MinimumRecommendedRules.ruleset 9999 - ..\..\build\ @@ -78,7 +75,6 @@ true MinimumRecommendedRules.ruleset 9999 - ..\..\build\ @@ -86,7 +82,6 @@ true MinimumRecommendedRules.ruleset 9999 - true @@ -95,7 +90,6 @@ ..\..\build\SAM.Units.Revit.xml MinimumRecommendedRules.ruleset 9999 - ..\..\build\ @@ -103,7 +97,6 @@ true MinimumRecommendedRules.ruleset 9999 - true @@ -112,7 +105,6 @@ ..\..\build\SAM.Units.Revit.xml MinimumRecommendedRules.ruleset 9999 - ..\..\build\ @@ -120,7 +112,6 @@ true MinimumRecommendedRules.ruleset 9999 - true @@ -129,7 +120,6 @@ ..\..\build\SAM.Units.Revit.xml MinimumRecommendedRules.ruleset 9999 - true @@ -138,7 +128,6 @@ ..\..\build\SAM.Units.Revit.xml MinimumRecommendedRules.ruleset 9999 - true @@ -147,7 +136,6 @@ ..\..\build\SAM.Units.Revit.xml MinimumRecommendedRules.ruleset 9999 - ..\..\build\ @@ -155,7 +143,6 @@ true MinimumRecommendedRules.ruleset 9999 - ..\..\build\ @@ -163,7 +150,6 @@ true MinimumRecommendedRules.ruleset 9999 - ..\..\build\ @@ -171,16 +157,13 @@ true MinimumRecommendedRules.ruleset 9999 - 9999 - - - + From b42ad0b9556d6178e553cff8e02afb0c3e533507 Mon Sep 17 00:00:00 2001 From: Michal Dengusiak Date: Wed, 20 May 2026 13:38:37 +0200 Subject: [PATCH 09/12] fix: pin AssemblyVersion/FileVersion to 1.0.0.0 (#4) * fix: pin AssemblyVersion/FileVersion to 1.0.0.0 (drop 1.0.* wildcard) Eliminates CS1607 warnings and restores deterministic builds. Aligns with the workspace's existing fixed-version files. Scope: AssemblyInfo.cs + .csproj version attributes only. The // commented-out template example is left intact for documentation. * fix: add SPDX + copyright header to modified AssemblyInfo.cs and refresh .csproj Satisfies the spdx-check workflow which requires every changed .cs file to declare the LGPL-3.0-or-later SPDX identifier and the 2020-2026 attribution in its first 20 lines. Also updates the stale 'Copyright (c) 2020' line in .csproj files to match the SPDX header style. --- .../Properties/AssemblyInfo.cs | 8 +++++--- .../Properties/AssemblyInfo.cs | 8 +++++--- .../SAM.Core.Grasshopper.Revit/Properties/AssemblyInfo.cs | 8 +++++--- .../Properties/AssemblyInfo.cs | 8 +++++--- .../SAM.Analytical.Revit/SAM.Analytical.Revit.csproj | 6 +++--- .../SAM.Architectural.Revit.csproj | 6 +++--- SAM_Revit/SAM.Core.Revit/SAM.Core.Revit.csproj | 6 +++--- SAM_Revit/SAM.Geometry.Revit/SAM.Geometry.Revit.csproj | 6 +++--- SAM_Revit/SAM.Units.Revit/SAM.Units.Revit.csproj | 6 +++--- 9 files changed, 35 insertions(+), 27 deletions(-) diff --git a/Grasshopper/SAM.Analytical.Grasshopper.Revit/Properties/AssemblyInfo.cs b/Grasshopper/SAM.Analytical.Grasshopper.Revit/Properties/AssemblyInfo.cs index 29e70790..b08393ba 100644 --- a/Grasshopper/SAM.Analytical.Grasshopper.Revit/Properties/AssemblyInfo.cs +++ b/Grasshopper/SAM.Analytical.Grasshopper.Revit/Properties/AssemblyInfo.cs @@ -1,4 +1,6 @@ -/* +// SPDX-License-Identifier: LGPL-3.0-or-later +// Copyright (c) 2020-2026 Michal Dengusiak & Jakub Ziolkowski and contributors +/* * This file is part of the Sustaiable Analytical Model (SAM) * Copyright (c) 2020, the respective contributors. All rights reserved. * @@ -53,5 +55,5 @@ // 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.*")] -[assembly: AssemblyFileVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Grasshopper/SAM.Architectural.Grasshopper.Revit/Properties/AssemblyInfo.cs b/Grasshopper/SAM.Architectural.Grasshopper.Revit/Properties/AssemblyInfo.cs index 8514efea..d16a218c 100644 --- a/Grasshopper/SAM.Architectural.Grasshopper.Revit/Properties/AssemblyInfo.cs +++ b/Grasshopper/SAM.Architectural.Grasshopper.Revit/Properties/AssemblyInfo.cs @@ -1,4 +1,6 @@ -/* +// SPDX-License-Identifier: LGPL-3.0-or-later +// Copyright (c) 2020-2026 Michal Dengusiak & Jakub Ziolkowski and contributors +/* * This file is part of the Sustaiable Analytical Model (SAM) * Copyright (c) 2020, the respective contributors. All rights reserved. * @@ -53,5 +55,5 @@ // 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.*")] -[assembly: AssemblyFileVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Grasshopper/SAM.Core.Grasshopper.Revit/Properties/AssemblyInfo.cs b/Grasshopper/SAM.Core.Grasshopper.Revit/Properties/AssemblyInfo.cs index af7af0ce..f13d4f25 100644 --- a/Grasshopper/SAM.Core.Grasshopper.Revit/Properties/AssemblyInfo.cs +++ b/Grasshopper/SAM.Core.Grasshopper.Revit/Properties/AssemblyInfo.cs @@ -1,4 +1,6 @@ -/* +// SPDX-License-Identifier: LGPL-3.0-or-later +// Copyright (c) 2020-2026 Michal Dengusiak & Jakub Ziolkowski and contributors +/* * This file is part of the Sustaiable Analytical Model (SAM) * Copyright (c) 2020, the respective contributors. All rights reserved. * @@ -53,5 +55,5 @@ // 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.*")] -[assembly: AssemblyFileVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Grasshopper/SAM.Geometry.Grasshopper.Revit/Properties/AssemblyInfo.cs b/Grasshopper/SAM.Geometry.Grasshopper.Revit/Properties/AssemblyInfo.cs index 0ae38b4a..51ae5886 100644 --- a/Grasshopper/SAM.Geometry.Grasshopper.Revit/Properties/AssemblyInfo.cs +++ b/Grasshopper/SAM.Geometry.Grasshopper.Revit/Properties/AssemblyInfo.cs @@ -1,4 +1,6 @@ -/* +// SPDX-License-Identifier: LGPL-3.0-or-later +// Copyright (c) 2020-2026 Michal Dengusiak & Jakub Ziolkowski and contributors +/* * This file is part of the Sustaiable Analytical Model (SAM) * Copyright (c) 2020, the respective contributors. All rights reserved. * @@ -53,5 +55,5 @@ // 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.*")] -[assembly: AssemblyFileVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/SAM_Revit/SAM.Analytical.Revit/SAM.Analytical.Revit.csproj b/SAM_Revit/SAM.Analytical.Revit/SAM.Analytical.Revit.csproj index 757fa92f..e9d82415 100644 --- a/SAM_Revit/SAM.Analytical.Revit/SAM.Analytical.Revit.csproj +++ b/SAM_Revit/SAM.Analytical.Revit/SAM.Analytical.Revit.csproj @@ -12,9 +12,9 @@ false SAM_Revit SAM_Revit - Copyright © 2020 - 1.0.%2a - 1.0.%2a + Copyright (c) 2020-2026 Michal Dengusiak & Jakub Ziolkowski and contributors + 1.0.0.0 + 1.0.0.0 false false Debug;Release;Debug2020;Debug2021;Debug2022;Debug2023;Debug2024;Release2024;Release2020;Release2021;Release2022;Release2023;Debug2025;Release2025;Debug2026;Release2026 diff --git a/SAM_Revit/SAM.Architectural.Revit/SAM.Architectural.Revit.csproj b/SAM_Revit/SAM.Architectural.Revit/SAM.Architectural.Revit.csproj index 4fea06b3..9aabd5bb 100644 --- a/SAM_Revit/SAM.Architectural.Revit/SAM.Architectural.Revit.csproj +++ b/SAM_Revit/SAM.Architectural.Revit/SAM.Architectural.Revit.csproj @@ -12,9 +12,9 @@ false SAM_Revit SAM_Revit - Copyright © 2020 - 1.0.%2a - 1.0.%2a + Copyright (c) 2020-2026 Michal Dengusiak & Jakub Ziolkowski and contributors + 1.0.0.0 + 1.0.0.0 false false Debug;Release;Debug2020;Debug2021;Debug2022;Debug2023;Debug2024;Release2020;Release2021;Release2022;Release2023;Release2024;Debug2025;Release2025;Debug2026;Release2026 diff --git a/SAM_Revit/SAM.Core.Revit/SAM.Core.Revit.csproj b/SAM_Revit/SAM.Core.Revit/SAM.Core.Revit.csproj index c02ffc0f..9cb8af50 100644 --- a/SAM_Revit/SAM.Core.Revit/SAM.Core.Revit.csproj +++ b/SAM_Revit/SAM.Core.Revit/SAM.Core.Revit.csproj @@ -14,9 +14,9 @@ true SAM_Revit SAM_Revit - Copyright © 2020 - 1.0.%2a - 1.0.%2a + Copyright (c) 2020-2026 Michal Dengusiak & Jakub Ziolkowski and contributors + 1.0.0.0 + 1.0.0.0 false false Debug;Release;Debug2020;Debug2021;Debug2022;Debug2023;Debug2024;Release2020;Release2021;Release2022;Release2023;Release2024;Debug2025;Release2025;Debug2026;Release2026 diff --git a/SAM_Revit/SAM.Geometry.Revit/SAM.Geometry.Revit.csproj b/SAM_Revit/SAM.Geometry.Revit/SAM.Geometry.Revit.csproj index 56a138ed..cc805310 100644 --- a/SAM_Revit/SAM.Geometry.Revit/SAM.Geometry.Revit.csproj +++ b/SAM_Revit/SAM.Geometry.Revit/SAM.Geometry.Revit.csproj @@ -12,9 +12,9 @@ false SAM_Revit SAM_Revit - Copyright © 2020 - 1.0.%2a - 1.0.%2a + Copyright (c) 2020-2026 Michal Dengusiak & Jakub Ziolkowski and contributors + 1.0.0.0 + 1.0.0.0 false false Debug;Release;Debug2020;Debug2021;Debug2022;Debug2023;Debug2024;Release2020;Release2021;Release2022;Release2023;Release2024;Debug2025;Release2025;Debug2026;Release2026 diff --git a/SAM_Revit/SAM.Units.Revit/SAM.Units.Revit.csproj b/SAM_Revit/SAM.Units.Revit/SAM.Units.Revit.csproj index 3487aef8..78ee7630 100644 --- a/SAM_Revit/SAM.Units.Revit/SAM.Units.Revit.csproj +++ b/SAM_Revit/SAM.Units.Revit/SAM.Units.Revit.csproj @@ -12,9 +12,9 @@ false SAM_Revit SAM_Revit - Copyright © 2020 - 1.0.%2a - 1.0.%2a + Copyright (c) 2020-2026 Michal Dengusiak & Jakub Ziolkowski and contributors + 1.0.0.0 + 1.0.0.0 false false Debug;Release;Debug2023;Debug2020;Debug2021;Debug2022;Debug2024;Release2020;Release2021;Release2022;Release2023;Release2024;Debug2025;Release2025;Debug2026;Release2026 From 0e33592314adc4cba67da560c29015605abda478 Mon Sep 17 00:00:00 2001 From: Michal Dengusiak Date: Wed, 20 May 2026 21:14:50 +0200 Subject: [PATCH 10/12] build: Directory.Build.props for centralised SAMVersion stamping (#5) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * build: Directory.Build.props for centralised SAMVersion stamping Mirrors SAM-BIM/SAM#7. Stage 2 of the AssemblyVersion versioning migration. * fix: replace literal u{2013} escape with actual en-dash in SPDX header PowerShell 5.1 doesn't support backtick-u escape sequences; the apply-stage2.ps1 script leaked them as literal text in 'Copyright (c) 2020u{2013}2026'. * fix: relax SAMVersion.g.cs Target condition to != 'true' Codex P1 on SAM_LadybugTools#4: classic (non-SDK) csprojs don't set GenerateAssemblyInfo at all, so the previous '== false' condition skipped them. Switching to '!= true' catches both GenerateAssemblyInfo=false (SDK projects with legacy AssemblyInfo.cs) AND empty (classic projects). * ci: Codex P2 fixes — four-part SAMVersion, prefer head_ref for sow PRs - Append .0 so SAMVersion is 4-part (AssemblyFileVersion expects 4 parts). - Prefer github.head_ref when it matches sow/yyyy-Qx (release-promotion PRs). - Mirrors SAM sow/2026-Q2 6d87d98e. --- .github/workflows/build.yml | 42 ++++++++++++++++++- Directory.Build.props | 39 +++++++++++++++++ .../Kernel/AssemblyInfo.cs | 5 ++- .../Properties/AssemblyInfo.cs | 3 -- .../SAM.Analytical.Grasshopper.Revit.csproj | 1 - .../Properties/AssemblyInfo.cs | 3 -- ...SAM.Architectural.Grasshopper.Revit.csproj | 1 - .../Properties/AssemblyInfo.cs | 3 -- .../SAM.Core.Grasshopper.Revit.csproj | 1 - .../Properties/AssemblyInfo.cs | 3 -- .../SAM.Geometry.Grasshopper.Revit.csproj | 1 - .../Properties/AssemblyInfo.cs | 5 ++- .../SAM.Core.Pdf.Revit.csproj | 3 -- .../Properties/AssemblyInfo.cs | 5 ++- .../SAM.Analytical.Revit.csproj | 3 -- .../Properties/AssemblyInfo.cs | 5 ++- .../SAM.Architectural.Revit.csproj | 3 -- .../SAM.Core.Revit/Properties/AssemblyInfo.cs | 5 ++- .../SAM.Core.Revit/SAM.Core.Revit.csproj | 3 -- .../Properties/AssemblyInfo.cs | 5 ++- .../SAM.Geometry.Revit.csproj | 3 -- .../Properties/AssemblyInfo.cs | 5 ++- .../SAM.Units.Revit/SAM.Units.Revit.csproj | 3 -- 23 files changed, 107 insertions(+), 43 deletions(-) create mode 100644 Directory.Build.props diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9444f3cb..211cfdbf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,9 +2,9 @@ name: Build (Windows) - SAM_Revit (2025/2026) on: push: - branches: [ "master", "main", "sow/2026-Q2" ] + branches: [ "master", "main", "sow/**" ] pull_request: - branches: [ "master", "main", "sow/2026-Q2" ] + branches: [ "master", "main", "sow/**" ] workflow_dispatch: jobs: @@ -39,6 +39,36 @@ jobs: uses: nuget/setup-nuget@v2 with: nuget-version: "6.x" + - name: Compute SAMVersion + id: ver + shell: pwsh + run: | + $ErrorActionPreference = 'Stop' + # Prefer head_ref when its a sow branch (release-promotion PRs from sow/* to main), + # else use base_ref on PR events / ref_name on push events. + $headRef = '${{ github.head_ref }}' + $baseRef = '${{ github.base_ref }}' + $refName = '${{ github.ref_name }}' + if ($headRef -match '^sow/\d{4}-Q\d$') { + $ref = $headRef + } elseif ('${{ github.event_name }}' -eq 'pull_request') { + $ref = $baseRef + } else { + $ref = $refName + } + # .NET AssemblyVersion components are UInt16 (max 65535). Cap to 60000 for headroom. + $run = ${{ github.run_number }} % 60000 + if ($ref -match 'sow/(\d{4})-Q(\d)') { + $v = "$($Matches[1]).$($Matches[2]).$run.0" + $src = "branch '$ref'" + } else { + $now = (Get-Date).ToUniversalTime() + $quarter = [int][Math]::Ceiling($now.Month / 3.0) + $v = "$($now.Year).$quarter.$run.0" + $src = "date $($now.ToString('yyyy-MM-dd')) (ref '$ref' not sow/yyyy-Qx)" + } + Write-Host "SAMVersion = $v (from $src)" + "samversion=$v" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8 - name: Clone dependency repos (siblings) + build order shell: powershell @@ -88,8 +118,13 @@ jobs: foreach ($r in $deps) { if (Test-Path $r) { continue } $headRef = '${{ github.head_ref }}' + $baseRef = '${{ github.base_ref }}' + $refName = '${{ github.ref_name }}' $candidates = @() if ($headRef) { $candidates += $headRef } + # Current sow branch: base_ref on PR events, ref_name on push events. + $sowRef = if ($baseRef -match '^sow/') { $baseRef } elseif ($refName -match '^sow/') { $refName } else { '' } + if ($sowRef -and $sowRef -ne $headRef) { $candidates += $sowRef } $candidates += 'sow/2026-Q2' # Use the auth-token form so private deps (e.g. SAM_Solver) don't prompt $url = if ($token) { "https://$token@github.com/$org/$r.git" } else { "https://github.com/$org/$r.git" } @@ -172,6 +207,7 @@ jobs: '/nr:false' '/v:m' '/p:UseSharedCompilation=false' + '/p:SAMVersion=${{ steps.ver.outputs.samversion }}' '/p:RunPostBuildEvent=OnOutputUpdated' ) @@ -245,6 +281,7 @@ jobs: '/nr:false' '/v:m' '/p:UseSharedCompilation=false' + '/p:SAMVersion=${{ steps.ver.outputs.samversion }}' '/p:RunPostBuildEvent=OnOutputUpdated' "/p:Configuration=$cfg" '/p:Platform=Any CPU' @@ -332,6 +369,7 @@ jobs: '/nr:false' '/v:m' '/p:UseSharedCompilation=false' + '/p:SAMVersion=${{ steps.ver.outputs.samversion }}' '/p:RunPostBuildEvent=OnOutputUpdated' "/p:Configuration=$cfg" '/p:Platform=Any CPU' diff --git a/Directory.Build.props b/Directory.Build.props new file mode 100644 index 00000000..98416551 --- /dev/null +++ b/Directory.Build.props @@ -0,0 +1,39 @@ + + + + + 1.0.0.0 + $(SAMVersion) + $(SAMVersion) + true + + + + + + <_SAMVersionLine Include="// <auto-generated />" /> + <_SAMVersionLine Include="[assembly: System.Reflection.AssemblyVersionAttribute("$(SAMVersion)")]" /> + <_SAMVersionLine Include="[assembly: System.Reflection.AssemblyFileVersionAttribute("$(SAMVersion)")]" /> + + + + + + + + + + diff --git a/Grasshopper/SAM.Analytical.Grasshopper.Revit/Kernel/AssemblyInfo.cs b/Grasshopper/SAM.Analytical.Grasshopper.Revit/Kernel/AssemblyInfo.cs index acf9aa5e..66e0cf38 100644 --- a/Grasshopper/SAM.Analytical.Grasshopper.Revit/Kernel/AssemblyInfo.cs +++ b/Grasshopper/SAM.Analytical.Grasshopper.Revit/Kernel/AssemblyInfo.cs @@ -1,4 +1,7 @@ -using Grasshopper.Kernel; +// SPDX-License-Identifier: LGPL-3.0-or-later +// Copyright (c) 2020–2026 Michal Dengusiak & Jakub Ziolkowski and contributors + +using Grasshopper.Kernel; using System; using System.Drawing; diff --git a/Grasshopper/SAM.Analytical.Grasshopper.Revit/Properties/AssemblyInfo.cs b/Grasshopper/SAM.Analytical.Grasshopper.Revit/Properties/AssemblyInfo.cs index b08393ba..fc48ccae 100644 --- a/Grasshopper/SAM.Analytical.Grasshopper.Revit/Properties/AssemblyInfo.cs +++ b/Grasshopper/SAM.Analytical.Grasshopper.Revit/Properties/AssemblyInfo.cs @@ -54,6 +54,3 @@ // // 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/Grasshopper/SAM.Analytical.Grasshopper.Revit/SAM.Analytical.Grasshopper.Revit.csproj b/Grasshopper/SAM.Analytical.Grasshopper.Revit/SAM.Analytical.Grasshopper.Revit.csproj index 066ac2df..bd055f6a 100644 --- a/Grasshopper/SAM.Analytical.Grasshopper.Revit/SAM.Analytical.Grasshopper.Revit.csproj +++ b/Grasshopper/SAM.Analytical.Grasshopper.Revit/SAM.Analytical.Grasshopper.Revit.csproj @@ -19,7 +19,6 @@ false true true - false false false x64 diff --git a/Grasshopper/SAM.Architectural.Grasshopper.Revit/Properties/AssemblyInfo.cs b/Grasshopper/SAM.Architectural.Grasshopper.Revit/Properties/AssemblyInfo.cs index d16a218c..6d510664 100644 --- a/Grasshopper/SAM.Architectural.Grasshopper.Revit/Properties/AssemblyInfo.cs +++ b/Grasshopper/SAM.Architectural.Grasshopper.Revit/Properties/AssemblyInfo.cs @@ -54,6 +54,3 @@ // // 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/Grasshopper/SAM.Architectural.Grasshopper.Revit/SAM.Architectural.Grasshopper.Revit.csproj b/Grasshopper/SAM.Architectural.Grasshopper.Revit/SAM.Architectural.Grasshopper.Revit.csproj index b8653c6e..1ca84b3c 100644 --- a/Grasshopper/SAM.Architectural.Grasshopper.Revit/SAM.Architectural.Grasshopper.Revit.csproj +++ b/Grasshopper/SAM.Architectural.Grasshopper.Revit/SAM.Architectural.Grasshopper.Revit.csproj @@ -19,7 +19,6 @@ false true true - false false false AnyCPU diff --git a/Grasshopper/SAM.Core.Grasshopper.Revit/Properties/AssemblyInfo.cs b/Grasshopper/SAM.Core.Grasshopper.Revit/Properties/AssemblyInfo.cs index f13d4f25..84514ab8 100644 --- a/Grasshopper/SAM.Core.Grasshopper.Revit/Properties/AssemblyInfo.cs +++ b/Grasshopper/SAM.Core.Grasshopper.Revit/Properties/AssemblyInfo.cs @@ -54,6 +54,3 @@ // // 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/Grasshopper/SAM.Core.Grasshopper.Revit/SAM.Core.Grasshopper.Revit.csproj b/Grasshopper/SAM.Core.Grasshopper.Revit/SAM.Core.Grasshopper.Revit.csproj index 51274c01..f37a5a33 100644 --- a/Grasshopper/SAM.Core.Grasshopper.Revit/SAM.Core.Grasshopper.Revit.csproj +++ b/Grasshopper/SAM.Core.Grasshopper.Revit/SAM.Core.Grasshopper.Revit.csproj @@ -16,7 +16,6 @@ false true true - false false false AnyCPU diff --git a/Grasshopper/SAM.Geometry.Grasshopper.Revit/Properties/AssemblyInfo.cs b/Grasshopper/SAM.Geometry.Grasshopper.Revit/Properties/AssemblyInfo.cs index 51ae5886..fd2fa741 100644 --- a/Grasshopper/SAM.Geometry.Grasshopper.Revit/Properties/AssemblyInfo.cs +++ b/Grasshopper/SAM.Geometry.Grasshopper.Revit/Properties/AssemblyInfo.cs @@ -54,6 +54,3 @@ // // 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/Grasshopper/SAM.Geometry.Grasshopper.Revit/SAM.Geometry.Grasshopper.Revit.csproj b/Grasshopper/SAM.Geometry.Grasshopper.Revit/SAM.Geometry.Grasshopper.Revit.csproj index 9cc5baf3..72518b6e 100644 --- a/Grasshopper/SAM.Geometry.Grasshopper.Revit/SAM.Geometry.Grasshopper.Revit.csproj +++ b/Grasshopper/SAM.Geometry.Grasshopper.Revit/SAM.Geometry.Grasshopper.Revit.csproj @@ -16,7 +16,6 @@ false true true - false false false AnyCPU diff --git a/Pdf/SAM.Core.Pdf.Revit/Properties/AssemblyInfo.cs b/Pdf/SAM.Core.Pdf.Revit/Properties/AssemblyInfo.cs index 12db11c2..cb59949d 100644 --- a/Pdf/SAM.Core.Pdf.Revit/Properties/AssemblyInfo.cs +++ b/Pdf/SAM.Core.Pdf.Revit/Properties/AssemblyInfo.cs @@ -1,4 +1,7 @@ -using System.Reflection; +// SPDX-License-Identifier: LGPL-3.0-or-later +// Copyright (c) 2020–2026 Michal Dengusiak & Jakub Ziolkowski and contributors + +using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/Pdf/SAM.Core.Pdf.Revit/SAM.Core.Pdf.Revit.csproj b/Pdf/SAM.Core.Pdf.Revit/SAM.Core.Pdf.Revit.csproj index 83375191..3b0993cf 100644 --- a/Pdf/SAM.Core.Pdf.Revit/SAM.Core.Pdf.Revit.csproj +++ b/Pdf/SAM.Core.Pdf.Revit/SAM.Core.Pdf.Revit.csproj @@ -9,13 +9,10 @@ net8.0-windows Library false - false true SAM.Core.Pdf.Revit SAM.Core.Pdf.Revit Copyright © 2021 - 1.0.0.0 - 1.0.0.0 false false Debug;Release;Debug2020;Debug2021;Debug2022;Debug2023;Debug2024;Debug2025;Release2020;Release2021;Release2022;Release2023;Release2024;Release2025;Debug2026;Release2026 diff --git a/SAM_Revit/SAM.Analytical.Revit/Properties/AssemblyInfo.cs b/SAM_Revit/SAM.Analytical.Revit/Properties/AssemblyInfo.cs index d0620645..3a5e1e8a 100644 --- a/SAM_Revit/SAM.Analytical.Revit/Properties/AssemblyInfo.cs +++ b/SAM_Revit/SAM.Analytical.Revit/Properties/AssemblyInfo.cs @@ -1,4 +1,7 @@ -/* +// SPDX-License-Identifier: LGPL-3.0-or-later +// Copyright (c) 2020–2026 Michal Dengusiak & Jakub Ziolkowski and contributors + +/* * This file is part of the Sustaiable Analytical Model (SAM) * Copyright (c) 2020, the respective contributors. All rights reserved. * diff --git a/SAM_Revit/SAM.Analytical.Revit/SAM.Analytical.Revit.csproj b/SAM_Revit/SAM.Analytical.Revit/SAM.Analytical.Revit.csproj index e9d82415..061149de 100644 --- a/SAM_Revit/SAM.Analytical.Revit/SAM.Analytical.Revit.csproj +++ b/SAM_Revit/SAM.Analytical.Revit/SAM.Analytical.Revit.csproj @@ -8,13 +8,10 @@ net8.0-windows net8.0-windows Library - false false SAM_Revit SAM_Revit Copyright (c) 2020-2026 Michal Dengusiak & Jakub Ziolkowski and contributors - 1.0.0.0 - 1.0.0.0 false false Debug;Release;Debug2020;Debug2021;Debug2022;Debug2023;Debug2024;Release2024;Release2020;Release2021;Release2022;Release2023;Debug2025;Release2025;Debug2026;Release2026 diff --git a/SAM_Revit/SAM.Architectural.Revit/Properties/AssemblyInfo.cs b/SAM_Revit/SAM.Architectural.Revit/Properties/AssemblyInfo.cs index 59e398d0..272fed4a 100644 --- a/SAM_Revit/SAM.Architectural.Revit/Properties/AssemblyInfo.cs +++ b/SAM_Revit/SAM.Architectural.Revit/Properties/AssemblyInfo.cs @@ -1,4 +1,7 @@ -/* +// SPDX-License-Identifier: LGPL-3.0-or-later +// Copyright (c) 2020–2026 Michal Dengusiak & Jakub Ziolkowski and contributors + +/* * This file is part of the Sustaiable Analytical Model (SAM) * Copyright (c) 2020, the respective contributors. All rights reserved. * diff --git a/SAM_Revit/SAM.Architectural.Revit/SAM.Architectural.Revit.csproj b/SAM_Revit/SAM.Architectural.Revit/SAM.Architectural.Revit.csproj index 9aabd5bb..c26cae45 100644 --- a/SAM_Revit/SAM.Architectural.Revit/SAM.Architectural.Revit.csproj +++ b/SAM_Revit/SAM.Architectural.Revit/SAM.Architectural.Revit.csproj @@ -8,13 +8,10 @@ net8.0-windows net8.0-windows Library - false false SAM_Revit SAM_Revit Copyright (c) 2020-2026 Michal Dengusiak & Jakub Ziolkowski and contributors - 1.0.0.0 - 1.0.0.0 false false Debug;Release;Debug2020;Debug2021;Debug2022;Debug2023;Debug2024;Release2020;Release2021;Release2022;Release2023;Release2024;Debug2025;Release2025;Debug2026;Release2026 diff --git a/SAM_Revit/SAM.Core.Revit/Properties/AssemblyInfo.cs b/SAM_Revit/SAM.Core.Revit/Properties/AssemblyInfo.cs index 58d7cc42..483fbabc 100644 --- a/SAM_Revit/SAM.Core.Revit/Properties/AssemblyInfo.cs +++ b/SAM_Revit/SAM.Core.Revit/Properties/AssemblyInfo.cs @@ -1,4 +1,7 @@ -/* +// SPDX-License-Identifier: LGPL-3.0-or-later +// Copyright (c) 2020–2026 Michal Dengusiak & Jakub Ziolkowski and contributors + +/* * This file is part of the Sustaiable Analytical Model (SAM) * Copyright (c) 2020, the respective contributors. All rights reserved. * diff --git a/SAM_Revit/SAM.Core.Revit/SAM.Core.Revit.csproj b/SAM_Revit/SAM.Core.Revit/SAM.Core.Revit.csproj index 9cb8af50..0ff67c53 100644 --- a/SAM_Revit/SAM.Core.Revit/SAM.Core.Revit.csproj +++ b/SAM_Revit/SAM.Core.Revit/SAM.Core.Revit.csproj @@ -8,15 +8,12 @@ net8.0-windows net8.0-windows Library - false false true true SAM_Revit SAM_Revit Copyright (c) 2020-2026 Michal Dengusiak & Jakub Ziolkowski and contributors - 1.0.0.0 - 1.0.0.0 false false Debug;Release;Debug2020;Debug2021;Debug2022;Debug2023;Debug2024;Release2020;Release2021;Release2022;Release2023;Release2024;Debug2025;Release2025;Debug2026;Release2026 diff --git a/SAM_Revit/SAM.Geometry.Revit/Properties/AssemblyInfo.cs b/SAM_Revit/SAM.Geometry.Revit/Properties/AssemblyInfo.cs index 9e3bac08..29cc1540 100644 --- a/SAM_Revit/SAM.Geometry.Revit/Properties/AssemblyInfo.cs +++ b/SAM_Revit/SAM.Geometry.Revit/Properties/AssemblyInfo.cs @@ -1,4 +1,7 @@ -/* +// SPDX-License-Identifier: LGPL-3.0-or-later +// Copyright (c) 2020–2026 Michal Dengusiak & Jakub Ziolkowski and contributors + +/* * This file is part of the Sustaiable Analytical Model (SAM) * Copyright (c) 2020, the respective contributors. All rights reserved. * diff --git a/SAM_Revit/SAM.Geometry.Revit/SAM.Geometry.Revit.csproj b/SAM_Revit/SAM.Geometry.Revit/SAM.Geometry.Revit.csproj index cc805310..4948ca88 100644 --- a/SAM_Revit/SAM.Geometry.Revit/SAM.Geometry.Revit.csproj +++ b/SAM_Revit/SAM.Geometry.Revit/SAM.Geometry.Revit.csproj @@ -8,13 +8,10 @@ net8.0-windows net8.0-windows Library - false false SAM_Revit SAM_Revit Copyright (c) 2020-2026 Michal Dengusiak & Jakub Ziolkowski and contributors - 1.0.0.0 - 1.0.0.0 false false Debug;Release;Debug2020;Debug2021;Debug2022;Debug2023;Debug2024;Release2020;Release2021;Release2022;Release2023;Release2024;Debug2025;Release2025;Debug2026;Release2026 diff --git a/SAM_Revit/SAM.Units.Revit/Properties/AssemblyInfo.cs b/SAM_Revit/SAM.Units.Revit/Properties/AssemblyInfo.cs index 59e398d0..272fed4a 100644 --- a/SAM_Revit/SAM.Units.Revit/Properties/AssemblyInfo.cs +++ b/SAM_Revit/SAM.Units.Revit/Properties/AssemblyInfo.cs @@ -1,4 +1,7 @@ -/* +// SPDX-License-Identifier: LGPL-3.0-or-later +// Copyright (c) 2020–2026 Michal Dengusiak & Jakub Ziolkowski and contributors + +/* * This file is part of the Sustaiable Analytical Model (SAM) * Copyright (c) 2020, the respective contributors. All rights reserved. * diff --git a/SAM_Revit/SAM.Units.Revit/SAM.Units.Revit.csproj b/SAM_Revit/SAM.Units.Revit/SAM.Units.Revit.csproj index 78ee7630..3960d58d 100644 --- a/SAM_Revit/SAM.Units.Revit/SAM.Units.Revit.csproj +++ b/SAM_Revit/SAM.Units.Revit/SAM.Units.Revit.csproj @@ -8,13 +8,10 @@ net8.0-windows net8.0-windows Library - false false SAM_Revit SAM_Revit Copyright (c) 2020-2026 Michal Dengusiak & Jakub Ziolkowski and contributors - 1.0.0.0 - 1.0.0.0 false false Debug;Release;Debug2023;Debug2020;Debug2021;Debug2022;Debug2024;Release2020;Release2021;Release2022;Release2023;Release2024;Debug2025;Release2025;Debug2026;Release2026 From b617a0af82358729cb7f09378f862b70971b86ae Mon Sep 17 00:00:00 2001 From: Michal Dengusiak Date: Thu, 21 May 2026 10:19:48 +0200 Subject: [PATCH 11/12] build: emit AssemblyInformationalVersion for non-SDK projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mirrors SAM sow/2026-Q2. Adds AssemblyInformationalVersion attribute generation to Path D's SAMVersion.g.cs Target — covers Grasshopper / Tas-bridge assemblies that have GenerateAssemblyInfo=false, so they also get the CI commit SHA stamp in their ProductVersion field. SDK projects pick up InformationalVersion via PropertyGroup auto-gen as before. Local dev builds unchanged. --- Directory.Build.props | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 98416551..b6b921fc 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,10 +1,17 @@ - + 1.0.0.0 $(SAMVersion) $(SAMVersion) + + $(SAMVersion)+$(SAMSourceRevision) true @@ -23,6 +30,9 @@ <_SAMVersionLine Include="// <auto-generated />" /> <_SAMVersionLine Include="[assembly: System.Reflection.AssemblyVersionAttribute("$(SAMVersion)")]" /> <_SAMVersionLine Include="[assembly: System.Reflection.AssemblyFileVersionAttribute("$(SAMVersion)")]" /> + + <_SAMVersionLine Include="[assembly: System.Reflection.AssemblyInformationalVersionAttribute("$(InformationalVersion)")]" Condition="'$(InformationalVersion)' != ''" /> Date: Thu, 21 May 2026 12:52:33 +0200 Subject: [PATCH 12/12] build: emit AssemblyInformationalVersion for non-SDK projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mirrors SAM sow/2026-Q2. Adds AssemblyInformationalVersion attribute generation to Path D's SAMVersion.g.cs Target — covers Grasshopper / Tas-bridge assemblies that have GenerateAssemblyInfo=false, so they also get the CI commit SHA stamp in their ProductVersion field. SDK projects pick up InformationalVersion via PropertyGroup auto-gen as before. Local dev builds unchanged. --- Directory.Build.props | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Directory.Build.props b/Directory.Build.props index b6b921fc..509f4c68 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -12,6 +12,14 @@ that and don't overwrite. Local dev builds leave both empty -> no SHA attribute emitted. --> $(SAMVersion)+$(SAMSourceRevision) + + false true