void TemplateProcessed(TemplateProcessed obj) { if (obj.Template.EndsWith("XamarinApp.sln")) { // we have to check based upon the SolutionIdentifier because when this file is processed the projects itself are not copied yet (or are skipped) // therefore they will be marked as NotFound, and not able to identity the type; solutionIdentifier can always be used var solution = FluentMSBuild.Use(obj.File).Solution; if (!Configuration.UseIOS) { var projects = solution.Projects.Where(q => q.SolutionIdentifier == "XamarinApp.iOS"); RemoveProjects(projects, solution); solution.RemoveConfigurations(ProjectSubType.XamarinIOS); } if (!Configuration.UseAndroid) { var projects = solution.Projects.Where(q => q.SolutionIdentifier == "XamarinApp.Android"); RemoveProjects(projects, solution); } } void RemoveProjects(IEnumerable <Project> projects, Solution solution) { foreach (var project in projects) { solution.Remove(project); } } }
void TemplateProcessed(TemplateProcessed templateProcessed) { Log.Debug($"TemplateProcessed"); Log.Debug($"{templateProcessed.Template}"); Log.Debug($"{templateProcessed.File}"); // You can do something with this file. For example: // FluentMSBuild.Use(templateProcessed.File).AddToProject(); }