From ff5f9d63204b8f2f64640a6fab0779f400db4356 Mon Sep 17 00:00:00 2001 From: Alan Rynne Date: Mon, 7 Dec 2020 14:51:43 +0100 Subject: [PATCH] fix: Reorganized solution into two projects Demo project for sample implementations and project for publishing dll --- .gitignore | 6 + ...onent.sln => GrasshopperAsyncComponent.sln | 8 +- .../{Base => }/GH_AsyncComponent.cs | 6 +- .../GrasshopperAsyncComponent.csproj | 156 ++++++------------ .../Properties/AssemblyInfo.cs | 7 +- .../{Base => }/WorkerInstance.cs | 2 +- .../GrasshopperAsyncComponentDemo.csproj | 95 +++++++++++ .../Info/GrasshopperAsyncComponentInfo.cs | 4 +- .../Properties/AssemblyInfo.cs | 36 ++++ .../Sample_PrimeCalculatorAsyncComponent.cs | 3 +- .../Sample_UslessCyclesComponent.cs | 3 +- .../packages.config | 0 12 files changed, 210 insertions(+), 116 deletions(-) mode change 100644 => 100755 .gitignore rename GrasshopperAsyncComponent/GrasshopperAsyncComponent.sln => GrasshopperAsyncComponent.sln (61%) rename GrasshopperAsyncComponent/{Base => }/GH_AsyncComponent.cs (95%) mode change 100644 => 100755 mode change 100644 => 100755 GrasshopperAsyncComponent/GrasshopperAsyncComponent.csproj mode change 100644 => 100755 GrasshopperAsyncComponent/Properties/AssemblyInfo.cs rename GrasshopperAsyncComponent/{Base => }/WorkerInstance.cs (96%) mode change 100644 => 100755 create mode 100644 GrasshopperAsyncComponentDemo/GrasshopperAsyncComponentDemo.csproj rename {GrasshopperAsyncComponent => GrasshopperAsyncComponentDemo}/Info/GrasshopperAsyncComponentInfo.cs (92%) create mode 100644 GrasshopperAsyncComponentDemo/Properties/AssemblyInfo.cs rename {GrasshopperAsyncComponent => GrasshopperAsyncComponentDemo}/SampleImplementations/Sample_PrimeCalculatorAsyncComponent.cs (96%) rename {GrasshopperAsyncComponent => GrasshopperAsyncComponentDemo}/SampleImplementations/Sample_UslessCyclesComponent.cs (96%) rename {GrasshopperAsyncComponent => GrasshopperAsyncComponentDemo}/packages.config (100%) diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 index dfcfd56..74dafe6 --- a/.gitignore +++ b/.gitignore @@ -348,3 +348,9 @@ MigrationBackup/ # Ionide (cross platform F# VS Code tools) working folder .ionide/ + +# IntelliJ folder +.idea/ + +# Mac hidden files +**/.DS_Store \ No newline at end of file diff --git a/GrasshopperAsyncComponent/GrasshopperAsyncComponent.sln b/GrasshopperAsyncComponent.sln similarity index 61% rename from GrasshopperAsyncComponent/GrasshopperAsyncComponent.sln rename to GrasshopperAsyncComponent.sln index 16c4f9b..6d573ca 100644 --- a/GrasshopperAsyncComponent/GrasshopperAsyncComponent.sln +++ b/GrasshopperAsyncComponent.sln @@ -3,7 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.30517.126 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GrasshopperAsyncComponent", "GrasshopperAsyncComponent.csproj", "{695D2B91-DDB6-416E-8A99-DDE6253DA7AA}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GrasshopperAsyncComponent", "GrasshopperAsyncComponent\GrasshopperAsyncComponent.csproj", "{114D5E49-AC13-47F7-A70E-B4289579F4E3}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GrasshopperAsyncComponentDemo", "GrasshopperAsyncComponentDemo\GrasshopperAsyncComponentDemo.csproj", "{695D2B91-DDB6-416E-8A99-DDE6253DA7AA}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -11,6 +13,10 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution + {114D5E49-AC13-47F7-A70E-B4289579F4E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {114D5E49-AC13-47F7-A70E-B4289579F4E3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {114D5E49-AC13-47F7-A70E-B4289579F4E3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {114D5E49-AC13-47F7-A70E-B4289579F4E3}.Release|Any CPU.Build.0 = Release|Any CPU {695D2B91-DDB6-416E-8A99-DDE6253DA7AA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {695D2B91-DDB6-416E-8A99-DDE6253DA7AA}.Debug|Any CPU.Build.0 = Debug|Any CPU {695D2B91-DDB6-416E-8A99-DDE6253DA7AA}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/GrasshopperAsyncComponent/Base/GH_AsyncComponent.cs b/GrasshopperAsyncComponent/GH_AsyncComponent.cs old mode 100644 new mode 100755 similarity index 95% rename from GrasshopperAsyncComponent/Base/GH_AsyncComponent.cs rename to GrasshopperAsyncComponent/GH_AsyncComponent.cs index b2338bc..8cdf0bc --- a/GrasshopperAsyncComponent/Base/GH_AsyncComponent.cs +++ b/GrasshopperAsyncComponent/GH_AsyncComponent.cs @@ -14,11 +14,7 @@ namespace GrasshopperAsyncComponent /// public abstract class GH_AsyncComponent : GH_Component { - public override Guid ComponentGuid { get => new Guid("5DBBD498-0326-4E25-83A5-424D8DC493D4"); } - - protected override System.Drawing.Bitmap Icon { get => null; } - - public override GH_Exposure Exposure => GH_Exposure.hidden; + public override Guid ComponentGuid => throw new Exception("ComponentGuid should be overriden in any descendant of GH_AsyncComponent!"); //List<(string, GH_RuntimeMessageLevel)> Errors; diff --git a/GrasshopperAsyncComponent/GrasshopperAsyncComponent.csproj b/GrasshopperAsyncComponent/GrasshopperAsyncComponent.csproj old mode 100644 new mode 100755 index 49290f1..dd4cab0 --- a/GrasshopperAsyncComponent/GrasshopperAsyncComponent.csproj +++ b/GrasshopperAsyncComponent/GrasshopperAsyncComponent.csproj @@ -1,104 +1,58 @@  - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {695D2B91-DDB6-416E-8A99-DDE6253DA7AA} - Library - Properties - GrasshopperAsyncComponent - GrasshopperAsyncComponent - v4.7.2 - 512 - false - - - - - - true - full - false - bin\ - DEBUG;TRACE - prompt - false - - - pdbonly - true - bin\ - TRACE - prompt - 4 - - - - packages\RhinoCommon.6.29.20238.11501\lib\net45\Eto.dll - - - packages\Grasshopper.6.29.20238.11501\lib\net45\GH_IO.dll - - - packages\Grasshopper.6.29.20238.11501\lib\net45\Grasshopper.dll - - - packages\RhinoCommon.6.29.20238.11501\lib\net45\Rhino.UI.dll - - - packages\RhinoCommon.6.29.20238.11501\lib\net45\RhinoCommon.dll - - - - - - - - - - - - - - - - - - - - - - - - Copy "$(TargetPath)" "$(TargetDir)$(ProjectName).gha" - - - cp "$(TargetPath)" "$(TargetDir)$(ProjectName).gha" - - - en-US - - - C:\Program Files\Rhino 6\System\Rhino.exe - - - Program - - - + + - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + Debug + AnyCPU + {114D5E49-AC13-47F7-A70E-B4289579F4E3} + Library + Properties + GrasshopperAsyncComponent + GrasshopperAsyncComponent + v4.7.2 + 512 - - - - - \ No newline at end of file + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + diff --git a/GrasshopperAsyncComponent/Properties/AssemblyInfo.cs b/GrasshopperAsyncComponent/Properties/AssemblyInfo.cs old mode 100644 new mode 100755 index bc7322f..0dfabe7 --- a/GrasshopperAsyncComponent/Properties/AssemblyInfo.cs +++ b/GrasshopperAsyncComponent/Properties/AssemblyInfo.cs @@ -1,5 +1,4 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following @@ -8,7 +7,7 @@ using System.Runtime.InteropServices; [assembly: AssemblyTitle("GrasshopperAsyncComponent")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Aec systems")] +[assembly: AssemblyCompany("")] [assembly: AssemblyProduct("GrasshopperAsyncComponent")] [assembly: AssemblyCopyright("Copyright © 2020")] [assembly: AssemblyTrademark("")] @@ -20,7 +19,7 @@ using System.Runtime.InteropServices; [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("695d2b91-ddb6-416e-8a99-dde6253da7aa")] +[assembly: Guid("114D5E49-AC13-47F7-A70E-B4289579F4E3")] // Version information for an assembly consists of the following four values: // @@ -33,4 +32,4 @@ using System.Runtime.InteropServices; // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file diff --git a/GrasshopperAsyncComponent/Base/WorkerInstance.cs b/GrasshopperAsyncComponent/WorkerInstance.cs old mode 100644 new mode 100755 similarity index 96% rename from GrasshopperAsyncComponent/Base/WorkerInstance.cs rename to GrasshopperAsyncComponent/WorkerInstance.cs index aec07a6..e633c93 --- a/GrasshopperAsyncComponent/Base/WorkerInstance.cs +++ b/GrasshopperAsyncComponent/WorkerInstance.cs @@ -43,7 +43,7 @@ namespace GrasshopperAsyncComponent /// /// This method is where the actual calculation/computation/heavy lifting should be done. - /// Make sure you always check as frequently as you can if is cancelled. For an example, see the . + /// Make sure you always check as frequently as you can if is cancelled. For an example, see the . /// /// Call this to report progress up to the parent component. /// Call this when everything is done. It will tell the parent component that you're ready to . diff --git a/GrasshopperAsyncComponentDemo/GrasshopperAsyncComponentDemo.csproj b/GrasshopperAsyncComponentDemo/GrasshopperAsyncComponentDemo.csproj new file mode 100644 index 0000000..e0ff5f8 --- /dev/null +++ b/GrasshopperAsyncComponentDemo/GrasshopperAsyncComponentDemo.csproj @@ -0,0 +1,95 @@ + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {695D2B91-DDB6-416E-8A99-DDE6253DA7AA} + Library + Properties + GrasshopperAsyncComponentDemo + GrasshopperAsyncComponentDemo + v4.7.2 + 512 + false + + + + + + true + full + false + bin\ + DEBUG;TRACE + prompt + false + + + pdbonly + true + bin\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + {114d5e49-ac13-47f7-a70e-b4289579f4e3} + GrasshopperAsyncComponent + + + + + + Copy "$(TargetPath)" "$(TargetDir)$(ProjectName).gha" + + + cp "$(TargetPath)" "$(TargetDir)$(ProjectName).gha" + + + en-US + + + C:\Program Files\Rhino 6\System\Rhino.exe + + + Program + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + \ No newline at end of file diff --git a/GrasshopperAsyncComponent/Info/GrasshopperAsyncComponentInfo.cs b/GrasshopperAsyncComponentDemo/Info/GrasshopperAsyncComponentInfo.cs similarity index 92% rename from GrasshopperAsyncComponent/Info/GrasshopperAsyncComponentInfo.cs rename to GrasshopperAsyncComponentDemo/Info/GrasshopperAsyncComponentInfo.cs index 7d7aa1b..c69295a 100644 --- a/GrasshopperAsyncComponent/Info/GrasshopperAsyncComponentInfo.cs +++ b/GrasshopperAsyncComponentDemo/Info/GrasshopperAsyncComponentInfo.cs @@ -2,7 +2,7 @@ using System.Drawing; using Grasshopper.Kernel; -namespace GrasshopperAsyncComponent +namespace GrasshopperAsyncComponentDemo { public class GrasshopperAsyncComponentInfo : GH_AssemblyInfo { @@ -10,7 +10,7 @@ namespace GrasshopperAsyncComponent { get { - return "GrasshopperAsyncComponent"; + return "GrasshopperAsyncComponentDemo"; } } public override Bitmap Icon diff --git a/GrasshopperAsyncComponentDemo/Properties/AssemblyInfo.cs b/GrasshopperAsyncComponentDemo/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..c7df0a6 --- /dev/null +++ b/GrasshopperAsyncComponentDemo/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("GrasshopperAsyncComponentDemo")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Aec systems")] +[assembly: AssemblyProduct("GrasshopperAsyncComponentDemo")] +[assembly: AssemblyCopyright("Copyright © 2020")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("695d2b91-ddb6-416e-8a99-dde6253da7aa")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// 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/GrasshopperAsyncComponent/SampleImplementations/Sample_PrimeCalculatorAsyncComponent.cs b/GrasshopperAsyncComponentDemo/SampleImplementations/Sample_PrimeCalculatorAsyncComponent.cs similarity index 96% rename from GrasshopperAsyncComponent/SampleImplementations/Sample_PrimeCalculatorAsyncComponent.cs rename to GrasshopperAsyncComponentDemo/SampleImplementations/Sample_PrimeCalculatorAsyncComponent.cs index 4efe02b..05394e5 100644 --- a/GrasshopperAsyncComponent/SampleImplementations/Sample_PrimeCalculatorAsyncComponent.cs +++ b/GrasshopperAsyncComponentDemo/SampleImplementations/Sample_PrimeCalculatorAsyncComponent.cs @@ -5,8 +5,9 @@ using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; +using GrasshopperAsyncComponent; -namespace GrasshopperAsyncComponent.SampleImplementations +namespace GrasshopperAsyncComponentDemo.SampleImplementations { public class Sample_PrimeCalculatorAsyncComponent : GH_AsyncComponent { diff --git a/GrasshopperAsyncComponent/SampleImplementations/Sample_UslessCyclesComponent.cs b/GrasshopperAsyncComponentDemo/SampleImplementations/Sample_UslessCyclesComponent.cs similarity index 96% rename from GrasshopperAsyncComponent/SampleImplementations/Sample_UslessCyclesComponent.cs rename to GrasshopperAsyncComponentDemo/SampleImplementations/Sample_UslessCyclesComponent.cs index 0e04ab0..d190a33 100644 --- a/GrasshopperAsyncComponent/SampleImplementations/Sample_UslessCyclesComponent.cs +++ b/GrasshopperAsyncComponentDemo/SampleImplementations/Sample_UslessCyclesComponent.cs @@ -5,8 +5,9 @@ using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; +using GrasshopperAsyncComponent; -namespace GrasshopperAsyncComponent.SampleImplementations +namespace GrasshopperAsyncComponentDemo.SampleImplementations { public class Sample_UselessCyclesAsyncComponent : GH_AsyncComponent { diff --git a/GrasshopperAsyncComponent/packages.config b/GrasshopperAsyncComponentDemo/packages.config similarity index 100% rename from GrasshopperAsyncComponent/packages.config rename to GrasshopperAsyncComponentDemo/packages.config