diff --git a/protocol/src/main/java/com/zfoo/protocol/serializer/gdscript/GenerateGdUtils.java b/protocol/src/main/java/com/zfoo/protocol/serializer/gdscript/GenerateGdUtils.java index 310528e86..e75603cfd 100644 --- a/protocol/src/main/java/com/zfoo/protocol/serializer/gdscript/GenerateGdUtils.java +++ b/protocol/src/main/java/com/zfoo/protocol/serializer/gdscript/GenerateGdUtils.java @@ -48,8 +48,9 @@ */ public abstract class GenerateGdUtils { - private static String protocolOutputRootPath = "gdProtocol"; - private static String protocolOutputPath = StringUtils.EMPTY; + // custom configuration + public static String protocolOutputRootPath = "zfoogd"; + public static String protocolOutputPath = StringUtils.EMPTY; private static Map gdSerializerMap; @@ -58,16 +59,13 @@ public static IGdSerializer gdSerializer(ISerializer serializer) { } public static void init(GenerateOperation generateOperation) { - // 如果没有配置路径,则使用默认路径 + // if not specify output path, then use current default path if (StringUtils.isEmpty(generateOperation.getProtocolPath())) { protocolOutputPath = FileUtils.joinPath(generateOperation.getProtocolPath(), protocolOutputRootPath); } else { protocolOutputPath = generateOperation.getProtocolPath(); } - FileUtils.deleteFile(new File(protocolOutputPath)); - var protocolOutputPathFile = FileUtils.createDirectory(protocolOutputPath); - protocolOutputRootPath = protocolOutputPathFile.getName(); gdSerializerMap = new HashMap<>(); gdSerializerMap.put(BooleanSerializer.INSTANCE, new GdBooleanSerializer());