As Unity3d is multi-platform, you may need to install the proper third party OS & tools (Android SDK, XCode, etc) depending on the type of build targets you intend to exercise.
Install the latest version of the plugin from the update center and configure a freestyle job (see Usage Guide). If necessary restrict the job to the node(s) that will perform the build(s).
On the node(s) you are going to build Unity projects, add at least one unity3d installation (Manage Jenkins -> Configure System) and configure the location of the Unity3d installation. This location is by default /Applications/Unity/Unity.app on Mac OS X and C:\Program Files (x86)\Unity on Windows. The plugin will automatically suffix the installation path with the proper executable location.
The plugin assumes you've created a special Editor class with at least one method responsible for your build.
Here's an example extracted from one of our projects:
On Mac OS X, the user running needs to be logged in otherwise the Unity3d editor might fail to acquire the graphical resources.
If you don't you might see something like
FIXME describe and add a log about what happens on Windows.
The Unity Editor can only perform one build at a time on a given projectPath. If you want to run multiple builds in parallels for the same project, you will need to create multiple jobs, each with their workspace.
Add the Unity3d build step to a free-style project, select the unity3d installation and set your command line arguments (e.g. -quit -batchmode -executeMethod MyEditorScript.PerformMacOSXBuild). If you do not specify -projectPath (case-sensitive), the plugin will use the current workspace. You may want to add an extra step to clean the project before you build to make sure the build starts in a clean state.
If you want to build for iOS, you will have to add extra build steps to trigger xcode build. This step isn't covered here. Same for Windows 8/10.
To automatically install unity3d from jenkins (even beta versions),
1. install this set of scripts.
If the plugin fails to run the command you want it to run here are some steps you can perform to help identifying the issue:
Skip to end of metadata Go to start of metadata