Exemple #1
0
 public PackageParams(NugetSpec spec, SemanticVersion version, string outputPath, bool createSymbols)
 {
     Spec = spec;
     Version = version;
     OutputPath = outputPath;
     CreateSymbols = createSymbols;
 }
Exemple #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;
        }
Exemple #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());
        }
Exemple #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);
        }
Exemple #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;
        }
        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);
        }
Exemple #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;
        }
Exemple #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"));
        }
Exemple #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 });
        }
Exemple #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);
        }
 public MoveNugetAssemblies(NugetSpec nuget, Solution destination)
 {
     _nuget       = nuget;
     _destination = destination;
 }
Exemple #12
0
 public void SetUp()
 {
     var file = FileSystem.Combine("..", "..", "data", "fubumvc","packaging", "nuget", "fubumvc.references.nuspec");
     theSpec = NugetSpec.ReadFrom(file.ToFullPath());
 }
 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);
 }
Exemple #15
0
 public ProjectNuspec(Project project, NugetSpec spec)
 {
     _project = project;
     _spec = spec;
 }
Exemple #16
0
 public SpecGroup(NugetSpec spec, IEnumerable<Project> projects)
 {
     Spec = spec;
     Projects = projects;
 }
Exemple #17
0
 protected bool Equals(NugetSpec other)
 {
     return(_filename.EqualsIgnoreCase(other._filename));
 }
Exemple #18
0
 private PackageBuilder packageBuilderFor(NugetSpec spec, SemanticVersion version)
 {
     return new PackageBuilder(spec.Filename, NullPropertyProvider.Instance, true)
     {
         Version = version
     };
 }
Exemple #19
0
 public void AddNugetSpec(NugetSpec spec)
 {
     _published.Add(spec);
     spec.Publisher = this;
 }
Exemple #20
0
        public string NugetFolderFor(NugetSpec spec)
        {
            var nugetName = spec.Name;

            return NugetFolderFor(nugetName);
        }
Exemple #21
0
 protected bool Equals(NugetSpec other)
 {
     return _filename.EqualsIgnoreCase(other._filename);
 }
Exemple #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"));
        }
Exemple #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;
     }
 }
Exemple #24
0
 public ProjectNuspec(Project project, NugetSpec spec)
 {
     _project = project;
     _spec    = spec;
 }
Exemple #25
0
 public MoveNugetAssemblies(NugetSpec nuget, Solution destination)
 {
     _nuget = nuget;
     _destination = destination;
 }
Exemple #26
0
 public SpecGroup(NugetSpec spec, IEnumerable <Project> projects)
 {
     Spec     = spec;
     Projects = projects;
 }