예제 #1
0
 public MissingInputException(IEnumerable <string> inputNames) : base(FubuCore.StringExtensions.ToFormat("Required inputs {0} are missing", new object[]
 {
     GenericEnumerableExtensions.Join(inputNames, ", ")
 }))
 {
     this._inputNames = inputNames;
 }
예제 #2
0
 public static string GetNamespace(string relativePath, string projectName)
 {
     return(GenericEnumerableExtensions.Join(relativePath.Split(new char[]
     {
         '/'
     }).Reverse <string>().Skip(1).Union(new string[]
     {
         projectName
     }).Reverse <string>(), "."));
 }
예제 #3
0
        public string ToNugetImportStatement()
        {
            string arg_4B_0 = "{0}: {1}";

            object[] array = new object[2];
            array[0] = this.ProjectName;
            array[1] = GenericEnumerableExtensions.Join(from x in this._nugetDeclarations
                                                        orderby x
                                                        select x, ", ");
            return(FubuCore.StringExtensions.ToFormat(arg_4B_0, array));
        }
예제 #4
0
        public void Alter(TemplatePlan plan)
        {
            this._substitutions.Set("%INSTRUCTIONS%", plan.GetInstructions());
            plan.Logger.StartProject(this._alterations.Count);
            plan.StartProject(this);
            this._substitutions.Trace(plan.Logger);
            SolutionProject reference = plan.Solution.FindProject(this._projectName);

            if (reference == null)
            {
                if (FubuCore.StringExtensions.IsEmpty(this.ProjectTemplateFile))
                {
                    plan.Logger.Trace("Creating project {0} from the default template", new object[]
                    {
                        this._projectName
                    });
                    reference = plan.Solution.AddProject(this._projectName);
                }
                else
                {
                    plan.Logger.Trace("Creating project {0} from template at {1}", new object[]
                    {
                        this._projectName,
                        this.ProjectTemplateFile
                    });
                    reference = plan.Solution.AddProjectFromTemplate(this._projectName, this.ProjectTemplateFile);
                }
                reference.Project.AssemblyName = (reference.Project.RootNamespace = this.ProjectName);
                if (this.DotNetVersion != null)
                {
                    reference.Project.DotNetVersion = this.DotNetVersion;
                }
            }
            string projectDirectory = reference.Project.ProjectDirectory;

            plan.FileSystem.CreateDirectory(projectDirectory);
            this._relativePath = FubuCore.StringExtensions.PathRelativeTo(reference.Project.FileName, plan.Root).Replace("\\", "/");
            this._substitutions.Set("%PROJECT_PATH%", this._relativePath);
            this._substitutions.Set("%PROJECT_FOLDER%", GenericEnumerableExtensions.Join(this._relativePath.Split(new char[]
            {
                '/'
            }).Reverse <string>().Skip(1).Reverse <string>(), "/"));
            GenericEnumerableExtensions.Each <IProjectAlteration>(this._alterations, delegate(IProjectAlteration x)
            {
                plan.Logger.TraceAlteration(this.ApplySubstitutionsRaw(x.ToString(), null));
                x.Alter(reference.Project, this);
            });
            this.Substitutions.WriteTo(FubuCore.StringExtensions.AppendPath(projectDirectory, new string[]
            {
                Substitutions.ConfigFile
            }));
            plan.Logger.EndProject();
        }
예제 #5
0
        public void Alter(TemplatePlan plan)
        {
            string[]      lines      = plan.ApplySubstitutions(this._text).SplitOnNewLine();
            string        rakeFile   = RakeFileTransform.FindFile(plan.Root);
            FileSystem    fileSystem = new FileSystem();
            List <string> list       = fileSystem.FileExists(rakeFile) ? FubuCore.StringExtensions.ReadLines(fileSystem.ReadStringFromFile(rakeFile)).ToList <string>() : new List <string>();

            if (list.ContainsSequence(lines))
            {
                return;
            }
            list.Add(string.Empty);
            list.AddRange(lines);
            fileSystem.WriteStringToFile(rakeFile, GenericEnumerableExtensions.Join(list, Environment.NewLine));
        }
예제 #6
0
        public override string ToString()
        {
            string validChoiceString = GenericEnumerableExtensions.Join(from x in this.ValidChoices
                                                                        select FubuCore.StringExtensions.ToFormat("'{0}'", new object[]
            {
                x
            }), ", ");

            return(FubuCore.StringExtensions.ToFormat("Unknown {0} template '{1}', valid choices are {2}", new object[]
            {
                this.TemplateType.ToString(),
                this.Name,
                validChoiceString
            }));
        }
예제 #7
0
 public override string ToString()
 {
     return(string.Format("Adding to .gitignore: {0}", GenericEnumerableExtensions.Join(this._entries, ", ")));
 }
예제 #8
0
 private void resetPrefix()
 {
     _prefix = GenericEnumerableExtensions.Join((IEnumerable <string>)_prefixes.Reverse(), ".");
 }
예제 #9
0
 public override string ToString()
 {
     return(string.Format("AssemblyInfo content:  {0}", GenericEnumerableExtensions.Join(from x in this._additions
                                                                                         select "'{0}'", "; ")));
 }