Exemplo n.º 1
0
 public PackageParams(NugetSpec spec, SemanticVersion version, string outputPath, bool createSymbols)
 {
     Spec = spec;
     Version = version;
     OutputPath = outputPath;
     CreateSymbols = createSymbols;
 }
Exemplo n.º 2
0
        public string CreatePackage(NugetSpec spec, SemanticVersion version, string outputPath)
        {
            var builder = packageBuilderFor(spec, version);
            var nupkgFileName = Path.Combine(outputPath, "{0}.{1}.nupkg".ToFormat(spec.Name, version));

            createPackage(builder, nupkgFileName);

            return nupkgFileName;
        }
Exemplo n.º 3
0
        public void SetUp()
        {
            var theFilename = "fubumvc.core.nuspec";
            var stream = GetType()
                    .Assembly
                    .GetManifestResourceStream(typeof(DataMother), "FubuMVCNuspecTemplate.txt");

            new FileSystem().WriteStreamToFile(theFilename, stream);
            theSpec = NugetSpec.ReadFrom(theFilename.ToFullPath());
        }
Exemplo n.º 4
0
        public static NugetSpec ReadFrom(string filename)
        {
            var document = new NuspecDocument(filename);

            var spec = new NugetSpec(document.Name, filename);

            spec._dependencies.AddRange(document.FindDependencies());
            spec._publishedAssemblies.AddRange(document.FindPublishedAssemblies());

            return(spec);
        }
Exemplo n.º 5
0
        public static NugetSpec ReadFrom(string filename)
        {
            var document = new NuspecDocument(filename);

            var spec = new NugetSpec(document.Name, filename);

            spec._dependencies.AddRange(document.FindDependencies());
            spec._publishedAssemblies.AddRange(document.FindPublishedAssemblies());

            return spec;
        }
Exemplo n.º 6
0
        public void add_a_nuget_spec_should_add_it_to_the_collection_and_set_itself_as_the_publisher_to_the_spec()
        {
            var spec = new NugetSpec("fubucore", "somefile.nuspec");

            var solution = new Solution(new SolutionConfig()
            {
                SourceFolder = "src"
            }, "directory1");

            solution.AddNugetSpec(spec);

            spec.Publisher.ShouldBeTheSameAs(solution);
            solution.PublishedNugets.ShouldContain(spec);
        }
Exemplo n.º 7
0
        public string CreatePackage(NugetSpec spec, SemanticVersion version, string outputPath)
        {
            var builder = packageBuilderFor(spec, version);
            var nupkgFileName = Path.Combine(outputPath, "{0}.{1}.nupkg".ToFormat(spec.Name, version));

            var package = createPackage(builder, nupkgFileName);
            var issues = package.Validate(Rules);

            if (issues.Any(x => x.Level == PackageIssueLevel.Error))
            {
                Console.ForegroundColor = ConsoleColor.Red;
                issues.Each(issue => Console.WriteLine("[{0}] {1} - {2}", issue.Level, issue.Title, issue.Description));
                Console.ResetColor();

                RippleAssert.Fail("Package failed validation");
            }

            return nupkgFileName;
        }
Exemplo n.º 8
0
        public void get_nuget_directory()
        {
            var solution = new Solution
            {
                SourceFolder = "source",
                Directory = ".".ToFullPath()
            };

            var storage = new StubNugetStorage();
            storage.Add("FubuCore", "0.9.1.37");
            solution.UseStorage(storage);

            var project = new Project("something.csproj");
            var dependency = new Dependency("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.PackagesDirectory(), "FubuCore"));
        }
Exemplo n.º 9
0
        public void SetUp()
        {
            theSolution = new Solution();
            p1 = theSolution.AddProject("MyProject");

            p1.AddDependency("Bottles");
            p1.AddDependency("FubuCore");
            p1.AddDependency("FubuLocalization");

            p2 = theSolution.AddProject("MyOtherProject");
            p2.AddDependency("FubuMVC.Core");

            theSolution.AddDependency(new Dependency("Bottles", "1.0.0.0", UpdateMode.Fixed));
            theSolution.AddDependency(new Dependency("FubuCore", "1.1.0.0", UpdateMode.Float));
            theSolution.AddDependency(new Dependency("FubuLocalization", "1.2.0.0", UpdateMode.Fixed));
            theSolution.AddDependency(new Dependency("FubuMVC.Core", "1.4.0.0", UpdateMode.Fixed));

            theNugetSpec = new NugetSpec("MyProject", "myproject.nuspec");
            // explicit dependencies are not overridden
            theNugetSpec.Dependencies.Add(new NuspecDependency("Bottles", "1.0.0.0"));

            theGroup = new SpecGroup(theNugetSpec, new[] { p1, p2 });
        }
Exemplo n.º 10
0
        public string NugetFolderFor(NugetSpec spec)
        {
            var dependency = Projects.SelectMany(x => x.NugetDependencies).Distinct()
                .Single(x => x.Name == spec.Name);

            return _directory.AppendPath(_config.SourceFolder, "packages", spec.Name + "." + dependency.Version);
        }
Exemplo n.º 11
0
 public MoveNugetAssemblies(NugetSpec nuget, Solution destination)
 {
     _nuget       = nuget;
     _destination = destination;
 }
Exemplo n.º 12
0
 public void SetUp()
 {
     var file = FileSystem.Combine("..", "..", "data", "fubumvc","packaging", "nuget", "fubumvc.references.nuspec");
     theSpec = NugetSpec.ReadFrom(file.ToFullPath());
 }
Exemplo n.º 13
0
 private PackageBuilder symbolsPackageBuilderFor(NugetSpec spec, SemanticVersion version)
 {
     return packageBuilderFor(spec, version);
 }
 private void verifyVersion(NugetSpec spec, string name, string version)
 {
     spec.FindDependency(name).VersionSpec.ToString().ShouldEqual(version);
 }
Exemplo n.º 15
0
 public ProjectNuspec(Project project, NugetSpec spec)
 {
     _project = project;
     _spec = spec;
 }
Exemplo n.º 16
0
 public SpecGroup(NugetSpec spec, IEnumerable<Project> projects)
 {
     Spec = spec;
     Projects = projects;
 }
Exemplo n.º 17
0
 protected bool Equals(NugetSpec other)
 {
     return(_filename.EqualsIgnoreCase(other._filename));
 }
Exemplo n.º 18
0
 private PackageBuilder packageBuilderFor(NugetSpec spec, SemanticVersion version)
 {
     return new PackageBuilder(spec.Filename, NullPropertyProvider.Instance, true)
     {
         Version = version
     };
 }
Exemplo n.º 19
0
 public void AddNugetSpec(NugetSpec spec)
 {
     _published.Add(spec);
     spec.Publisher = this;
 }
Exemplo n.º 20
0
        public string NugetFolderFor(NugetSpec spec)
        {
            var nugetName = spec.Name;

            return NugetFolderFor(nugetName);
        }
Exemplo n.º 21
0
 protected bool Equals(NugetSpec other)
 {
     return _filename.EqualsIgnoreCase(other._filename);
 }
Exemplo n.º 22
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"));
        }
Exemplo n.º 23
0
 private PackageBuilder packageBuilderFor(NugetSpec spec, SemanticVersion version)
 {
     try
     {
         return new PackageBuilder(spec.Filename, NullPropertyProvider.Instance, true)
         {
             Version = version
         };
     }
     catch (Exception exc)
     {
         RippleAssert.Fail("Error creating package: " + exc.Message);
         return null;
     }
 }
Exemplo n.º 24
0
 public ProjectNuspec(Project project, NugetSpec spec)
 {
     _project = project;
     _spec    = spec;
 }
Exemplo n.º 25
0
 public MoveNugetAssemblies(NugetSpec nuget, Solution destination)
 {
     _nuget = nuget;
     _destination = destination;
 }
Exemplo n.º 26
0
 public SpecGroup(NugetSpec spec, IEnumerable <Project> projects)
 {
     Spec     = spec;
     Projects = projects;
 }