【调整】调整一些语言相关的生成选项名,标准化为 --{language}:{option}
parent
bb534ef12e
commit
e9244a30da
|
|
@ -26,7 +26,7 @@ namespace Luban.Job.Cfg.Generate
|
||||||
bool isGenBinary = genType.EndsWith("bin");
|
bool isGenBinary = genType.EndsWith("bin");
|
||||||
if (isGenBinary)
|
if (isGenBinary)
|
||||||
{
|
{
|
||||||
if (args.UsePuertsByteBuf)
|
if (args.TypescriptUsePuertsByteBuf)
|
||||||
{
|
{
|
||||||
fileContent.Add(TypescriptStringTemplate.PuertsByteBufImports);
|
fileContent.Add(TypescriptStringTemplate.PuertsByteBufImports);
|
||||||
}
|
}
|
||||||
|
|
@ -36,7 +36,7 @@ namespace Luban.Job.Cfg.Generate
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.EmbedBrightTypes)
|
if (args.TypescriptEmbedBrightTypes)
|
||||||
{
|
{
|
||||||
fileContent.Add(isGenBinary ?
|
fileContent.Add(isGenBinary ?
|
||||||
StringTemplateUtil.GetTemplateString("config/typescript_bin/vectors")
|
StringTemplateUtil.GetTemplateString("config/typescript_bin/vectors")
|
||||||
|
|
|
||||||
|
|
@ -147,7 +147,7 @@ namespace Luban.Job.Cfg
|
||||||
var excludeTags = args.ExportExcludeTags.Split(',').Select(t => t.Trim().ToLowerInvariant()).Where(t => !string.IsNullOrEmpty(t)).ToList();
|
var excludeTags = args.ExportExcludeTags.Split(',').Select(t => t.Trim().ToLowerInvariant()).Where(t => !string.IsNullOrEmpty(t)).ToList();
|
||||||
var ass = new DefAssembly(args.PatchName, timeZoneInfo, excludeTags, agent)
|
var ass = new DefAssembly(args.PatchName, timeZoneInfo, excludeTags, agent)
|
||||||
{
|
{
|
||||||
UseUnityVectors = args.UseUnityVectors,
|
CsUseUnityVectors = args.CsUseUnityVectors,
|
||||||
OutputCompactJson = args.OutputCompactJson,
|
OutputCompactJson = args.OutputCompactJson,
|
||||||
NamingConventionModule = args.NamingConventionModule,
|
NamingConventionModule = args.NamingConventionModule,
|
||||||
NamingConventionType = args.NamingConventionType,
|
NamingConventionType = args.NamingConventionType,
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ namespace Luban.Job.Common.Defs
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool IsUseUnityVectors => LocalAssebmly?.UseUnityVectors == true;
|
public static bool IsUseUnityVectors => LocalAssebmly?.CsUseUnityVectors == true;
|
||||||
|
|
||||||
public Dictionary<string, DefTypeBase> Types { get; } = new Dictionary<string, DefTypeBase>();
|
public Dictionary<string, DefTypeBase> Types { get; } = new Dictionary<string, DefTypeBase>();
|
||||||
|
|
||||||
|
|
@ -40,7 +40,7 @@ namespace Luban.Job.Common.Defs
|
||||||
|
|
||||||
public bool SupportNullable { get; protected set; } = true;
|
public bool SupportNullable { get; protected set; } = true;
|
||||||
|
|
||||||
public bool UseUnityVectors { get; set; }
|
public bool CsUseUnityVectors { get; set; }
|
||||||
|
|
||||||
public NamingConvention NamingConventionModule { get; set; } = NamingConvention.LanguangeRecommend;
|
public NamingConvention NamingConventionModule { get; set; } = NamingConvention.LanguangeRecommend;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,21 +13,6 @@ namespace Luban.Job.Common
|
||||||
[Option("output_code_monolithic_file", Required = false, HelpText = "output monolithic code file. only effect when lan=rust,python,typescript,lua")]
|
[Option("output_code_monolithic_file", Required = false, HelpText = "output monolithic code file. only effect when lan=rust,python,typescript,lua")]
|
||||||
public string OutputCodeMonolithicFile { get; set; }
|
public string OutputCodeMonolithicFile { get; set; }
|
||||||
|
|
||||||
[Option("typescript_bright_require_path", Required = false, HelpText = "bright require path in typescript")]
|
|
||||||
public string TypescriptBrightRequirePath { get; set; }
|
|
||||||
|
|
||||||
[Option("typescript_bright_package_name", Required = false, HelpText = "typescript bright package name")]
|
|
||||||
public string TypescriptBrightPackageName { get; set; }
|
|
||||||
|
|
||||||
[Option("use_puerts_bytebuf", Required = false, HelpText = "use puerts bytebuf class")]
|
|
||||||
public bool UsePuertsByteBuf { get; set; }
|
|
||||||
|
|
||||||
[Option("embed_bright_types", Required = false, HelpText = "use puerts bytebuf class")]
|
|
||||||
public bool EmbedBrightTypes { get; set; }
|
|
||||||
|
|
||||||
[Option("use_unity_vector", Required = false, HelpText = "use UnityEngine.Vector{2,3,4}")]
|
|
||||||
public bool UseUnityVectors { get; set; }
|
|
||||||
|
|
||||||
[Option("naming_convention_module", Required = false, HelpText = "naming convention of module. can be language_recommend,none,camelCase,PascalCase,under_scores")]
|
[Option("naming_convention_module", Required = false, HelpText = "naming convention of module. can be language_recommend,none,camelCase,PascalCase,under_scores")]
|
||||||
public string NamingConventionModuleStr { get; set; }
|
public string NamingConventionModuleStr { get; set; }
|
||||||
|
|
||||||
|
|
@ -51,6 +36,23 @@ namespace Luban.Job.Common
|
||||||
[Option("access_bean_member", Required = false, HelpText = "mode of bean field. can be language_recommend,variable,getter_setter,property")]
|
[Option("access_bean_member", Required = false, HelpText = "mode of bean field. can be language_recommend,variable,getter_setter,property")]
|
||||||
public string AccessConventionBeanMemberStr { get; set; }
|
public string AccessConventionBeanMemberStr { get; set; }
|
||||||
|
|
||||||
|
// luanguage options
|
||||||
|
|
||||||
|
[Option("typescript:bright_require_path", Required = false, HelpText = "bright require path in typescript")]
|
||||||
|
public string TypescriptBrightRequirePath { get; set; }
|
||||||
|
|
||||||
|
[Option("typescript:bright_package_name", Required = false, HelpText = "typescript bright package name")]
|
||||||
|
public string TypescriptBrightPackageName { get; set; }
|
||||||
|
|
||||||
|
[Option("typescript:use_puerts_bytebuf", Required = false, HelpText = "use puerts bytebuf class")]
|
||||||
|
public bool TypescriptUsePuertsByteBuf { get; set; }
|
||||||
|
|
||||||
|
[Option("typescript:embed_bright_types", Required = false, HelpText = "use puerts bytebuf class")]
|
||||||
|
public bool TypescriptEmbedBrightTypes { get; set; }
|
||||||
|
|
||||||
|
[Option("cs:use_unity_vector", Required = false, HelpText = "use UnityEngine.Vector{2,3,4}")]
|
||||||
|
public bool CsUseUnityVectors { get; set; }
|
||||||
|
|
||||||
public AccessConvention AccessConventionBeanMember { get; set; }
|
public AccessConvention AccessConventionBeanMember { get; set; }
|
||||||
|
|
||||||
public bool ValidateOutouptCodeDir(ref string errMsg)
|
public bool ValidateOutouptCodeDir(ref string errMsg)
|
||||||
|
|
@ -101,12 +103,12 @@ namespace Luban.Job.Common
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
bool hasBrightPathOrPacakge = !string.IsNullOrWhiteSpace(this.TypescriptBrightRequirePath) || !string.IsNullOrWhiteSpace(this.TypescriptBrightPackageName);
|
bool hasBrightPathOrPacakge = !string.IsNullOrWhiteSpace(this.TypescriptBrightRequirePath) || !string.IsNullOrWhiteSpace(this.TypescriptBrightPackageName);
|
||||||
if (!this.UsePuertsByteBuf && !hasBrightPathOrPacakge)
|
if (!this.TypescriptUsePuertsByteBuf && !hasBrightPathOrPacakge)
|
||||||
{
|
{
|
||||||
errMsg = "while --use_puerts_bytebuf is false, should provide option --typescript_bright_require_path or --typescript_bright_package_name";
|
errMsg = "while --use_puerts_bytebuf is false, should provide option --typescript_bright_require_path or --typescript_bright_package_name";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!this.EmbedBrightTypes && !hasBrightPathOrPacakge)
|
if (!this.TypescriptEmbedBrightTypes && !hasBrightPathOrPacakge)
|
||||||
{
|
{
|
||||||
errMsg = "while --embed_bright_types is false, should provide option --typescript_bright_require_path or --typescript_bright_package_name";
|
errMsg = "while --embed_bright_types is false, should provide option --typescript_bright_require_path or --typescript_bright_package_name";
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ namespace Luban.Job.Proto.Generate
|
||||||
var render = ctx.Render;
|
var render = ctx.Render;
|
||||||
var ass = ctx.Assembly;
|
var ass = ctx.Assembly;
|
||||||
var fileContent = new List<string>();
|
var fileContent = new List<string>();
|
||||||
if (args.UsePuertsByteBuf)
|
if (args.TypescriptUsePuertsByteBuf)
|
||||||
{
|
{
|
||||||
fileContent.Add(TypescriptStringTemplate.PuertsByteBufImports);
|
fileContent.Add(TypescriptStringTemplate.PuertsByteBufImports);
|
||||||
}
|
}
|
||||||
|
|
@ -32,7 +32,7 @@ namespace Luban.Job.Proto.Generate
|
||||||
{
|
{
|
||||||
fileContent.Add(TypescriptStringTemplate.GetByteBufImports(brightRequirePath, brightPackageName));
|
fileContent.Add(TypescriptStringTemplate.GetByteBufImports(brightRequirePath, brightPackageName));
|
||||||
}
|
}
|
||||||
if (args.EmbedBrightTypes)
|
if (args.TypescriptEmbedBrightTypes)
|
||||||
{
|
{
|
||||||
fileContent.Add(StringTemplateUtil.GetTemplateString("config/typescript_bin/vectors"));
|
fileContent.Add(StringTemplateUtil.GetTemplateString("config/typescript_bin/vectors"));
|
||||||
fileContent.Add(TypescriptStringTemplate.SerializeTypes);
|
fileContent.Add(TypescriptStringTemplate.SerializeTypes);
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,7 @@ namespace Luban.Job.Proto
|
||||||
|
|
||||||
var ass = new DefAssembly()
|
var ass = new DefAssembly()
|
||||||
{
|
{
|
||||||
UseUnityVectors = args.UseUnityVectors,
|
CsUseUnityVectors = args.CsUseUnityVectors,
|
||||||
|
|
||||||
NamingConventionModule = args.NamingConventionModule,
|
NamingConventionModule = args.NamingConventionModule,
|
||||||
NamingConventionType = args.NamingConventionType,
|
NamingConventionType = args.NamingConventionType,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue