You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/02-tasks/05-unity-cmd-task.md
+47-57Lines changed: 47 additions & 57 deletions
Original file line number
Diff line number
Diff line change
@@ -6,98 +6,88 @@ sidebar_label: Unity CMD Task
6
6
7
7
# About the Unity CMD Task
8
8
9
-
This task allows for full control over the arguments passed to the Unity command line. It's aimed at advanced users with specific requirements. For most use cases and users the use of the other provided tasks is recommended as it provides a guided and targeted experience. You can find the task when editing your pipeline by searching for the name `Unity CMD`. In short: use this task only if you know what you are doing.
9
+
This task is a general use command line task. It does not do anything in particular, unless you tell it to. It will invoke the Unity command line using arguments you provided. Use this task whenever any of the other tasks does not fulfill your needs.
10
10
11
-
---
11
+
## Syntax
12
12
13
-
## Inputs
13
+
```yaml
14
+
# Unity CMD Task V1
15
+
# Invokes the Unity command line providing a custom command line argument
16
+
- task: UnityCMDTask@1
17
+
inputs:
18
+
cmdArgs: -myCustomArgument
19
+
```
14
20
15
-
This task supports input variables for configuration.
21
+
## Inputs
16
22
17
23
### unityEditorsPathMode
18
24
19
25
For the task to run successfully it needs to know where Unity installations are located at on the agent. This input lets you configure,
| environmentVariable | Expects an environment variable `UNITYHUB_EDITORS_FOLDER_LOCATION` to exist on the agent and specifying where to find editor installations. |
32
-
| specify | Let's you specify a custom path where to lookup editor installations using the input `customUnityEditorsPath`.|
38
+
| specify | Let's you specify a custom path where to lookup editor installations using the input `customUnityEditorsPath` |
33
39
34
40
### customUnityEditorsPath
35
41
36
-
If you are using a custom buld agent you may want to specify a custom path to specify where to look for Unity installations. This input lets you do that.
37
-
Make sure to set `unityEditorsPathMode` to `specify` for this input to take effect.
42
+
Should you have configured `unityEditorsPathMode` to `specify`, this input is used to read your custom path.
38
43
39
-
**Required**: Yes, if `unityEditorsPathMode` set to `specify`
| `customUnityEditorsPath` | Editors folder location | Yes, if `unityEditorsPathMode` is `specify` | - |
40
47
41
-
**Default Value**: -
48
+
### versionSelectionMode
42
49
43
-
### unityProjectPath
44
-
45
-
Enter the directory path to the Unity project. If no value is entered, the project is assumed to be in the repository root.
46
-
47
-
**Required**: No
48
-
49
-
**Default Value**: -
50
-
51
-
### cmdArgs
52
-
53
-
Specify command line arguments to pass to the Unity process when running the task.
50
+
This input defines how to determine the Unity version required to build the project on in the context of this task, which Unity editor version to install and / or actigvate a license with.
54
51
55
-
:::warning
56
-
57
-
The task will set `-batchmode`, `-projectPath` and `-logfile` for you and you shouldn't specify them in your custom command line arguments. These three arguments are currently required to be always set for the task to work as designed.
| project | Uses exactly the Unity version that the project was last opened with |
61
+
| specify | Let's you specify a Unity version to work with. See also input `version` |
68
62
69
-
---
63
+
### version
70
64
71
-
## Outputs
65
+
The version of the Unity editor to work with, e.g. `6000.0.30f1`. You can determine the version for your project using the `ProjectVersion.txt` file within your project's `ProjectSettings` folder.
| `version` | Version | Yes, if `versionSelectionMode` is `specify` | - |
74
70
75
-
### logsOutputPath
71
+
### unityProjectPath
76
72
77
-
Path to the Unity editor log files generated while executing the task. Use this e.g. to upload logs in case of a failure.
73
+
Enter the directory path to the Unity project. If no value is entered, the project is assumed to be in the repository root. Use this input, if your Unity project is nested within subfolders within your repository.
Specify command line arguments to pass to the Unity process when running the task.
84
82
85
-
In the simple YAML example below we are definiing the task a step in the pipeilne using `- task: UnityCMDTask@1`. We are also giving the task a reference name using `name: unitycmd`, so we can use it to refernce the output variables of the task in other tasks of the pipeline. E.g. we can output the value of the `logsOutputPath` output variable to the console using `echo $(unitycmd.logsOutputPath)`. For `cmdArgs` we specify that Unity should target the `standalone` platform and execute our custom build script `MyBuildTools.BuildProject` to perform the build.
0 commit comments