美文网首页
jenkins执行unity函数

jenkins执行unity函数

作者: pawn_c | 来源:发表于2019-08-26 14:41 被阅读0次

    在unity里编辑TestEditor.cs脚本

     [MenuItem("TTT/TTTT")]
        public static void JenkinsTest()
        {
    
       
            FileInfo fileInfo = new FileInfo(Application.dataPath + "/测试.txt");
            StreamWriter sw = fileInfo.CreateText();
            sw.WriteLine(System.DateTime.Now);
            sw.Close();
            sw.Dispose();
        }
    

    然后在jenkins里配置执行代码

    -projectpath %WorkPath% -quit -batchmode -executeMethod TestEditor.JenkinsTest -logFile "D:\log.txt"

    image.png

    保存后构建


    image.png

    发现报错了,查看信息

    image.png

    原来需要关闭unity
    关闭后再次执行


    image.png

    成功

    相关文章

      网友评论

          本文标题:jenkins执行unity函数

          本文链接:https://www.haomeiwen.com/subject/qzwrectx.html