public override bool Execute() { var properties = new Dictionary <string, string> { { "Configuration", "$(Configuration)" }, { "Platform", "$(Platform)" }, { "TargetFramework", "$(TargetFramework)" } }; Log.LogMessage(MessageImportance.High, "Configuration : {0}", Configuration); Log.LogMessage(MessageImportance.High, "Platform : {0}", Platform); Log.LogMessage(MessageImportance.High, "TargetFramework : {0}", TargetFramework); List <ITaskItem> pList = ProjectFiles.ToList(); List <ITaskItem> tizenList = new List <ITaskItem>(); foreach (var pItem in pList) { // Load the project into a separate project collection so // we don't get a redundant-project-load error. var collection = new ProjectCollection(properties); var project = collection.LoadProject(pItem.ItemSpec); ProjectProperty pp = project.Properties.Where(p => p.Name == "TizenProject" && p.EvaluatedValue == "true").FirstOrDefault(); if (pp != null) { tizenList.Add(pItem); } } tizenProjectFiles = tizenList; return(true); }
private void btnAllQualifierVersion_Click(object sender, RoutedEventArgs e) { var qualifierVersion = txtQualifier.Text; if (qualifierVersion.Length > 0 && int.TryParse(qualifierVersion.Substring(0, 1), out _)) { qualifierVersion = "-" + qualifierVersion;//qualifier version can not start with a number } ProjectFiles.ToList().ForEach(pgFile => ChangeFileVersion(pgFile, pg => pg.QualifierVersion = qualifierVersion)); }
private void SyncAllFileVersion(PropertyGroup propertyGroup, string versionName, Func <VersionObject, int> newVersionNumberFunc, Action <VersionObject, int> versionOperate) { if (SelectedFile.Version.IsNullOrEmpty()) { MessageBox.Show("Current project doesn't have a valid version number!", "Error", MessageBoxButton.OK, MessageBoxImage.Error); return; } if (MessageBoxResult.Yes != MessageBox.Show($"Are you sure you want to synchronize the {versionName} of the current project to all projects?", "Confirm", MessageBoxButton.YesNoCancel, MessageBoxImage.Question)) { return; } var currentVersion = VersionHelper.GetVersionObject(SelectedFile.Version); var newVersionNumber = newVersionNumberFunc(currentVersion); ProjectFiles.ToList().ForEach(pgFile => ChangeFileVersion(pgFile, pg => versionOperate(pg, newVersionNumber))); MessageBox.Show($"All project verion numbers({versionName}) have been changed to {currentVersion}!", "Success", MessageBoxButton.OK, MessageBoxImage.Information); }
private void btnAllBuildVersionPlus_Click(object sender, RoutedEventArgs e) { ProjectFiles.ToList().ForEach(pgFile => ChangeFileVersion(pgFile, pg => pg.BuildNumberVersion++)); }
private void btnAllIncrementalVersionPlus_Click(object sender, RoutedEventArgs e) { ProjectFiles.ToList().ForEach(pgFile => ChangeFileVersion(pgFile, pg => pg.RevisionVersion++)); }