Update cli entry-point arg

pull/15824/head
Mahmut Gundogdu 3 years ago
parent 94bf83b1bb
commit c3cf2b8c1e

@ -68,7 +68,9 @@ public abstract class ProxyCommandBase<T> : IConsoleCommand, ITransientDependenc
var source = commandLineArgs.Options.GetOrNull(Options.Source.Short, Options.Source.Long);
var workDirectory = commandLineArgs.Options.GetOrNull(Options.WorkDirectory.Short, Options.WorkDirectory.Long) ?? Directory.GetCurrentDirectory();
var folder = commandLineArgs.Options.GetOrNull(Options.Folder.Long);
var serviceTypeArg = commandLineArgs.Options.GetOrNull(Options.Module.Short, Options.ServiceType.Long);
var serviceTypeArg = commandLineArgs.Options.GetOrNull(Options.ServiceType.Short, Options.ServiceType.Long);
var entryPointArg = commandLineArgs.Options.GetOrNull(Options.EntryPoint.Short, Options.EntryPoint.Long);
ServiceType? serviceType = null;
if (!serviceTypeArg.IsNullOrWhiteSpace())
@ -83,7 +85,7 @@ public abstract class ProxyCommandBase<T> : IConsoleCommand, ITransientDependenc
var withoutContracts = commandLineArgs.Options.ContainsKey(Options.WithoutContracts.Short) ||
commandLineArgs.Options.ContainsKey(Options.WithoutContracts.Long);
return new GenerateProxyArgs(CommandName, workDirectory, module, url, output, target, apiName, source, folder, serviceType, withoutContracts, commandLineArgs.Options);
return new GenerateProxyArgs(CommandName, workDirectory, module, url, output, target, apiName, source, folder, serviceType, entryPointArg,withoutContracts, commandLineArgs.Options);
}
public virtual string GetUsageInfo()
@ -190,5 +192,10 @@ public abstract class ProxyCommandBase<T> : IConsoleCommand, ITransientDependenc
public const string Short = "c";
public const string Long = "without-contracts";
}
public static class EntryPoint
{
public const string Short = "ep";
public const string Long = "entry-point";
}
}
}

@ -49,6 +49,8 @@ public class AngularServiceProxyGenerator : ServiceProxyGeneratorBase<AngularSer
var source = args.Source ?? defaultValue;
var target = args.Target ?? defaultValue;
var url = args.Url ?? defaultValue;
var entryPoint = args.EntryPoint ?? defaultValue;
var commandBuilder = new StringBuilder("npx ng g @abp/ng.schematics:" + schematicsCommandName);
if (module != null)
@ -76,6 +78,11 @@ public class AngularServiceProxyGenerator : ServiceProxyGeneratorBase<AngularSer
commandBuilder.Append($" --url {url}");
}
if (entryPoint != null)
{
commandBuilder.Append($" --entry-point {entryPoint}");
}
var serviceType = GetServiceType(args) ?? Volo.Abp.Cli.ServiceProxying.ServiceType.Application;
commandBuilder.Append($" --service-type {serviceType.ToString().ToLower()}");

@ -24,6 +24,7 @@ public class GenerateProxyArgs
public string Source { get; }
public string Folder { get; }
public string EntryPoint { get; }
public ServiceType? ServiceType { get; }
@ -43,6 +44,7 @@ public class GenerateProxyArgs
string source,
string folder,
ServiceType? serviceType,
string entryPoint,
bool withoutContracts,
Dictionary<string, string> extraProperties = null)
{
@ -56,6 +58,7 @@ public class GenerateProxyArgs
Source = source;
Folder = folder;
ServiceType = serviceType;
EntryPoint = entryPoint;
WithoutContracts = withoutContracts;
ExtraProperties = extraProperties ?? new Dictionary<string, string>();
}

Loading…
Cancel
Save