void Prune(MSBuildPropertyGroup g) { if (g != groups [0] && !g.GetProperties().Any()) { // Remove this group since it's now empty g.ParentProject.Remove(g); } }
void Evaluate(ProjectInfo project, MSBuildEvaluationContext context, MSBuildPropertyGroup group) { if (!string.IsNullOrEmpty(group.Condition) && !SafeParseAndEvaluate(project, context, group.Condition, true)) { return; } foreach (var prop in group.GetProperties()) { Evaluate(project, context, prop); } }
public void RemoveRedundantProperties() { // Remove properties whose value is the same as the one set in the global group // Remove properties which have the default value and which are not defined in the main group foreach (MSBuildProperty prop in LinkedGroup.GetProperties()) { if (prop.Modified && prop.HasDefaultValue) { RemoveProperty(prop.Name); } } }
public void LinkToGroup(MSBuildPropertyGroup group) { LinkedGroup = group; group.PropertyGroupListener = this; foreach (var p in group.GetProperties()) { var ep = (MSBuildPropertyEvaluated)GetProperty(p.Name); if (ep == null) { ep = AddProperty(p.Name); } ep.LinkToProperty(p); } }