Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
zeusongit committed Jan 27, 2024
1 parent ed9f905 commit f5eb8fb
Showing 1 changed file with 18 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1336,7 +1336,6 @@ public static PublishPackageViewModel FromLocalPackage(DynamoViewModel dynamoVie
}
case AssemblyLoadingState.AlreadyLoaded:
{
// When retaining the folder structure, we bypass this check as users are in full control of the folder structure.
assembliesLoadedTwice.Add(file);
break;
}
Expand Down Expand Up @@ -1427,12 +1426,7 @@ internal static PublishPackageViewModel FromLocalPackage(DynamoViewModel dynamoV
{
case AssemblyLoadingState.Success:
{
var isNodeLibrary = nodeLibraryNames == null || nodeLibraryNames.Contains(assem.FullName);
pkgViewModel.Assemblies.Add(new PackageAssembly()
{
IsNodeLibrary = isNodeLibrary,
Assembly = assem
});
pkgViewModel.Assemblies.Add(GetPackageAssembly(nodeLibraryNames, assem));
break;
}
case AssemblyLoadingState.NotManagedAssembly:
Expand All @@ -1446,7 +1440,6 @@ internal static PublishPackageViewModel FromLocalPackage(DynamoViewModel dynamoV
// When retaining the folder structure, we bypass this check as users are in full control of the folder structure.
if (pkgViewModel.RetainFolderStructureOverride)
{
//pkgViewModel.AdditionalFiles.Add(file);
if (assem == null)
{
pkgViewModel.AdditionalFiles.Add(file);
Expand All @@ -1455,12 +1448,7 @@ internal static PublishPackageViewModel FromLocalPackage(DynamoViewModel dynamoV
{
if (!pkgViewModel.Assemblies.Any(x => x.Assembly == assem))
{
var isNodeLibrary = nodeLibraryNames == null || nodeLibraryNames.Contains(assem.FullName);
pkgViewModel.Assemblies.Add(new PackageAssembly()
{
IsNodeLibrary = isNodeLibrary,
Assembly = assem
});
pkgViewModel.Assemblies.Add(GetPackageAssembly(nodeLibraryNames, assem));
}
else
{
Expand Down Expand Up @@ -1499,6 +1487,22 @@ internal static PublishPackageViewModel FromLocalPackage(DynamoViewModel dynamoV

}

/// <summary>
/// Gets a Package Assembly object, if the assembly exist in the node libraries list, the IsNodeLibrary flag will be set to true.
/// </summary>
/// <param name="nodeLibraries">List of existing node libraries</param>
/// <param name="assem">Assembly file</param>
/// <returns>Package Assembly</returns>
private static PackageAssembly GetPackageAssembly(IEnumerable<string> nodeLibraries, Assembly assem)
{
var isNodeLibrary = nodeLibraries == null || nodeLibraries.Contains(assem.FullName);
return new PackageAssembly()
{
IsNodeLibrary = isNodeLibrary,
Assembly = assem
};
}

public void OnPublishSuccess()
{
if (PublishSuccess != null)
Expand Down Expand Up @@ -2696,14 +2700,5 @@ internal PackageItemRootViewModel GetPreBuildRootItemViewModel(string publishPat

return rootItemPreview;
}

//private static MetadataLoadContext InitSharedPublishLoadContext()
//{
// // Retrieve the location of the assembly and the referenced assemblies used by the domain
// var runtimeAssemblies = Directory.GetFiles(RuntimeEnvironment.GetRuntimeDirectory(), "*.dll");
// // Create PathAssemblyResolver that can resolve assemblies using the created list.
// var resolver = new PathAssemblyResolver(runtimeAssemblies);
// return new MetadataLoadContext(resolver);
//}
}
}

0 comments on commit f5eb8fb

Please sign in to comment.