Skip to content

Commit

Permalink
7.2 Deployment (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
al-fisher authored Jun 20, 2024
2 parents d5f33f6 + 1c0120a commit 543f164
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 8 deletions.
8 changes: 7 additions & 1 deletion .ci/BHoMBot/Nuget/BHoM.Interop.Excel.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,14 @@
<group targetFramework="netstandard2.0">
<dependency id="NETStandard.Library" version="2.0.3" />
<dependency id="Microsoft.CSharp" version="4.7.0" />
<dependency id="ClosedXML" version="0.95.0" />
<dependency id="ClosedXML" version="0.102.2" />
<dependency id="System.Security.Permissions" version="8.0.0-rc.2.23479.6" />
<dependency id="DocumentFormat.OpenXml" version="2.16.0" />
<dependency id="ExcelNumberFormat" version="1.1.0" />
<dependency id="SixLabors.Fonts" version="1.0.0" />
<dependency id="System.IO.Packaging" version="6.0.0" />
<dependency id="System.Security.AccessControl" version="6.0.2-mauipre.1.22102.15" />
<dependency id="System.Security.Permissions" version="8.0.0" />
</group>
</dependencies>
</metadata>
Expand Down
3 changes: 3 additions & 0 deletions Excel_Adapter/AdapterActions/Push.cs
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,9 @@ private static void GetPropertyDictionary(ref Dictionary<string, object> dict, o
}
else if (obj.GetType().IsPrimitive || obj is string || obj is Guid || obj is Enum)
{
if (obj is Guid)
obj = obj.ToString(); // TODO: Temporary fix to cover for a bug in IToText() from the base engine when used on Guids. Remove when fix in the base engine.

string key = parentType.Length > 0 ? parentType : "Value";
dict[key] = obj;
return;
Expand Down
27 changes: 25 additions & 2 deletions Excel_Adapter/Convert/FromExcel/CellContents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public static CellContents FromExcel(this IXLCell xLCell)
[Input("value", "Value or cached value of the cell.")]
public static object CellValueOrCachedValue(this IXLCell xLCell)
{
object value;
XLCellValue value;
if (!xLCell.TryGetValue(out value))
{
//If not able to just get the value, then get the cached value
Expand All @@ -74,7 +74,7 @@ public static object CellValueOrCachedValue(this IXLCell xLCell)

value = xLCell.CachedValue;
}
return value;
return ExtractValue(value);
}

/*******************************************/
Expand All @@ -101,6 +101,29 @@ private static Type SystemType(this XLDataType dataType)
}

/*******************************************/

private static object ExtractValue(XLCellValue xCellValue)
{
switch (xCellValue.Type)
{
case XLDataType.Boolean:
return xCellValue.GetBoolean();
case XLDataType.DateTime:
return xCellValue.GetDateTime();
case XLDataType.Number:
return xCellValue.GetNumber();
case XLDataType.Text:
return xCellValue.GetText();
case XLDataType.TimeSpan:
return xCellValue.GetTimeSpan();
case XLDataType.Error:
return null;
default:
return null;
}
}

/*******************************************/
}
}

Expand Down
4 changes: 2 additions & 2 deletions Excel_Adapter/Excel_Adapter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<Authors>BHoM</Authors>
<Copyright>Copyright © https://github.com/BHoM</Copyright>
<RootNamespace>BH.Adapter.Excel</RootNamespace>
<FileVersion>7.1.0.0</FileVersion>
<FileVersion>7.2.0.0</FileVersion>
<Configurations>Debug;Release;ZeroCodeTool</Configurations>
<OutputPath>..\Build\</OutputPath>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
Expand All @@ -23,7 +23,7 @@
</PropertyGroup>

<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="'$(Configuration)'=='Debug' Or '$(Configuration)'=='Release'">
<Exec Command="xcopy &quot;$(TargetPath)&quot; &quot;$(ProgramData)\BHoM\Assemblies&quot; /C /Y&#xD;&#xA;xcopy &quot;$(TargetDir)ClosedXML.dll&quot; &quot;$(ProgramData)\BHoM\Assemblies&quot; /Y&#xD;&#xA;xcopy &quot;$(TargetDir)ExcelNumberFormat.dll&quot; &quot;$(ProgramData)\BHoM\Assemblies&quot; /Y&#xD;&#xA;xcopy &quot;$(TargetDir)DocumentFormat.OpenXml.dll&quot; &quot;$(ProgramData)\BHoM\Assemblies&quot; /Y&#xD;&#xA;xcopy &quot;$(TargetDir)SixLabors.Fonts.dll&quot; &quot;$(ProgramData)\BHoM\Assemblies&quot; /Y&#xD;&#xA;xcopy &quot;$(TargetDir)System.IO.Packaging.dll&quot; &quot;$(ProgramData)\BHoM\Assemblies&quot; /Y" />
<Exec Command="xcopy &quot;$(TargetPath)&quot; &quot;$(ProgramData)\BHoM\Assemblies&quot; /C /Y&#xD;&#xA;xcopy &quot;$(TargetDir)ClosedXML.dll&quot; &quot;$(ProgramData)\BHoM\Assemblies&quot; /Y&#xD;&#xA;xcopy &quot;$(TargetDir)ExcelNumberFormat.dll&quot; &quot;$(ProgramData)\BHoM\Assemblies&quot; /Y&#xD;&#xA;xcopy &quot;$(TargetDir)DocumentFormat.OpenXml.dll&quot; &quot;$(ProgramData)\BHoM\Assemblies&quot; /Y&#xD;&#xA;xcopy &quot;$(TargetDir)SixLabors.Fonts.dll&quot; &quot;$(ProgramData)\BHoM\Assemblies&quot; /Y&#xD;&#xA;xcopy &quot;$(TargetDir)System.IO.Packaging.dll&quot; &quot;$(ProgramData)\BHoM\Assemblies&quot; /Y&#xD;&#xA;xcopy &quot;$(TargetDir)Irony.dll&quot; &quot;$(ProgramData)\BHoM\Assemblies&quot; /Y&#xD;&#xA;xcopy &quot;$(TargetDir)XLParser.dll&quot; &quot;$(ProgramData)\BHoM\Assemblies&quot; /Y" />
</Target>

<ItemGroup>
Expand Down
6 changes: 5 additions & 1 deletion Excel_Engine/Compute/ListToText.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ public static partial class Compute
/**** Public Methods ****/
/*******************************************/

public static string ListToText(List<object> objects, string delimiter=",")
[Description("Converts a list of objects into a single string using the delimiter provided to separate items.")]
[Input("objects", "The list of objects to be converted to a string.")]
[Input("delimiter", "The delimiter to be used that separates the items of the list.")]
[Output("text", "The output text.")]
public static string ListToText(List<object> objects, string delimiter = ",")
{
if (objects.Count == 0)
return "";
Expand Down
2 changes: 2 additions & 0 deletions Excel_Engine/Create/ExcelPushConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ public static partial class Create
/*******************************************/

[Description("Creates an ExcelPushConfig based on starting cell address in an Excel-readable string format and workbook properties.")]
[Input("sheetName", "The name of the sheet in the excel file to push to.")]
[Input("startingCell", "Starting cell address in an Excel-readable string format.")]
[Input("objectProperties", "Object properties to apply to the pushed objects.")]
[InputFromProperty("workbookProperties")]
[Output("config", "ExcelPushConfig created based on the inputs.")]
public static ExcelPushConfig ExcelPushConfig(string sheetName = "", string startingCell = "", List<string> objectProperties = null, WorkbookProperties workbookProperties = null)
Expand Down
2 changes: 1 addition & 1 deletion Excel_Engine/Excel_Engine.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<Authors>BHoM</Authors>
<Copyright>Copyright © https://github.com/BHoM</Copyright>
<RootNamespace>BH.Engine.Excel</RootNamespace>
<FileVersion>7.1.0.0</FileVersion>
<FileVersion>7.2.0.0</FileVersion>
<Configurations>Debug;Release;ZeroCodeTool</Configurations>
<OutputPath>..\Build\</OutputPath>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
Expand Down
2 changes: 1 addition & 1 deletion Excel_oM/Excel_oM.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<Authors>BHoM</Authors>
<Copyright>Copyright © https://github.com/BHoM</Copyright>
<RootNamespace>BH.oM.Excel</RootNamespace>
<FileVersion>7.1.0.0</FileVersion>
<FileVersion>7.2.0.0</FileVersion>
<Configurations>Debug;Release;ZeroCodeTool</Configurations>
<OutputPath>..\Build\</OutputPath>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
Expand Down

0 comments on commit 543f164

Please sign in to comment.