Example #1
0
 public InMemoryEnvironment()
 {
     UserRepository = new InMemoryRepository();
     RemoteRepository = new InMemoryRepository();
     RemoteRepositories = new List<InMemoryRepository> { RemoteRepository };
     Descriptor = new WrapDescriptor();
 }
 public InMemoryEnvironment(IDirectory currentDirectory, IDirectory configDirectory)
 {
     CurrentDirectory = currentDirectory;
     SystemRepository = new InMemoryRepository("System repository");
     RemoteRepository = new InMemoryRepository("Remote repository");
     CurrentDirectoryRepository = new InMemoryRepository("Current directory repository");
     RemoteRepositories = new List<InMemoryRepository> { RemoteRepository };
     Descriptor = new WrapDescriptor() { File = CurrentDirectory.GetFile("descriptor.wrapdesc").MustExist()};
     ConfigurationDirectory = configDirectory;
 }
 void Add(InMemoryRepository repository, string name, string[] dependencies)
 {
     var package = new InMemoryPackage
     {
             Name = PackageNameUtility.GetName(name),
             SemanticVersion = PackageNameUtility.GetVersion(name),
             Source = repository,
             Dependencies = dependencies.Select(DependsParser.ParseDependsLine).ToList()
     };
     repository.Packages.Add(package);
 }
 public dependency_resolver_context()
 {
     DependencyDescriptor = new PackageDescriptor
     {
             Name = "test",
             SemanticVersion = "1.0".ToSemVer()
     };
     ProjectRepository = new InMemoryRepository("Local repository");
     SystemRepository = new InMemoryRepository("System repository");
     RemoteRepository = new InMemoryRepository("Remote repository");
     CurrentDirectoryRepository = new InMemoryRepository("Current repository");
 }
 public InMemoryEnvironment(IDirectory currentDirectory, IDirectory configDirectory)
 {
     CurrentDirectory = currentDirectory;
     SystemRepository = new InMemoryRepository("System repository");
     RemoteRepository = new InMemoryRepository("Remote repository");
     CurrentDirectoryRepository = new InMemoryRepository("Current directory repository");
     RemoteRepositories = new List<InMemoryRepository> { RemoteRepository };
     DescriptorFile = CurrentDirectory.GetFile("descriptor.wrapdesc").MustExist();
     Descriptor = new PackageDescriptor();
     ConfigurationDirectory = configDirectory;
     ScopedDescriptors = new Dictionary<string, FileBased<IPackageDescriptor>>(StringComparer.OrdinalIgnoreCase);
     ScopedDescriptors[string.Empty] = FileBased.New(DescriptorFile, Descriptor);
 }
Example #6
0
 public ZipFilePackage(IFile packageFile)
 {
     PackageFile = packageFile;
     _identifier = new LazyValue<PackageIdentifier>(() => new PackageIdentifier(Name, SemanticVersion));
     Source = new InMemoryRepository("Null repository.") { Packages = { this } };
 }
 void Add(InMemoryRepository repository, string name, string[] dependencies)
 {
     var packageNamespace = name.Contains("/") ? name.Substring(0,name.IndexOf("/")) : "global";
     name = name.Contains("/") ? name.Substring(name.IndexOf("/") + 1) : name;
     var package = new InMemoryPackage
     {
             Name = PackageNameUtility.GetName(name),
             Version = PackageNameUtility.GetVersion(name),
             Namespace = packageNamespace,
             Source = repository,
             Dependencies = dependencies.SelectMany(x => DependsParser.ParseDependsInstruction(x).Dependencies)
                     .ToList()
     };
     repository.Packages.Add(package);
 }
 public folder_repository()
 {
     file_system = new InMemoryFileSystem();
     repository_directory = file_system.CreateTempDirectory();
     source_repository = new InMemoryRepository("somewhere");
 }