mirror of https://github.com/abpframework/abp.git
3 changed files with 35 additions and 15 deletions
@ -1,14 +0,0 @@ |
|||
using System; |
|||
using System.Linq; |
|||
|
|||
namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps; |
|||
|
|||
public class ChangeApplicationIdGuidStep: ProjectBuildPipelineStep |
|||
{ |
|||
public override void Execute(ProjectBuildContext context) |
|||
{ |
|||
var projectFile = context.Files.FirstOrDefault(f => f.Name.EndsWith("MyCompanyName.MyProjectName.csproj")); |
|||
|
|||
projectFile?.SetContent(projectFile.Content.Replace("27317750-B571-4690-B433-B358B2480E01", Guid.NewGuid().ToString())); |
|||
} |
|||
} |
|||
@ -0,0 +1,34 @@ |
|||
using System; |
|||
using System.Linq; |
|||
using System.Xml; |
|||
using Volo.Abp.Cli.ProjectBuilding.Building; |
|||
using Volo.Abp.Cli.Utils; |
|||
|
|||
namespace Volo.Abp.Cli.ProjectBuilding.Templates.Maui; |
|||
|
|||
public class MauiChangeApplicationIdGuidStep: ProjectBuildPipelineStep |
|||
{ |
|||
public override void Execute(ProjectBuildContext context) |
|||
{ |
|||
var projectFile = context.Files.FirstOrDefault(f => f.Name.EndsWith("MyCompanyName.MyProjectName.csproj") || f.Name.EndsWith("MyCompanyName.MyProjectName.Maui.csproj")); |
|||
|
|||
if (projectFile == null) |
|||
{ |
|||
return; |
|||
} |
|||
|
|||
using (var stream = StreamHelper.GenerateStreamFromString(projectFile.Content)) |
|||
{ |
|||
var doc = new XmlDocument { PreserveWhitespace = true }; |
|||
doc.Load(stream); |
|||
|
|||
var node = doc.SelectSingleNode("/Project/PropertyGroup/ApplicationIdGuid"); |
|||
if (node != null) |
|||
{ |
|||
node.InnerText = Guid.NewGuid().ToString(); |
|||
} |
|||
|
|||
projectFile.SetContent(doc.OuterXml); |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue