Browse Source

Cli: Add license code to module source code downloads

pull/12323/head
Yunus Emre Kalkan 4 years ago
parent
commit
c5db087f58
  1. 2
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/ModuleProjectBuildPipelineBuilder.cs
  2. 16
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/CreateAppSettingsSecretsStep.cs

2
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/ModuleProjectBuildPipelineBuilder.cs

@ -14,6 +14,8 @@ public static class ModuleProjectBuildPipelineBuilder
pipeline.Steps.Add(new ReplaceCommonPropsStep());
pipeline.Steps.Add(new MakeProxyJsonFileEmbeddedStep());
pipeline.Steps.Add(new ReplaceConfigureAwaitPropsStep());
pipeline.Steps.Add(new CreateAppSettingsSecretsStep());
pipeline.Steps.Add(new LicenseCodeReplaceStep());
pipeline.Steps.Add(new UpdateNuGetConfigStep("/NuGet.Config"));
pipeline.Steps.Add(new CreateProjectResultZipStep());

16
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/CreateAppSettingsSecretsStep.cs

@ -40,7 +40,21 @@ public class CreateAppSettingsSecretsStep : ProjectBuildPipelineStep
private static byte[] GetAppSettingsSecretJsonContent(ProjectBuildContext context)
{
return context.Template.IsPro()
bool condition;
if (context.Template != null)
{
condition = context.Template.IsPro();
}
else if (context.Module != null)
{
condition = context.Module.IsPro;
}
else
{
condition = false;
}
return condition
? $"{{{Environment.NewLine} \"AbpLicenseCode\": \"{CliConsts.LicenseCodePlaceHolder}\" {Environment.NewLine}}}".GetBytes()
: $"{{{Environment.NewLine}}}".GetBytes();
}

Loading…
Cancel
Save