protected bool ValidateParameters() { Index = ++Counter; if (AutoSetup) { if (LoadEnvironmentFromTargets.IsNullOrEmpty()) { } if (string.IsNullOrEmpty(StartMessage)) { } } if ((((ushort)GetKeyState(0x91)) & 0xffff) != 0) { Debugger.Break(); } if (Projects.IsNullOrEmpty()) { return(false); } var badFiles = new List <string>(); projectFiles = Projects.Select(each => { var r = each.ItemSpec.GetFullPath(); if (File.Exists(r)) { return(each.ItemSpec.GetFullPath()); } badFiles.Add(each.ItemSpec); return(null); }).ToArray(); if (badFiles.Count > 0) { LogError("Unable to resolve location of project files:"); badFiles.ForEach(each => LogError("ยป {0}".format(each))); return(false); } lock (typeof(MsBuildEx)) { try { EnvironmentUtility.Push(); if (ResetEnvironmentFirst) { new LoadSystemEnvironment().Execute(); } if (!LoadEnvironmentFromTargets.IsNullOrEmpty()) { foreach (var tgt in LoadEnvironmentFromTargets.Select(each => each.ItemSpec)) { var seft = new SetEnvironmentFromTarget { Target = tgt, BuildEngine = BuildEngine, HostObject = HostObject, }; seft.Execute(); if (!seft.IsEnvironmentValid) { if (SkippingMessage.Is()) { Messages.Enqueue(new BuildMessage(SkippingMessage)); } skip = true; return(true); } } } var vars = Environment.GetEnvironmentVariables(); _environment = new XDictionary <string, string>(); foreach (var i in vars.Keys) { _environment.Add(i.ToString(), ((string)vars[i]) ?? ""); } } finally { EnvironmentUtility.Pop(); } } return(true); }
public override bool Execute() { EnvironmentUtility.Push(); return(true); }