Skip to content

Commit

Permalink
perf[protocol]: gds protocol output path
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysunxiao committed Sep 28, 2023
1 parent fa2c889 commit 83af1a2
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<ISerializer, IGdSerializer> gdSerializerMap;

Expand All @@ -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());
Expand Down

0 comments on commit 83af1a2

Please sign in to comment.