public TestMetadataReferenceResolver(
     RelativePathResolver pathResolver = null,
     Dictionary<string, PortableExecutableReference> assemblyNames = null,
     Dictionary<string, PortableExecutableReference> files = null)
 {
     _pathResolver = pathResolver;
     _assemblyNames = assemblyNames ?? new Dictionary<string, PortableExecutableReference>();
     _files = files ?? new Dictionary<string, PortableExecutableReference>();
 }
 internal virtual MetadataReferenceResolver GetCommandLineMetadataReferenceResolver(TouchedFileLogger loggerOpt)
 {
     var pathResolver = new RelativePathResolver(Arguments.ReferencePaths, Arguments.BaseDirectory);
     return new LoggingMetadataFileReferenceResolver(pathResolver, GetMetadataProvider(), loggerOpt);
 }
        public void ResolvePath_Order()
        {
            var dir = Temp.CreateDirectory();
            var dir1 = dir.CreateDirectory("dir1");
            var dir2 = dir.CreateDirectory("dir2");

            var f1 = dir1.CreateFile("f.dll").Path;
            var f2 = dir2.CreateFile("f.dll").Path;

            var resolver = new RelativePathResolver(
                ImmutableArray.Create(dir1.Path, dir2.Path),
                baseDirectory: null);

            var path = resolver.ResolvePath("f.dll", null);
            Assert.Equal(f1, path);
        }
Exemple #4
0
 internal RuntimeMetadataReferenceResolver WithRelativePathResolver(RelativePathResolver resolver)
 {
     return(Equals(resolver, PathResolver) ? this :
            new RuntimeMetadataReferenceResolver(resolver, PackageResolver, GacFileResolver, _fileReferenceProvider));
 }
        public WorkspaceMetadataFileReferenceResolver(IMetadataService metadataService, RelativePathResolver pathResolver)
        {
            Debug.Assert(metadataService != null);
            Debug.Assert(pathResolver != null);

            _metadataService = metadataService;
            _pathResolver    = pathResolver;
        }
Exemple #6
0
 /// <summary>
 /// Get the relative path to another directory.
 /// </summary>
 /// <param name="to">The target directory path.</param>
 /// <returns>A <see cref="DirectoryPath"/>.</returns>
 public DirectoryPath GetRelativePath(DirectoryPath to)
 {
     return(RelativePathResolver.Resolve(this, to));
 }