public async Task LoadExtensionsFromDirectory(IDirectoryAccessor directory, KernelInvocationContext context, IEnumerable <string> additionalDependencies = null) { var extensionsDirectory = directory.GetDirectoryAccessorForRelativePath(_assemblyExtensionsPath); await new KernelExtensionLoader().LoadFromAssembliesInDirectory(extensionsDirectory, context.HandlingKernel, context, additionalDependencies); }
public static IDirectoryAccessor GetDirectoryAccessorFor(this IDirectoryAccessor directory, DirectoryInfo directoryInfo) { var relative = PathUtilities.GetRelativePath( directory.GetFullyQualifiedRoot().FullName, directoryInfo.FullName); return(directory.GetDirectoryAccessorForRelativePath(new RelativeDirectoryPath(relative))); }
public Task <T> Find <T>(PackageDescriptor descriptor) where T : IPackage { if (!descriptor.IsPathSpecified) { if (_directoryAccessor.DirectoryExists(descriptor.Name)) { var directoryAccessor = _directoryAccessor.GetDirectoryAccessorForRelativePath(descriptor.Name); var pkg = new Package2( descriptor, directoryAccessor); if (pkg is T t) { return(Task.FromResult(t)); } } } return(Task.FromResult <T>(default));
public async Task <T> Find <T>(PackageDescriptor descriptor) where T : class, IPackage { if (!descriptor.IsPathSpecified) { if (_directoryAccessor.DirectoryExists(descriptor.Name)) { var directoryAccessor = _directoryAccessor.GetDirectoryAccessorForRelativePath(descriptor.Name); var pkg = new Package2( descriptor, directoryAccessor); pkg.Add(new ProjectAsset(directoryAccessor)); if (pkg is T t) { return(t); } } } return(default);
public async Task LoadExtensionsInDirectory(IDirectoryAccessor directory, KernelInvocationContext context) { var extensionsDirectory = directory.GetDirectoryAccessorForRelativePath(_assemblyExtensionsPath); await new KernelExtensionLoader().LoadFromAssembliesInDirectory(extensionsDirectory, context.HandlingKernel, context); }
public static IDirectoryAccessor GetDirectoryAccessorForRelativePath( this IDirectoryAccessor directoryAccessor, string relativePath) => directoryAccessor.GetDirectoryAccessorForRelativePath(new RelativeDirectoryPath(relativePath));