| | |
| | | generatorCodeHistoryService.insert(historyEntity); |
| | | |
| | | // 删除临时文件 |
| | | FileUtils.deleteDirectory(dirPath); |
| | | try { |
| | | FileUtils.deleteDirectory(dirPath); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException("删除临时文件异常"); |
| | | } |
| | | return bytes; |
| | | } |
| | | |
| | |
| | | GenUtils.drawTemplate("log.txt.vm", data, logFile); |
| | | } |
| | | |
| | | private String pkgJar(String dirPath) throws InterruptedException { |
| | | String jarSavePath = dirPath + File.separator + MdkConstant.LIBS + File.separator + "IAILMDK.jar"; |
| | | StringBuilder sb = new StringBuilder(); |
| | | sb.append("jar -cvf"); |
| | | sb.append(" ").append(jarSavePath); |
| | | sb.append(" -C ").append(dirPath).append(File.separator).append("IAILMDK").append(File.separator).append(" ."); |
| | | log.info("执行cmd命令打jar包:" + sb); |
| | | Process process = RuntimeUtil.exec(sb.toString()); |
| | | process.waitFor(); |
| | | return jarSavePath; |
| | | private String pkgJar(String dirPath) { |
| | | try { |
| | | String jarSavePath = dirPath + File.separator + MdkConstant.LIBS + File.separator + "IAILMDK.jar"; |
| | | StringBuilder sb = new StringBuilder(); |
| | | sb.append("jar -cvf"); |
| | | sb.append(" ").append(jarSavePath); |
| | | sb.append(" -C ").append(dirPath).append(File.separator).append("IAILMDK").append(File.separator).append(" ."); |
| | | log.info("执行cmd命令打jar包:" + sb); |
| | | Process process = RuntimeUtil.exec(sb.toString()); |
| | | process.waitFor(); |
| | | return jarSavePath; |
| | | } catch (InterruptedException e) { |
| | | throw new RuntimeException("执行cmd命令打jar包异常"); |
| | | } |
| | | } |
| | | |
| | | private void deleteJavaFile(List<String> javaFilePaths) { |
| | |
| | | } |
| | | } |
| | | |
| | | private void createClassFile(List<String> javaFilePaths) throws InterruptedException { |
| | | StringBuilder sb = new StringBuilder(); |
| | | sb.append("javac -encoding utf-8"); |
| | | for (String path : javaFilePaths) { |
| | | sb.append(" ").append(path); |
| | | private void createClassFile(List<String> javaFilePaths){ |
| | | try { |
| | | StringBuilder sb = new StringBuilder(); |
| | | sb.append("javac -encoding utf-8"); |
| | | for (String path : javaFilePaths) { |
| | | sb.append(" ").append(path); |
| | | } |
| | | log.info("执行cmd命令生成class:" + sb); |
| | | Process process = RuntimeUtil.exec(sb.toString()); |
| | | process.waitFor(); |
| | | } catch (InterruptedException e) { |
| | | throw new RuntimeException("执行cmd命令生成class异常"); |
| | | } |
| | | log.info("执行cmd命令生成class:" + sb); |
| | | Process process = RuntimeUtil.exec(sb.toString()); |
| | | process.waitFor(); |
| | | } |
| | | } |