mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-08-20 02:29:03 +00:00
fix[generate]: join root path and generate path
This commit is contained in:
@@ -62,12 +62,7 @@ public abstract class GenerateCppUtils {
|
||||
}
|
||||
|
||||
public static void init(GenerateOperation generateOperation) {
|
||||
// if not specify output path, then use current default path
|
||||
if (StringUtils.isNotEmpty(generateOperation.getProtocolPath())) {
|
||||
protocolOutputPath = FileUtils.joinPath(generateOperation.getProtocolPath(), protocolOutputRootPath);
|
||||
} else {
|
||||
protocolOutputPath = generateOperation.getProtocolPath();
|
||||
}
|
||||
protocolOutputPath = FileUtils.joinPath(generateOperation.getProtocolPath(), protocolOutputRootPath);
|
||||
FileUtils.deleteFile(new File(protocolOutputPath));
|
||||
|
||||
cppSerializerMap = new HashMap<>();
|
||||
|
||||
@@ -58,12 +58,7 @@ public abstract class GenerateCsUtils {
|
||||
}
|
||||
|
||||
public static void init(GenerateOperation generateOperation) {
|
||||
// if not specify output path, then use current default path
|
||||
if (StringUtils.isNotEmpty(generateOperation.getProtocolPath())) {
|
||||
protocolOutputPath = FileUtils.joinPath(generateOperation.getProtocolPath(), protocolOutputRootPath);
|
||||
} else {
|
||||
protocolOutputPath = generateOperation.getProtocolPath();
|
||||
}
|
||||
protocolOutputPath = FileUtils.joinPath(generateOperation.getProtocolPath(), protocolOutputRootPath);
|
||||
FileUtils.deleteFile(new File(protocolOutputPath));
|
||||
|
||||
csSerializerMap = new HashMap<>();
|
||||
|
||||
@@ -61,12 +61,7 @@ public abstract class GenerateGdUtils {
|
||||
}
|
||||
|
||||
public static void init(GenerateOperation generateOperation) {
|
||||
// if not specify output path, then use current default path
|
||||
if (StringUtils.isNotEmpty(generateOperation.getProtocolPath())) {
|
||||
protocolOutputPath = FileUtils.joinPath(generateOperation.getProtocolPath(), protocolOutputRootPath);
|
||||
} else {
|
||||
protocolOutputPath = generateOperation.getProtocolPath();
|
||||
}
|
||||
protocolOutputPath = FileUtils.joinPath(generateOperation.getProtocolPath(), protocolOutputRootPath);
|
||||
FileUtils.deleteFile(new File(protocolOutputPath));
|
||||
|
||||
gdSerializerMap = new HashMap<>();
|
||||
|
||||
@@ -56,12 +56,7 @@ public abstract class GenerateGoUtils {
|
||||
}
|
||||
|
||||
public static void init(GenerateOperation generateOperation) {
|
||||
// if not specify output path, then use current default path
|
||||
if (StringUtils.isNotEmpty(generateOperation.getProtocolPath())) {
|
||||
protocolOutputPath = FileUtils.joinPath(generateOperation.getProtocolPath(), protocolOutputRootPath);
|
||||
} else {
|
||||
protocolOutputPath = generateOperation.getProtocolPath();
|
||||
}
|
||||
protocolOutputPath = FileUtils.joinPath(generateOperation.getProtocolPath(), protocolOutputRootPath);
|
||||
FileUtils.deleteFile(new File(protocolOutputPath));
|
||||
|
||||
goSerializerMap = new HashMap<>();
|
||||
|
||||
@@ -55,12 +55,7 @@ public abstract class GenerateJsUtils {
|
||||
}
|
||||
|
||||
public static void init(GenerateOperation generateOperation) {
|
||||
// if not specify output path, then use current default path
|
||||
if (StringUtils.isNotEmpty(generateOperation.getProtocolPath())) {
|
||||
protocolOutputPath = FileUtils.joinPath(generateOperation.getProtocolPath(), protocolOutputRootPath);
|
||||
} else {
|
||||
protocolOutputPath = generateOperation.getProtocolPath();
|
||||
}
|
||||
protocolOutputPath = FileUtils.joinPath(generateOperation.getProtocolPath(), protocolOutputRootPath);
|
||||
FileUtils.deleteFile(new File(protocolOutputPath));
|
||||
|
||||
jsSerializerMap = new HashMap<>();
|
||||
|
||||
@@ -57,12 +57,7 @@ public abstract class GenerateLuaUtils {
|
||||
}
|
||||
|
||||
public static void init(GenerateOperation generateOperation) {
|
||||
// if not specify output path, then use current default path
|
||||
if (StringUtils.isNotEmpty(generateOperation.getProtocolPath())) {
|
||||
protocolOutputPath = FileUtils.joinPath(generateOperation.getProtocolPath(), protocolOutputRootPath);
|
||||
} else {
|
||||
protocolOutputPath = generateOperation.getProtocolPath();
|
||||
}
|
||||
protocolOutputPath = FileUtils.joinPath(generateOperation.getProtocolPath(), protocolOutputRootPath);
|
||||
FileUtils.deleteFile(new File(protocolOutputPath));
|
||||
|
||||
luaSerializerMap = new HashMap<>();
|
||||
|
||||
@@ -48,12 +48,7 @@ public abstract class GeneratePbUtils {
|
||||
public static final int COMPATIBLE_FIELD_TAG = 1000;
|
||||
|
||||
public static void create(PbGenerateOperation pbGenerateOperation) {
|
||||
// if not specify output path, then use current default path
|
||||
if (StringUtils.isEmpty(pbGenerateOperation.getOutputPath())) {
|
||||
protocolOutputPath = FileUtils.joinPath(pbGenerateOperation.getOutputPath(), protocolOutputRootPath);
|
||||
} else {
|
||||
protocolOutputPath = pbGenerateOperation.getOutputPath();
|
||||
}
|
||||
protocolOutputPath = FileUtils.joinPath(pbGenerateOperation.getOutputPath(), protocolOutputRootPath);
|
||||
// java package path
|
||||
if (StringUtils.isNotEmpty(pbGenerateOperation.getJavaPackage())) {
|
||||
protocolOutputPath = protocolOutputPath + File.separator + pbGenerateOperation.getJavaPackage().replaceAll(StringUtils.PERIOD_REGEX, "/");
|
||||
|
||||
@@ -57,12 +57,7 @@ public abstract class GeneratePyUtils {
|
||||
}
|
||||
|
||||
public static void init(GenerateOperation generateOperation) {
|
||||
// if not specify output path, then use current default path
|
||||
if (StringUtils.isNotEmpty(generateOperation.getProtocolPath())) {
|
||||
protocolOutputPath = FileUtils.joinPath(generateOperation.getProtocolPath(), protocolOutputRootPath);
|
||||
} else {
|
||||
protocolOutputPath = generateOperation.getProtocolPath();
|
||||
}
|
||||
protocolOutputPath = FileUtils.joinPath(generateOperation.getProtocolPath(), protocolOutputRootPath);
|
||||
FileUtils.deleteFile(new File(protocolOutputPath));
|
||||
|
||||
pySerializerMap = new HashMap<>();
|
||||
|
||||
@@ -58,12 +58,7 @@ public abstract class GenerateTsUtils {
|
||||
}
|
||||
|
||||
public static void init(GenerateOperation generateOperation) {
|
||||
// if not specify output path, then use current default path
|
||||
if (StringUtils.isNotEmpty(generateOperation.getProtocolPath())) {
|
||||
protocolOutputPath = FileUtils.joinPath(generateOperation.getProtocolPath(), protocolOutputRootPath);
|
||||
} else {
|
||||
protocolOutputPath = generateOperation.getProtocolPath();
|
||||
}
|
||||
protocolOutputPath = FileUtils.joinPath(generateOperation.getProtocolPath(), protocolOutputRootPath);
|
||||
FileUtils.deleteFile(new File(protocolOutputPath));
|
||||
|
||||
tsSerializerMap = new HashMap<>();
|
||||
|
||||
Reference in New Issue
Block a user