public void Initialize()
        {
            FileSystem = LocalFileSystem.Instance;

            var descriptors = new PackageDescriptorReader().ReadAll(CurrentDirectory);
            if (descriptors.ContainsKey(string.Empty))
            {
                DescriptorFile = descriptors[string.Empty].File;
                Descriptor = descriptors[string.Empty].Value;
            }

            ScopedDescriptors = descriptors;
            TryInitializeProjectRepository();

            CurrentDirectoryRepository = new CurrentDirectoryRepository();

            SystemRepository = new FolderRepository(FileSystem.GetDirectory(DefaultInstallationPaths.SystemRepositoryDirectory))
            {
                    Name = "System repository"
            };

            ConfigurationDirectory = FileSystem.GetDirectory(DefaultInstallationPaths.ConfigurationDirectory);

            RemoteRepositories = new RemoteRepositoryBuilder(FileSystem, Services.Services.GetService<IConfigurationManager>()).GetConfiguredPackageRepositories().ToList();
            ExecutionEnvironment = new ExecutionEnvironment
            {
                    Platform = IntPtr.Size == 4 ? "x86" : "x64",
                    Profile = Environment.Version.Major >= 4 ? "net40" : "net35"
            };
        }
 protected void given_current_folder_repository()
 {
     Repository = new CurrentDirectoryRepository();
 }
        public void Initialize()
        {
            FileSystem = LocalFileSystem.Instance;
            DescriptorFile = CurrentDirectory
                    .AncestorsAndSelf()
                    .SelectMany(x => x.Files("*.wrapdesc"))
                    .FirstOrDefault();
            if (DescriptorFile != null)
                Descriptor = new PackageDescriptorReaderWriter().Read(DescriptorFile);

            TryInitializeProjectRepository();

            CurrentDirectoryRepository = new CurrentDirectoryRepository();

            SystemRepository = new FolderRepository(FileSystem.GetDirectory(InstallationPaths.UserRepositoryPath))
            {
                Name = "System repository"
            };

            ConfigurationDirectory = FileSystem.GetDirectory(InstallationPaths.ConfigurationDirectory);

            RemoteRepositories = Services.Services.GetService<IConfigurationManager>().LoadRemoteRepositories()
                    .OrderBy(x => x.Value.Priority)
                    .Select(x => CreateRemoteRepository(x.Key, x.Value.Href))
                    .Where(x => x != null)
                    .Cast<IPackageRepository>()
                    .ToList();

            ExecutionEnvironment = new ExecutionEnvironment
            {
                Platform = IntPtr.Size == 4 ? "x86" : "x64",
                Profile = "net35"
            };
        }
        public void Initialize()
        {
            FileSystem = LocalFileSystem.Instance;
            DescriptorFile = CurrentDirectory
                    .AncestorsAndSelf()
                    .SelectMany(x => x.Files("*.wrapdesc"))
                    .FirstOrDefault();
            if (DescriptorFile != null)
                Descriptor = new PackageDescriptorReaderWriter().Read(DescriptorFile);

            TryInitializeProjectRepository();

            CurrentDirectoryRepository = new CurrentDirectoryRepository();

            SystemRepository = new FolderRepository(FileSystem.GetDirectory(DefaultInstallationPaths.SystemRepositoryDirectory))
            {
                    Name = "System repository"
            };

            ConfigurationDirectory = FileSystem.GetDirectory(DefaultInstallationPaths.ConfigurationDirectory);

            RemoteRepositories = new RemoteRepositoryBuilder(FileSystem, Services.Services.GetService<IConfigurationManager>()).GetConfiguredPackageRepositories().ToList();
            ExecutionEnvironment = new ExecutionEnvironment
            {
                    Platform = IntPtr.Size == 4 ? "x86" : "x64",
                    Profile = Environment.Version.Major >= 4 ? "net40" : "net35"
            };
        }
        public void Initialize()
        {
            FileSystem = LocalFileSystem.Instance;
            SystemRepositoryDirectory = SystemRepositoryDirectory ?? FileSystem.GetDirectory(DefaultInstallationPaths.SystemRepositoryDirectory);

            TryInitializeProject();

            CurrentDirectoryRepository = new CurrentDirectoryRepository();

            SystemRepository = new FolderRepository(SystemRepositoryDirectory)
            {
                Name = "System repository"
            };

            ConfigurationDirectory = FileSystem.GetDirectory(DefaultInstallationPaths.ConfigurationDirectory);

            ExecutionEnvironment = new ExecutionEnvironment
            {
                Platform = IntPtr.Size == 4 ? "x86" : "x64",
                Profile = Environment.Version.Major >= 4 ? "net40" : "net35"
            };
        }
        public void Initialize()
        {
            FileSystem = LocalFileSystem.Instance;
            Descriptor = CurrentDirectory
                .AncestorsAndSelf()
                .SelectMany(x => x.Files("*.wrapdesc"))
                .Select(x=>new WrapDescriptorParser().ParseFile(x))
                .FirstOrDefault();

            var projectRepositoryDirectory = Descriptor == null
                ? null
                : Descriptor.File.Parent
                    .AncestorsAndSelf()
                    .SelectMany(x => x.Directories("wraps"))
                    .Where(x => x != null)
                    .FirstOrDefault();

            if (projectRepositoryDirectory != null)
                ProjectRepository = new FolderRepository(projectRepositoryDirectory, true)
                {
                    Name = "Project repository"
                };

            CurrentDirectoryRepository = new CurrentDirectoryRepository();

            SystemRepository = new FolderRepository(FileSystem.GetDirectory(InstallationPaths.UserRepositoryPath), false)
            {
                Name="System repository"
            };

            ConfigurationDirectory = FileSystem.GetDirectory(InstallationPaths.ConfigurationDirectory);

            RemoteRepositories = WrapServices.GetService<IConfigurationManager>().LoadRemoteRepositories()
                .Select(x => new HttpRepository(FileSystem, new HttpRepositoryNavigator(x.Value.Href)))
                .Cast<IPackageRepository>()
                .ToList();

            ExecutionEnvironment = new ExecutionEnvironment
            {
                Platform = IntPtr.Size == 4 ? "x86" : "x64",
                Profile = "net35"
            };
        }