public override Func<bool> PrepareForRun(TemplateGeneratorParameters parameters) { if (parameters == null) throw new ArgumentNullException(nameof(parameters)); parameters.Validate(); return () => Generate(parameters); }
public bool Generate(TemplateGeneratorParameters parameters) { if (parameters == null) throw new ArgumentNullException(nameof(parameters)); parameters.Validate(); var name = parameters.Name; var outputDirectory = parameters.OutputDirectory; // Creates the package var package = NewPackage(name); // Setup the default namespace package.Meta.RootNamespace = parameters.Namespace; // Setup the path to save it package.FullPath = UPath.Combine(outputDirectory, new UFile(name + Package.PackageFileExtension)); // Set the package parameters.Package = package; // Add it to the current session var session = parameters.Session; session.Packages.Add(package); // Load missing references session.LoadMissingReferences(parameters.Logger); return true; }
public override Action PrepareForRun(TemplateGeneratorParameters parameters) { if (parameters == null) throw new ArgumentNullException("parameters"); parameters.Validate(); return () => Generate(parameters); }