Browse Source

Merge pull request #12323 from abpframework/volo-Issue/9681

Cli: Add license code to module source code downloads
pull/12328/head
albert 5 years ago
committed by GitHub
parent
commit
859ae7cb95
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      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

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

@ -14,6 +14,13 @@ public static class ModuleProjectBuildPipelineBuilder
pipeline.Steps.Add(new ReplaceCommonPropsStep());
pipeline.Steps.Add(new MakeProxyJsonFileEmbeddedStep());
pipeline.Steps.Add(new ReplaceConfigureAwaitPropsStep());
if (context.Module.IsPro)
{
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