Ejemplo n.º 1
0
        public void RemoveFromFileSystem(NugetDependency dependency)
        {
            ConsoleWriter.PrintHorizontalLine();
            ConsoleWriter.Write(ConsoleColor.Cyan, "Removing " + dependency);

            var package = _localRepository.FindPackage(dependency.Name, new SemanticVersion(dependency.Version));

            if (package != null) _localRepository.RemovePackage(package);
        }
Ejemplo n.º 2
0
 public bool Equals(NugetDependency other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(Equals(other._name, _name) && Equals(other._version, _version));
 }
Ejemplo n.º 3
0
        public void different_version_of()
        {
            var dep1 = new NugetDependency("A", "1.0");
            var dep2 = new NugetDependency("A", "1.1");
            var dep3 = new NugetDependency("A", "1.1");
            var dep4 = new NugetDependency("B", "1.1");

            dep1.DifferentVersionOf(dep2).ShouldBeTrue();
            dep2.DifferentVersionOf(dep1).ShouldBeTrue();

            dep2.DifferentVersionOf(dep3).ShouldBeFalse();
            dep4.DifferentVersionOf(dep3).ShouldBeFalse();
        }
Ejemplo n.º 4
0
 public bool DifferentVersionOf(NugetDependency dependency)
 {
     return(Name == dependency.Name && Version != dependency.Version);
 }
Ejemplo n.º 5
0
 public void Install(NugetDependency dependency)
 {
     _packageManager.InstallPackage(dependency.Name, new SemanticVersion(dependency.Version), true, true);
 }
Ejemplo n.º 6
0
 public void AddDependency(NugetDependency dependency)
 {
     _nugetDependencies.Add(dependency);
 }
Ejemplo n.º 7
0
        public bool ShouldBeUpdated(NugetDependency latest)
        {
            if (ProjectFile.IsEmpty()) return false;

            var current = _nugetDependencies.Where(x => x.Name == latest.Name).FirstOrDefault();
            if (current != null)
            {
                return current.Version != latest.Version;
            }

            return false;
        }
Ejemplo n.º 8
0
 public void Install(NugetDependency dependency)
 {
     var version = new Version(dependency.Version);
     _packageManager.InstallPackage(dependency.Name, version, true);
 }
Ejemplo n.º 9
0
        public void get_nuget_directory()
        {
            var solution = new Solution(new SolutionConfig()
            {
                SourceFolder = "source"
            }, ".".ToFullPath());

            var project = new Project("something.csproj");
            var dependency = new NugetDependency("FubuCore", "0.9.1.37");
            project.AddDependency(dependency);
            solution.AddProject(project);

            var spec = new NugetSpec("FubuCore", "somefile.nuspec");

            solution.NugetFolderFor(spec)
                .ShouldEqual(".".ToFullPath().AppendPath(solution.Config.SourceFolder, "packages", "FubuCore.0.9.1.37"));
        }
Ejemplo n.º 10
0
 public bool Equals(NugetDependency other)
 {
     if (ReferenceEquals(null, other)) return false;
     if (ReferenceEquals(this, other)) return true;
     return Equals(other._name, _name) && Equals(other._version, _version);
 }
Ejemplo n.º 11
0
 public bool DifferentVersionOf(NugetDependency dependency)
 {
     return Name == dependency.Name && Version != dependency.Version;
 }
Ejemplo n.º 12
0
 public void Install(NugetDependency dependency)
 {
     var version = new Version(dependency.Version);
     _packageManager.InstallPackage(dependency.Name, new SemanticVersion(version), true, false);
 }