mirror of https://github.com/abpframework/abp.git
2 changed files with 30 additions and 0 deletions
@ -0,0 +1,29 @@ |
|||
using System.IO; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Volo.Abp.Studio.Packages.Modifying; |
|||
|
|||
namespace Volo.Abp.Studio.ModuleInstalling.Steps; |
|||
|
|||
public class CommonPropsStep : ModuleInstallingPipelineStep |
|||
{ |
|||
public async override Task ExecuteAsync(ModuleInstallingContext context) |
|||
{ |
|||
var moduleFolder = Path.GetDirectoryName(context.TargetModule); |
|||
var commonPropsFilePath = Path.Combine(moduleFolder, "common.props"); |
|||
|
|||
if (!File.Exists(commonPropsFilePath)) |
|||
{ |
|||
return; |
|||
} |
|||
|
|||
var _csprojFileManager = context.ServiceProvider.GetRequiredService<ICsprojFileManager>(); |
|||
|
|||
var csProjFiles = Directory.GetFiles(context.GetTargetSourceCodeFolder(), "*.csproj", SearchOption.AllDirectories); |
|||
|
|||
foreach (var csProjFile in csProjFiles) |
|||
{ |
|||
await _csprojFileManager.AddImportAsync(csProjFile, commonPropsFilePath); |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue