feat():测试

yuan
yuan 2024-09-05 17:43:31 +08:00
parent 87118e5521
commit 5427bc562f
1 changed files with 5 additions and 1 deletions

View File

@ -3,6 +3,8 @@ package com.muyu.compile;
import com.muyu.common.core.domain.Result;
import com.muyu.constant.MethodSuffix;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.tools.*;
import java.io.File;
@ -21,6 +23,8 @@ import java.nio.file.Paths;
*/
public class JavaFileCompile {
private static final Logger log = LoggerFactory.getLogger(JavaFileCompile.class);
public static Result<Object> compile(String fileName){
try {
@ -38,7 +42,7 @@ public class JavaFileCompile {
// class文件路径
String externalClassFilePath = "/home/lib/com/muyu/generate/"+fileName+ MethodSuffix.CLASSSUFFIX;
log.info(externalClassFilePath);
Path path = Paths.get(externalClassFilePath);
String externalClassDir = externalClassFilePath.substring(0, externalClassFilePath.lastIndexOf("/"));