jenkins window unity 测试:svn更新u3d工程并打包生成apk

1、svn check out/update u3d工程

2、调用u3d插件Invoke Unity3d Editor插件打包生成apk

步骤如下

创建任务

jenkins window unity 测试:svn更新u3d工程并打包生成apk

 

配置svn,配置参考:https://www.cnblogs.com/wangle/p/14787191.html

jenkins window unity 测试:svn更新u3d工程并打包生成apk

 

接下来u3d插件Invoke Unity3d Editor打包生成apk

jenkins window unity 测试:svn更新u3d工程并打包生成apk

 

 

 命令行参数:

-quit -batchmode -projectPath D:\jenkins\workspace\build_efun -executeMethod JenkinsCommond.buildAndroid %major% %minor% %build%

-projectPatch是工程目录

-executeMethod:执行命令JenkinsCommond类下的buildAndroid方法,JenkinsCommond必须是UnityEditor,buildAndroid必须是静态static

%major% %minor% %build% 是参数

 参考u3d官网命令行参数:https://docs.unity3d.com/cn/current/Manual/CommandLineArguments.html

 

%major% %minor% %build%参数配置,可以配置参数类型和默认值

jenkins window unity 测试:svn更新u3d工程并打包生成apk

 

 

JenkinsCommond类

public static void buildAndroid()
	{
		string[] parameters = Environment.GetCommandLineArgs();
		JenkinsCommandParam param =new JenkinsCommandParam();
		string major = parameters[5];
		string minor = parameters[6];
		string build = parameters[7];
		//BuildAndroid(param);
	}

  

ps:

可以增加log,在unity插件命令行后面增加 

-logFile D:\jenkins\workspace\build_efun\CommandLineArguments\Log.txt 

 

-quit -batchmode -projectPath D:\jenkins\workspace\build_efun -executeMethod JenkinsCommond.buildAndroid %major% %minor% %build% -logFile D:\jenkins\workspace\build_efun\CommandLineArguments\Log.txt 

  

 

上一篇:浙江幻影星空vr体感游戏设备暗黑机甲


下一篇:Unity 3D网页游戏与flash网页游戏的较量