From 1b496d91e1749770b07c32021f20520dfdc7ef9b Mon Sep 17 00:00:00 2001 From: zhoulc Date: Thu, 31 Mar 2022 08:13:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=BC=E5=AE=B9mac?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/cn/iocoder/yudao/ProjectReactor.java | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/yudao-server/src/test/java/cn/iocoder/yudao/ProjectReactor.java b/yudao-server/src/test/java/cn/iocoder/yudao/ProjectReactor.java index e31eb4b67..0961c9252 100644 --- a/yudao-server/src/test/java/cn/iocoder/yudao/ProjectReactor.java +++ b/yudao-server/src/test/java/cn/iocoder/yudao/ProjectReactor.java @@ -31,10 +31,10 @@ public class ProjectReactor { String projectBaseDir = getProjectBaseDir(); // ========== 配置,需要你手动修改 ========== - String groupIdNew = "cn.huwing.boot"; // TODO @seeker:这几个参数改回去原来的哈。 - String artifactIdNew = "zdm"; - String packageNameNew = "cn.huwing.zdm"; - String titleNew = "测试名管理系统"; + String groupIdNew = "cn.star.gg"; + String artifactIdNew = "star"; + String packageNameNew = "cn.start.pp"; + String titleNew = "土豆管理系统"; String projectBaseDirNew = projectBaseDir + "-new"; // 一键改名后,“新”项目所在的目录 log.info("[main][新项目路径地址]projectBaseDirNew: " + projectBaseDirNew); @@ -47,24 +47,23 @@ public class ProjectReactor { String content = replaceFileContent(file, groupIdNew, artifactIdNew, packageNameNew, titleNew); writeFile(file, content, projectBaseDir, projectBaseDirNew, packageNameNew, artifactIdNew); }); - long end = System.currentTimeMillis(); // TODO @seeker:直接减,不用增加变量 - log.info("[main][重写完成]共耗时:" + (end - start) / 1000 + "秒"); // TODO @seeker:logger 不要拼接字符串,用占位符 + log.info("[main][重写完成]共耗时:{} 秒", (System.currentTimeMillis() - start) / 1000); } private static String getProjectBaseDir() { - return StrUtil.subBefore(new File(ProjectReactor.class.getClassLoader().getResource(File.separator).getFile()).getPath(), "\\yudao-server", false); + return StrUtil.subBefore(new File(ProjectReactor.class.getClassLoader().getResource(File.separator).getFile()).getPath(), File.separator + "yudao-server", false); } private static Collection listFiles(String projectBaseDir) { Collection files = FileUtils.listFiles(new File(projectBaseDir), null, true); // 移除 IDEA Git GitHub 自身的文件; Node 编译出来的文件 files = files.stream() - .filter(file -> !file.getPath().contains("\\target\\") // TODO @seeker:使用 File.separator,也要考虑 mac - && !file.getPath().contains("\\node_modules\\") - && !file.getPath().contains("\\.idea\\") - && !file.getPath().contains("\\.git\\") - && !file.getPath().contains("\\.github\\") - && !file.getPath().contains("\\dist\\") + .filter(file -> !file.getPath().contains(File.separator + "target" + File.separator) + && !file.getPath().contains(File.separator + "node_modules" + File.separator) + && !file.getPath().contains(File.separator + ".idea" + File.separator) + && !file.getPath().contains(File.separator + ".git" + File.separator) + && !file.getPath().contains(File.separator + ".github" + File.separator) + && !file.getPath().contains(File.separator + "dist" + File.separator) && !file.getPath().contains(".iml") && !file.getPath().contains(".html.gz")) .collect(Collectors.toList());