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/07-unity-get-project-version-task.md
+15-53Lines changed: 15 additions & 53 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,72 +8,34 @@ sidebar_label: Unity Get Project Version Task
8
8
9
9
This task will find the Unity Editor version the project was last opened with. This is especially useful
10
10
when you need to perform steps in your pipeline that depend on which Unity version is required for the project to build
11
-
and run. You can find the task when editing your pipeline by searching for the name `Unity Get Project Version`.
11
+
and run.
12
12
13
-
---
13
+
## Syntax
14
14
15
-
## Inputs
15
+
```yaml
16
+
# Unity Get Project Version Task V1
17
+
# Get the project's Unity version
18
+
- task: UnityGetProjectVersionTask@1
19
+
```
16
20
17
-
This task supports input variables for configuration.
21
+
## Inputs
18
22
19
23
### unityProjectPath
20
24
21
-
Enter the directory path to the Unity project. If no value is entered, the project is assumed to be in the repository root.
25
+
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.
This task defines the following output variables, which you can consume in downstream steps, jobs, and stages.
32
34
33
35
### projectVersion
34
36
35
37
The project version found by the task for the specified Unity project.
36
38
37
39
### projectVersionRevision
38
40
39
-
The Unity editor version revision found by the task for the specified Unity project.
40
-
41
-
---
42
-
43
-
## How to use
44
-
45
-
### YAML
46
-
47
-
In the simple YAML example below we are definiing the task a step in the pipeilne using `- task: UnityGetProjectVersionTask@1`. We are also giving the task a reference name using `name: unitygetprojectversion`, 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 `projectVersion` output variable to the console using `echo $(unitygetprojectversion.projectVersion)`.
48
-
49
-
```yaml
50
-
trigger:
51
-
- main
52
-
53
-
pool:
54
-
name: Unity Windows
55
-
56
-
steps:
57
-
- task: UnityGetProjectVersionTask@1
58
-
name: unitygetprojectversion
59
-
60
-
- script: |
61
-
echo $(unitygetprojectversion.projectVersion)
62
-
```
63
-
64
-
### Classic Pipeline Editor
65
-
66
-
The classic (visual) editor for Azure Pipelines provides input fields for configuring the task. In the simple example below, we are leaving the `Unity project path` field empty, since we know our Unity project is in the repository root. We are also assigning a `Reference name` to the task, so we can use it to refernce the output variables in the variables list in other tasks of the pipeline. E.g. to get the value of the `projectVersion` output variable and insert it into any other input field of a task we can then use `$(unitygetprojectversion.projectVersion)`.
0 commit comments