예제 #1
0
        public void can_change_the_name()
        {
            theDocument.Name = "FubuCore-Edge";
            theDocument.SaveChanges();

            var document2 = new NuspecDocument(theFilename);
            document2.Name.ShouldEqual("FubuCore-Edge");
        }
예제 #2
0
        public void make_release()
        {
            theDocument.MakeEdge();
            theDocument.MakeRelease();

            theDocument.Name.ShouldEqual("FubuCore");

            var document2 = new NuspecDocument(theFilename);
            document2.Name.ShouldEqual("FubuCore");
        }
예제 #3
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);
        }
예제 #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;
        }
예제 #5
0
        public void SetUp()
        {
            theFilename = "fubucore.nuspec";
            var stream = GetType()
                    .Assembly
                    .GetManifestResourceStream(typeof(DataMother), "FubuCoreNuspecTemplate.txt");

            new FileSystem().WriteStreamToFile(theFilename, stream);

            theDocument = new NuspecDocument(theFilename);
        }
예제 #6
0
        public void make_edge()
        {
            theDocument.MakeEdge();

            var document2 = new NuspecDocument(theFilename);
            document2.Name.ShouldEqual("FubuCore-Edge");

            document2.MakeEdge();

            var document3 = new NuspecDocument(theFilename);
            document3.Name.ShouldEqual("FubuCore-Edge");

        }
예제 #7
0
        private void generateNuspec(string targetFile)
        {
            var nuspec = new NuspecDocument(targetFile);
            _dependencies.Each(token =>
            {
                var dependency = token.Create();
                nuspec.AddDependency(dependency);
            });

            nuspec.SaveChanges();
        }
예제 #8
0
 public PublishesExpression(NuspecDocument spec, Solution solution)
 {
     _spec = spec;
     _solution = solution;
 }
예제 #9
0
            public void Publishes(string name, Action<PublishesExpression> configure)
            {
                var packagingDir = _solution.NugetSpecFolder;
                var specFile = Path.Combine(packagingDir, "{0}.nuspec".ToFormat(name));

                var nuspec = GetType()
                    .Assembly
                    .GetManifestResourceStream(GetType(), "NuspecTemplate.txt")
                    .ReadAllText();

                _fileSystem.WriteStringToFile(specFile, nuspec.Replace("${Name}", name));

                var document = new NuspecDocument(specFile);
                document.Name = name;

                var expression = new PublishesExpression(document, _solution);

                if (configure == null)
                {
                    expression.Assembly("{0}.dll".ToFormat(name));
                }
                else
                {
                    configure(expression);
                }

                document.SaveChanges();
            }