Skip to content

Commit

Permalink
6.3 Deployment (#470)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fraser Greenroyd authored Sep 21, 2023
2 parents 5ff4d3d + 76ba676 commit 92fa8a8
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 32 deletions.
27 changes: 27 additions & 0 deletions .ci/BHoMBot/Nuget/BHoM.UI.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<package>
<metadata>
<id>BHoM.UI</id>
<version></version>
<authors>BHoM</authors>
<projectUrl>https://github.com/BHoM/BHoM_UI</projectUrl>
<license type="file">licence.txt</license>
<icon>icon.png</icon>
<readme>readme.md</readme>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Base engine for all BHoM UIs - more information available at https://github.com/BHoM/BHoM_UI</description>
<releaseNotes></releaseNotes>
<copyright></copyright>
<tags>BHoM interop csharp ui aec</tags>
<title></title>
<dependencies>
<group targetFramework="netstandard2.0.0">
</group>
</dependencies>
</metadata>
<files>
<file src="licence/licence.txt" target="" />
<file src="images/icon.png" target="" />
<file src="docs/readme.md" target="" />
</files>
</package>
2 changes: 1 addition & 1 deletion .ci/code/UI_Test/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,5 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("6.0.0.0")]
[assembly: AssemblyFileVersion("6.2.0.0")]
[assembly: AssemblyFileVersion("6.3.0.0")]

39 changes: 22 additions & 17 deletions BHoM_UI/BHoM_UI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,47 +32,47 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Adapter_oM">
<HintPath>C:\ProgramData\BHoM\Assemblies\Adapter_oM.dll</HintPath>
<HintPath>$(ProgramData)\BHoM\Assemblies\Adapter_oM.dll</HintPath>
<Private>False</Private>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="BHoM">
<HintPath>C:\ProgramData\BHoM\Assemblies\BHoM.dll</HintPath>
<HintPath>$(ProgramData)\BHoM\Assemblies\BHoM.dll</HintPath>
<Private>False</Private>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="BHoM_Adapter">
<HintPath>C:\ProgramData\BHoM\Assemblies\BHoM_Adapter.dll</HintPath>
<HintPath>$(ProgramData)\BHoM\Assemblies\BHoM_Adapter.dll</HintPath>
<Private>False</Private>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="BHoM_Engine">
<HintPath>C:\ProgramData\BHoM\Assemblies\BHoM_Engine.dll</HintPath>
<HintPath>$(ProgramData)\BHoM\Assemblies\BHoM_Engine.dll</HintPath>
<Private>False</Private>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="Data_Engine">
<HintPath>C:\ProgramData\BHoM\Assemblies\Data_Engine.dll</HintPath>
<HintPath>$(ProgramData)\BHoM\Assemblies\Data_Engine.dll</HintPath>
<Private>False</Private>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="Data_oM">
<HintPath>C:\ProgramData\BHoM\Assemblies\Data_oM.dll</HintPath>
<HintPath>$(ProgramData)\BHoM\Assemblies\Data_oM.dll</HintPath>
<Private>False</Private>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="Geometry_Engine">
<HintPath>C:\ProgramData\BHoM\Assemblies\Geometry_Engine.dll</HintPath>
<HintPath>$(ProgramData)\BHoM\Assemblies\Geometry_Engine.dll</HintPath>
<Private>False</Private>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="Geometry_oM">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\ProgramData\BHoM\Assemblies\Geometry_oM.dll</HintPath>
<HintPath>$(ProgramData)\BHoM\Assemblies\Geometry_oM.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Library_Engine">
<HintPath>C:\ProgramData\BHoM\Assemblies\Library_Engine.dll</HintPath>
<HintPath>$(ProgramData)\BHoM\Assemblies\Library_Engine.dll</HintPath>
<Private>False</Private>
<SpecificVersion>False</SpecificVersion>
</Reference>
Expand All @@ -83,22 +83,27 @@
<Private>False</Private>
</Reference>
<Reference Include="Programming_oM">
<HintPath>C:\ProgramData\BHoM\Assemblies\Programming_oM.dll</HintPath>
<HintPath>$(ProgramData)\BHoM\Assemblies\Programming_oM.dll</HintPath>
<Private>False</Private>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="Quantities_oM">
<HintPath>C:\ProgramData\BHoM\Assemblies\Quantities_oM.dll</HintPath>
<HintPath>$(ProgramData)\BHoM\Assemblies\Quantities_oM.dll</HintPath>
<Private>False</Private>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="Reflection_Engine">
<HintPath>C:\ProgramData\BHoM\Assemblies\Reflection_Engine.dll</HintPath>
<HintPath>$(ProgramData)\BHoM\Assemblies\Reflection_Engine.dll</HintPath>
<Private>False</Private>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="Serialiser_Engine">
<HintPath>C:\ProgramData\BHoM\Assemblies\Serialiser_Engine.dll</HintPath>
<HintPath>$(ProgramData)\BHoM\Assemblies\Serialiser_Engine.dll</HintPath>
<Private>False</Private>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="Settings_Engine">
<HintPath>$(ProgramData)\BHoM\Assemblies\Settings_Engine.dll</HintPath>
<Private>False</Private>
<SpecificVersion>False</SpecificVersion>
</Reference>
Expand Down Expand Up @@ -137,16 +142,16 @@
</Reference>
<Reference Include="Test_oM">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\ProgramData\BHoM\Assemblies\Test_oM.dll</HintPath>
<HintPath>$(ProgramData)\BHoM\Assemblies\Test_oM.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Versioning_Engine">
<HintPath>C:\ProgramData\BHoM\Assemblies\Versioning_Engine.dll</HintPath>
<HintPath>$(ProgramData)\BHoM\Assemblies\Versioning_Engine.dll</HintPath>
<Private>False</Private>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="Versioning_oM">
<HintPath>C:\ProgramData\BHoM\Assemblies\Versioning_oM.dll</HintPath>
<HintPath>$(ProgramData)\BHoM\Assemblies\Versioning_oM.dll</HintPath>
<Private>False</Private>
<SpecificVersion>False</SpecificVersion>
</Reference>
Expand Down Expand Up @@ -274,7 +279,7 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>xcopy "$(TargetDir)$(TargetFileName)" "C:\ProgramData\BHoM\Assemblies" /Y</PostBuildEvent>
<PostBuildEvent>xcopy "$(TargetDir)$(TargetFileName)" "$(ProgramData)\BHoM\Assemblies" /Y</PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
25 changes: 14 additions & 11 deletions BHoM_UI/Global/Initialisation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
Expand Down Expand Up @@ -67,27 +68,29 @@ public static bool Activate()

public static bool LoadToolkitSettings()
{
if (!Directory.Exists(@"C:\ProgramData\BHoM\Settings"))
string directory = Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.CommonApplicationData), "BHoM", "Settings");
if(!Directory.Exists(directory))
{
Engine.Base.Compute.RecordWarning(@"C:\ProgramData\BHoM\Settings doesn't exist. Toolkits setting are not loaded.");
BH.Engine.Base.Compute.RecordWarning($"{directory} doesn't exist. Toolkit settings are not loaded.");
return false;
}

BH.Engine.Settings.Compute.LoadSettings(directory);
BH.Engine.Settings.Compute.LoadSettings(directory, "*.cfg"); //Legacy cfg files to be loaded in

List<ISettings> allSettings = BH.Engine.Settings.Query.GetAllSettings();
List<IInitialisationSettings> initialisationSettings = allSettings.OfType<IInitialisationSettings>().ToList();

bool success = true;
foreach (string file in Directory.GetFiles(@"C:\ProgramData\BHoM\Settings", "*.cfg"))
foreach(var settings in initialisationSettings)
{
try
{
string fileName = Path.GetFileNameWithoutExtension(file);
ISettings settings = Engine.UI.Query.Settings(fileName);

// Initialise the toolkit if needed
if (settings is IInitialisationSettings)
success = InitialiseToolkit(settings as IInitialisationSettings);
success &= InitialiseToolkit(settings);
}
catch (Exception e)
catch(Exception e)
{
Engine.Base.Compute.RecordWarning(@"Failed to load one of the config file. Error:\n" + e.Message);
BH.Engine.Base.Compute.RecordWarning(e, $"Failed to load settings of type {settings.GetType().Name}.");
}
}

Expand Down
2 changes: 1 addition & 1 deletion BHoM_UI/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("6.0.0.0")]
[assembly: AssemblyFileVersion("6.2.0.0")]
[assembly: AssemblyFileVersion("6.3.0.0")]



Expand Down
2 changes: 1 addition & 1 deletion UI_Engine/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("6.0.0.0")]
[assembly: AssemblyFileVersion("6.2.0.0")]
[assembly: AssemblyFileVersion("6.3.0.0")]



Expand Down
2 changes: 1 addition & 1 deletion UI_oM/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("6.0.0.0")]
[assembly: AssemblyFileVersion("6.2.0.0")]
[assembly: AssemblyFileVersion("6.3.0.0")]



Expand Down

0 comments on commit 92fa8a8

Please sign in to comment.