Esempio n. 1
0
 static void b1(ProjectRootElement root, ProjectImportGroupElement pige)
 {
     const string FILE = @"$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props";
     var avar = pige.AddImport(FILE);
     avar.Condition = makeExistsCondition(FILE);
     avar.Label = "LocalAppDataPlatform";
 }
Esempio n. 2
0
        internal ProjectImportElement LookupImport(ProjectImportGroupElement parent, string importPath, string condition = null) {
            ProjectImportElement import = null;

            var label = Pivots.GetExpressionLabel(condition);

            if(string.IsNullOrEmpty(condition)) {
                import = parent.Imports.FirstOrDefault(each => importPath == each.Project && string.IsNullOrEmpty(each.Condition));
                if(import != null) {
                    return import;
                }
                return parent.AddImport(importPath);
            }

            var conditionExpression = Pivots.GetMSBuildCondition(Name, condition);
            import = parent.Imports.FirstOrDefault(each => importPath == each.Project && each.Condition == conditionExpression);
            if(import != null) {
                return import;
            }

            import = parent.AddImport(importPath);

            import.Label = label;
            import.Condition = conditionExpression;
            return import;
        }