Example #1
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"));
        }
Example #2
0
        public void AddAssemblies(Dependency dep, IEnumerable <IPackageAssemblyReference> assemblies)
        {
            bool needsSaved = false;

            assemblies = findCompatibleItems(assemblies).ToList();

            assemblies.Each(assem =>
            {
                var assemblyName = Path.GetFileNameWithoutExtension(assem.Name);

                if (assemblyName == "_._" || assemblyName == "_")
                {
                    return;
                }

                if (!_solution.ShouldAddReference(dep, assemblyName))
                {
                    return;
                }

                var nugetDir     = _solution.NugetFolderFor(dep.Name);
                var assemblyPath = nugetDir.AppendPath(assem.Path);
                var hintPath     = assemblyPath.PathRelativeTo(_filename.ParentDirectory());

                if (AddReference(assemblyName, hintPath) == ReferenceStatus.Changed)
                {
                    RippleLog.Debug("Updated reference for {0} to {1}".ToFormat(_filename, hintPath));
                    needsSaved = true;
                }
            });

            if (needsSaved)
            {
                RippleLog.Debug("Writing changes to " + _filename);
                Write();
            }
        }
Example #3
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"));
        }