protected override void Execute(CodeActivityContext context) { #region Workflow Arguments // This will be the api key or a path to the file with the key in it (or blank) var versionPatternOrSeedFilePath = VersionPatternOrSeedFilePath.Get(context); // The local build directory var packageId = PackageId.Get(context); var sourcesDirectory = SourcesDirectory.Get(context); #endregion string versionPattern; try { versionPattern = ExtractVersion(versionPatternOrSeedFilePath, packageId, QueryPackageId, sourcesDirectory); } catch (ArgumentException) { versionPattern = ExtractVersion(versionPatternOrSeedFilePath, packageId, QuerySolutionName, sourcesDirectory); } // Write to the log context.WriteBuildMessage(string.Format("Version Pattern: {0}", versionPattern), BuildMessageImportance.Normal); // Return the value back to the workflow context.SetValue(VersionPattern, versionPattern); }
protected override void Execute(NativeActivityContext context) { var pModel = new PackageModel(); pModel.Id = PackageId.Get(context); pModel.Description = Description.Get(context); pModel.Version = Models.PackageModel.CreateFullVersionFromMajorMinor(MajorVersion.Get(context), MinorVersion.Get(context)); pModel.Authors = Authors.Get(context); pModel.Owners = Owners.Get(context); pModel.LicenseUrl = LicenseUrl.Get(context); pModel.ProjectUrl = ProjectUrl.Get(context); pModel.IconUrl = IconUrl.Get(context); pModel.RequireLicenseAcceptance = RequireLicenseAcceptance.Get(context); pModel.ReleaseNotes = ReleaseNotes.Get(context); pModel.Copyright = Copyright.Get(context); pModel.Tags = Tags.Get(context); pModel.DirectorySet = DirectorySet.Get(context); pModel.ModelsAssemblyGuid = ModelsAssemblyGuid.Get(context) ?? Guid.NewGuid().ToString(); pModel.ActivitiesAssemblyGuid = ActivitiesAssemblyGuid.Get(context) ?? Guid.NewGuid().ToString(); this.PackageModel.Set(context, pModel); context.Properties.Add("PackageModel", pModel); context.ScheduleActivity(this.Body); }
protected override PackageModel Execute(CodeActivityContext context) { var pModel = new PackageModel(); pModel.Id = PackageId.Get(context); pModel.Description = Description.Get(context); pModel.Version = Version.Get(context); pModel.Authors = Authors.Get(context); pModel.Owners = Owners.Get(context); pModel.LicenseUrl = LicenseUrl.Get(context); pModel.ProjectUrl = ProjectUrl.Get(context); pModel.IconUrl = IconUrl.Get(context); pModel.RequireLicenseAcceptance = RequireLicenseAcceptance.Get(context); pModel.ReleaseNotes = ReleaseNotes.Get(context); pModel.Copyright = Copyright.Get(context); pModel.Tags = Tags.Get(context); pModel.DirectorySet = DirectorySet.Get(context); pModel.ModelsAssemblyGuid = ModelsAssemblyGuid.Get(context); pModel.ActivitiesAssemblyGuid = ActivitiesAssemblyGuid.Get(context); return(pModel); }