Skip to content

Commit 26eca91

Browse files
committed
Unity CMD docs updated
1 parent 76120a3 commit 26eca91

File tree

1 file changed

+47
-57
lines changed

1 file changed

+47
-57
lines changed

docs/02-tasks/05-unity-cmd-task.md

Lines changed: 47 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -6,98 +6,88 @@ sidebar_label: Unity CMD Task
66

77
# About the Unity CMD Task
88

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.
1010

11-
---
11+
## Syntax
1212

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+
```
1420
15-
This task supports input variables for configuration.
21+
## Inputs
1622
1723
### unityEditorsPathMode
1824
1925
For the task to run successfully it needs to know where Unity installations are located at on the agent. This input lets you configure,
2026
where the task should look for installations.
2127
22-
**Required**: Yes
23-
24-
**Default Value**: unityHub
28+
| YAML | Classic Editor | Required | Default |
29+
|----------------------------|-------------------------------|----------|---------|
30+
| `unityEditorsPathMode` | Unity editors location | Yes | default |
2531

2632
#### Options:
2733

2834
| Value | Description |
2935
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
30-
| unityHub | Uses the Unity Hub default installation path. |
36+
| default | Uses the Unity Hub default installation path |
3137
| 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` |
3339

3440
### customUnityEditorsPath
3541

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.
3843

39-
**Required**: Yes, if `unityEditorsPathMode` set to `specify`
44+
| YAML | Classic Editor | Required | Default |
45+
|----------------------------|-------------------------------|----------|---------|
46+
| `customUnityEditorsPath` | Editors folder location | Yes, if `unityEditorsPathMode` is `specify` | - |
4047

41-
**Default Value**: -
48+
### versionSelectionMode
4249

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.
5451

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.
58-
59-
:::
60-
61-
**Required**: Yes
62-
63-
**Default Value**: -
52+
| YAML | Classic Editor | Required | Default |
53+
|----------------------------|-------------------------------|----------|---------|
54+
| `versionSelectionMode` | Unity version | Yes | project |
6455

6556
#### Options:
6657

67-
Check the official [Unity command line documentation](https://docs.unity3d.com/Manual/CommandLineArguments.html) for options.
58+
| Value | Description |
59+
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
60+
| 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` |
6862

69-
---
63+
### version
7064

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.
7266

73-
This task provides output variables.
67+
| YAML | Classic Editor | Required | Default |
68+
|----------------------------|-------------------------------|----------|---------|
69+
| `version` | Version | Yes, if `versionSelectionMode` is `specify` | - |
7470

75-
### logsOutputPath
71+
### unityProjectPath
7672

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.
7874

79-
---
75+
| YAML | Classic Editor | Required | Default |
76+
|----------------------------|-------------------------------|----------|---------|
77+
| `unityProjectPath` | Unity project path | No | - |
8078

81-
## How to use
79+
### cmdArgs
8280

83-
### YAML
81+
Specify command line arguments to pass to the Unity process when running the task.
8482

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.
83+
| YAML | Classic Editor | Required | Default |
84+
|----------------------------|-------------------------------|----------|---------|
85+
| `cmdArgs` | Command line arguments | Yes | - |
8686

87-
```yaml
88-
trigger:
89-
- main
87+
## Output variables
9088

91-
pool:
92-
name: Unity Windows
89+
This task defines the following output variables, which you can consume in downstream steps, jobs, and stages.
9390

94-
steps:
95-
- task: UnityCMDTask@1
96-
name: unitycmd
97-
inputs:
98-
unityEditorsPathMode: unityHub
99-
cmdArgs: -buildTarget standalone -executeMethod MyBuildTools.BuildProject
91+
### editorLogFilePath
10092

101-
- script: |
102-
echo $(unitycmd.logsOutputPath)
103-
```
93+
Path to the Unity editor log file generated while executing the task.

0 commit comments

Comments
 (0)