View Unity3d on the plugin site for more information.
A problem, An idea ?
Please use our tasks and issues tracker to report bugs, improvements or new feature.
Also if you want to propose some code change using a Github pull request, please open also a Jira issue. It is easier for developers to track them.
Unity3d is a powerful 3d game creation editor and engine that runs on Mac and Windows.
This plugin adds the ability to call the Unity3d Editor from the command line to automate build and packaging of Unity3d applications.
Automating Unity3d builds from the command line is possible. There are a few problems though:
- the unity runner writes its output to a separate log file, instead of the output
- tool and file locations are platform specific
- only one project can be built at a time per machine
This plugin aims to make it easier to run Unity3d builds easily in Jenkins, by adding the following features:
- log file redirection
- distributed builds
The plugin was tested with unity3d 3.4.2 and unity3d 3.5 beta. Tested on distributed and single server environments
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. FIXME add a log.
The Unity Editor can only perform one build at a time. If you have multiple job, you may want to prevent more than one Unity jobs to be running at the single time. One simple way to achieve this is to have a single Executor on your build server node. This has of course drawbacks if you intend to run other types of jobs on the same node that are not affected by the same limitation.
Setting up a build step
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.
Unity3d Builder configuration parameters
The full command line, the builder adding the -projectPath (case-sensitive) if it isn't specified
- The Log Parser Plugin can help you to quickly set some parsing rules for your Unity3d builds. Here's a tentative set of rules that we use in one project:
- Automated management of iOS provisioning profiles
- Unity3d build pipeline using jenkins
- Command line install of Unity3d on mac
Version 0.4 (DEV IN PROGRESS)
Version 0.3 (06.06.202)
- Validity of Unity3D project folder was not correctly checked when projectPath parameter was used.
Version 0.2 (30.01.2012)
Version 0.1 (24.01.2012)
- live redirection of the Editor.log file into the console
- supports distributed builds
- automatically adds the -projectPath command line