Esempio n. 1
0
        private void ParseLine(int lineCount, string line)
        {
            if (line.Trim().Length == 0)
            {
                return;
            }

            try
            {
                var templateReference = new ScriptLine(line, this.parameters).Parse();
                this.templates.Add(templateReference);
            }
            catch (Exception exception)
            {
                throw new InvalidOperationException(string.Format(
                                                        "Error at line {0}: '{1}'. {2}",
                                                        lineCount,
                                                        line,
                                                        exception.Message), exception);
            }
        }
Esempio n. 2
0
 private void IncludeTransformedFileInProject(ScriptLine templateReference)
 {
     var project = new Project(templateReference.ProjectFile);
     project.IncludeCompileFile(templateReference.TransformationFile);
 }
Esempio n. 3
0
        private void TransfomTemplate(ScriptLine templateReference, Template template)
        {
            try
            {
                template.Transform(templateReference.TransformationFile);

                Console.WriteLine(
                    "Template {0} transformado em {1}",
                    templateReference.TemplateFile,
                    templateReference.TransformationFile);

                if (string.IsNullOrEmpty(templateReference.ProjectFile) == false)
                {
                    this.IncludeTransformedFileInProject(templateReference);
                }
            }
            catch (Exception)
            {
                Console.WriteLine("Error when try transform " + template.TemplateFile);
                throw;
            }
        }