Merge pull request #11137 from abpframework/auto-merge/rel-5-0/755

Merge branch dev with rel-5.0
pull/11166/head
maliming 4 years ago committed by GitHub
commit c7e0a916f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -12,6 +12,7 @@ public static class ModuleProjectBuildPipelineBuilder
pipeline.Steps.Add(new FileEntryListReadStep());
pipeline.Steps.Add(new ProjectReferenceReplaceStep());
pipeline.Steps.Add(new ReplaceCommonPropsStep());
pipeline.Steps.Add(new MakeProxyJsonFileEmbeddedStep());
pipeline.Steps.Add(new ReplaceConfigureAwaitPropsStep());
pipeline.Steps.Add(new UpdateNuGetConfigStep("/NuGet.Config"));
pipeline.Steps.Add(new CreateProjectResultZipStep());

@ -0,0 +1,38 @@
using System.Linq;
using System.Xml.Linq;
using Volo.Abp.Cli.Utils;
namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps;
public class MakeProxyJsonFileEmbeddedStep : ProjectBuildPipelineStep
{
public override void Execute(ProjectBuildContext context)
{
foreach (var file in context.Files.Where(x => x.Name.EndsWith(".HttpApi.Client.csproj")))
{
using (var stream = StreamHelper.GenerateStreamFromString(file.Content))
{
var doc = XDocument.Load(stream);
if (doc.Root == null)
{
continue;
}
var itemGroupNode =
new XElement("ItemGroup",
new XElement("EmbeddedResource",
new XAttribute("Include", @"**\*generate-proxy.json")
),
new XElement("Content",
new XAttribute("Remove", @"**\*generate-proxy.json")
)
);
doc.Root.Add(itemGroupNode);
file.SetContent(doc.ToString());
}
}
}
}
Loading…
Cancel
Save