From 5d9eb8170e7dfe8a1c10d9e557314d6aa669cced Mon Sep 17 00:00:00 2001 From: Ashish Aggarwal Date: Mon, 29 Jan 2024 17:59:02 -0500 Subject: [PATCH] revert docs change to add retain feature --- .../Docs/PublishPackageDocumentation.html | 2 -- .../Pages/PublishPackageSelectPage.xaml | 3 +-- src/DynamoPackages/PackageDirectoryBuilder.cs | 2 +- src/DynamoPackages/PackageManagerClient.cs | 6 +++++- .../Properties/Resources.Designer.cs | 20 ++++++++++++++++++- .../Properties/Resources.en-US.resx | 7 +++++++ src/DynamoPackages/Properties/Resources.resx | 7 +++++++ 7 files changed, 40 insertions(+), 7 deletions(-) diff --git a/src/DynamoCoreWpf/ViewModels/PackageManager/Docs/PublishPackageDocumentation.html b/src/DynamoCoreWpf/ViewModels/PackageManager/Docs/PublishPackageDocumentation.html index e03a4a6459f..92ab78e61fd 100644 --- a/src/DynamoCoreWpf/ViewModels/PackageManager/Docs/PublishPackageDocumentation.html +++ b/src/DynamoCoreWpf/ViewModels/PackageManager/Docs/PublishPackageDocumentation.html @@ -256,7 +256,6 @@

Adding package files

In either case, the assembly must be tagged as a node library. Currently, for assemblies marked as node library that contain NodeModel or NodeCustomization types, all other types will be ignored. For this reason, it is important to separate NodeModel/NodeViewCustomization types from types you wish to import using ZeroTouch import.

-

Preview Package Contents:
When you are satisfied with your package contents, click Next to see a preview of how the package files will be set up once they are published. diff --git a/src/DynamoCoreWpf/Views/PackageManager/Pages/PublishPackageSelectPage.xaml b/src/DynamoCoreWpf/Views/PackageManager/Pages/PublishPackageSelectPage.xaml index c60d7f6ab0e..1b612f53b79 100644 --- a/src/DynamoCoreWpf/Views/PackageManager/Pages/PublishPackageSelectPage.xaml +++ b/src/DynamoCoreWpf/Views/PackageManager/Pages/PublishPackageSelectPage.xaml @@ -583,7 +583,6 @@ - + diff --git a/src/DynamoPackages/PackageDirectoryBuilder.cs b/src/DynamoPackages/PackageDirectoryBuilder.cs index 15456e8d17c..c64f1d0c1ff 100644 --- a/src/DynamoPackages/PackageDirectoryBuilder.cs +++ b/src/DynamoPackages/PackageDirectoryBuilder.cs @@ -220,7 +220,7 @@ internal void CopyFilesIntoRetainedPackageDirectory(IEnumerable 1 ? GetLongestCommonPrefix(files.ToArray()) : Path.GetDirectoryName(files.First()); + var commonPath = files.Count() > 1 ? GetLongestCommonPrefix(files.ToArray()) : Path.GetDirectoryName(files.FirstOrDefault()); commonPath = commonPath.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); var commonRootPath = Path.GetDirectoryName(commonPath); if (commonRootPath == null) commonRootPath = commonPath; // already at the root diff --git a/src/DynamoPackages/PackageManagerClient.cs b/src/DynamoPackages/PackageManagerClient.cs index b224e0f398d..17b030fb398 100644 --- a/src/DynamoPackages/PackageManagerClient.cs +++ b/src/DynamoPackages/PackageManagerClient.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Threading.Tasks; using Dynamo.Graph.Workspaces; @@ -273,9 +274,12 @@ internal void Publish(Package package, object files, IEnumerable markdow packageUploadHandle.Error(ret.message); return; } - packageUploadHandle.Done(null); } + catch (IOException e) + { + packageUploadHandle.Error(DynamoPackages.Properties.Resources.CannotRemovePackageAssemblyTitle + ": " + DynamoPackages.Properties.Resources.CannotRemovePackageAssemblyMessage + "(" + e.Message + ")"); + } catch (Exception e) { packageUploadHandle.Error(e.GetType() + ": " + e.Message); diff --git a/src/DynamoPackages/Properties/Resources.Designer.cs b/src/DynamoPackages/Properties/Resources.Designer.cs index f9878dbb1e0..01e80ea776c 100644 --- a/src/DynamoPackages/Properties/Resources.Designer.cs +++ b/src/DynamoPackages/Properties/Resources.Designer.cs @@ -1,4 +1,4 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:4.0.30319.42000 @@ -60,6 +60,24 @@ internal Resources() { } } + ///

+ /// Looks up a localized string similar to Due to limitations in the .NET framework, it is not possible to update your package assembly while it is already loaded. Please update the assembly while Dynamo is not running and try again.. + /// + public static string CannotRemovePackageAssemblyMessage { + get { + return ResourceManager.GetString("CannotRemovePackageAssemblyMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot update assembly. + /// + public static string CannotRemovePackageAssemblyTitle { + get { + return ResourceManager.GetString("CannotRemovePackageAssemblyTitle", resourceCulture); + } + } + /// /// Looks up a localized string similar to The folder '{0}' does not exist. /// diff --git a/src/DynamoPackages/Properties/Resources.en-US.resx b/src/DynamoPackages/Properties/Resources.en-US.resx index f7f23ffc713..68931e86a17 100644 --- a/src/DynamoPackages/Properties/Resources.en-US.resx +++ b/src/DynamoPackages/Properties/Resources.en-US.resx @@ -117,6 +117,13 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Due to limitations in the .NET framework, it is not possible to update your package assembly while it is already loaded. Please update the assembly while Dynamo is not running and try again. + The message is shown when a user tries to remove assemblies from a loaded package. + + + Cannot update assembly + The folder '{0}' does not exist This warning message is shown (during start up) when user specifies additional folders in DynamoSettings.xml file but the folders do not exist. diff --git a/src/DynamoPackages/Properties/Resources.resx b/src/DynamoPackages/Properties/Resources.resx index f7f23ffc713..68931e86a17 100644 --- a/src/DynamoPackages/Properties/Resources.resx +++ b/src/DynamoPackages/Properties/Resources.resx @@ -117,6 +117,13 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Due to limitations in the .NET framework, it is not possible to update your package assembly while it is already loaded. Please update the assembly while Dynamo is not running and try again. + The message is shown when a user tries to remove assemblies from a loaded package. + + + Cannot update assembly + The folder '{0}' does not exist This warning message is shown (during start up) when user specifies additional folders in DynamoSettings.xml file but the folders do not exist.