如何从build.gradle调用Java类?

时间:2019-02-15 13:52:36

标签: gradle build.gradle

我正在尝试从我的MyTest()文件中调用build.gradle测试方法。我如何从build.gradle文件中调用以下课程?我对Java和gradle

很陌生
public class Test{

    public void MyTest() throws IOException, InterruptedException {

        String  filePathString=System.getProperty("user.dir")+"\\target\\site\\serenity\\index.html";
        Path path = Paths.get(filePathString);
        System.out.println("*********************Path of file***********************************"+path);
        try {
            if (Files.exists(path)) {


                System.out.println("File Found");
            }
            else{
                System.out.println("File not Found");
            }
        }catch (Exception e) {
            e.printStackTrace();
        }

    }

0 个答案:

没有答案