Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

6.3 Deployment #470

Merged
merged 5 commits into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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