/// <summary> /// Create a build manifest for packages, blobs, and associated signing information /// </summary> /// <param name="log">MSBuild log helper</param> /// <param name="blobArtifacts">Collection of blobs</param> /// <param name="packageArtifacts">Collection of packages</param> /// <param name="assetManifestPath">Asset manifest file that should be written</param> /// <param name="manifestRepoName">Repository name</param> /// <param name="manifestBuildId">Azure devops build id</param> /// <param name="manifestBranch">Name of the branch that was built</param> /// <param name="manifestCommit">Commit that was built</param> /// <param name="manifestBuildData">Additional build data properties</param> /// <param name="isStableBuild">True if the build is stable, false otherwise.</param> /// <param name="publishingVersion">Publishing version in use.</param> /// <param name="isReleaseOnlyPackageVersion">True if this repo uses release-only package versions</param> /// <param name="signingInformationModel">Signing information.</param> public void CreateBuildManifest( IEnumerable <BlobArtifactModel> blobArtifacts, IEnumerable <PackageArtifactModel> packageArtifacts, string assetManifestPath, string manifestRepoName, string manifestBuildId, string manifestBranch, string manifestCommit, string[] manifestBuildData, bool isStableBuild, PublishingInfraVersion publishingVersion, bool isReleaseOnlyPackageVersion, SigningInformationModel signingInformationModel = null) { BuildModel model = CreateModel( blobArtifacts, packageArtifacts, manifestBuildId, manifestBuildData, manifestRepoName, manifestBranch, manifestCommit, isStableBuild, publishingVersion, isReleaseOnlyPackageVersion, signingInformationModel: signingInformationModel); _log.LogMessage(MessageImportance.High, $"Writing build manifest file '{assetManifestPath}'..."); _fileSystem.WriteToFile(assetManifestPath, model.ToXml().ToString(SaveOptions.DisableFormatting)); }
public static void CreateBuildManifest(TaskLoggingHelper log, IEnumerable <BlobArtifactModel> blobArtifacts, IEnumerable <PackageArtifactModel> packageArtifacts, string assetManifestPath, string manifestRepoUri, string manifestBuildId, string manifestBranch, string manifestCommit, string manifestBuildData) { log.LogMessage(MessageImportance.High, $"Creating build manifest file '{assetManifestPath}'..."); BuildModel buildModel = new BuildModel( new BuildIdentity { Attributes = ParseManifestMetadataString(manifestBuildData), Name = manifestRepoUri, BuildId = manifestBuildId, Branch = manifestBranch, Commit = manifestCommit }); buildModel.Artifacts.Blobs.AddRange(blobArtifacts); buildModel.Artifacts.Packages.AddRange(packageArtifacts); string dirPath = Path.GetDirectoryName(assetManifestPath); Directory.CreateDirectory(dirPath); File.WriteAllText(assetManifestPath, buildModel.ToXml().ToString()); }
private void CreateBuildManifest( string manifestPath, IEnumerable <BlobArtifactModel> blobArtifacts, IEnumerable <PackageArtifactModel> packageArtifacts) { Log.LogMessage($"Creating build manifest file '{AssetManifestPath}'..."); BuildModel buildModel = new BuildModel( new BuildIdentity { Attributes = ParseManifestMetadataString(ManifestBuildData), Name = ManifestRepoUri, BuildId = ManifestBuildId, Branch = ManifestBranch, Commit = ManifestCommit }); buildModel.Artifacts.Blobs.AddRange(blobArtifacts); buildModel.Artifacts.Packages.AddRange(packageArtifacts); string dirPath = Path.GetDirectoryName(AssetManifestPath); Directory.CreateDirectory(dirPath); File.WriteAllText(AssetManifestPath, buildModel.ToXml().ToString()); }
public static void WriteAsXml(this BuildModel buildModel, string filePath, TaskLoggingHelper log) { log.LogMessage(MessageImportance.High, $"Creating build manifest file '{filePath}'..."); string dirPath = Path.GetDirectoryName(filePath); Directory.CreateDirectory(dirPath); File.WriteAllText(filePath, buildModel.ToXml().ToString()); }