Skip to content

Commit

Permalink
VCI-779: Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
krankenbro committed Jan 24, 2024
1 parent 58980b4 commit 2b930b9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/VirtoCommerce.Build/PlatformTools/Build.PackageManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ private static void AddCommerceModules(IModuleCatalog externalModuleCatalog, Lis
modules.AddRange(commerceModules);
}

private IEnumerable<ModuleItem> ParseModuleParameter(string[] moduleStrings)
private static IEnumerable<ModuleItem> ParseModuleParameter(string[] moduleStrings)
{
foreach (var moduleString in moduleStrings)
{
Expand Down Expand Up @@ -292,7 +292,7 @@ private static async Task InstallPlatformAsync(string platformVersion, string pl
}
}

private string GetDiscoveryPath()
private static string GetDiscoveryPath()
{
var configuration = AppSettings.GetConfiguration(RootDirectory, AppsettingsPath);
return DiscoveryPath.EmptyToNull() ?? configuration.GetModulesDiscoveryPath();
Expand Down
18 changes: 7 additions & 11 deletions src/VirtoCommerce.Build/PlatformTools/LocalCatalog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -169,18 +169,14 @@ private void CopyAssemblies(string sourceParentPath, string targetDirectoryPath)

if (Directory.Exists(sourceDirectoryPath))
{
foreach (var sourceFilePath in Directory.EnumerateFiles(sourceDirectoryPath, "*.*", SearchOption.AllDirectories))
foreach (var sourceFilePath in Directory.EnumerateFiles(sourceDirectoryPath, "*.*", SearchOption.AllDirectories).Where(f => IsAssemblyRelatedFile(f)))
{
// Copy all assembly related files except assemblies that are inlcuded in TPA list
if (IsAssemblyRelatedFile(sourceFilePath))
{
// Copy localization resource files to related subfolders
var targetFilePath = Path.Combine(
IsLocalizationFile(sourceFilePath) ? Path.Combine(targetDirectoryPath, Path.GetFileName(Path.GetDirectoryName(sourceFilePath)))
: targetDirectoryPath,
Path.GetFileName(sourceFilePath));
CopyFile(sourceFilePath, targetFilePath);
}
// Copy localization resource files to related subfolders
var targetFilePath = Path.Combine(
IsLocalizationFile(sourceFilePath) ? Path.Combine(targetDirectoryPath, Path.GetFileName(Path.GetDirectoryName(sourceFilePath)))
: targetDirectoryPath,
Path.GetFileName(sourceFilePath));
CopyFile(sourceFilePath, targetFilePath);
}
}
}
Expand Down

0 comments on commit 2b930b9

Please sign in to comment.