Skip to content

Commit

Permalink
Update get project version task docs
Browse files Browse the repository at this point in the history
  • Loading branch information
FejZa committed Dec 13, 2024
1 parent 26eca91 commit e11cd24
Showing 1 changed file with 15 additions and 53 deletions.
68 changes: 15 additions & 53 deletions docs/02-tasks/07-unity-get-project-version-task.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,72 +8,34 @@ sidebar_label: Unity Get Project Version Task

This task will find the Unity Editor version the project was last opened with. This is especially useful
when you need to perform steps in your pipeline that depend on which Unity version is required for the project to build
and run. You can find the task when editing your pipeline by searching for the name `Unity Get Project Version`.
and run.

---
## Syntax

## Inputs
```yaml
# Unity Get Project Version Task V1
# Get the project's Unity version
- task: UnityGetProjectVersionTask@1
```
This task supports input variables for configuration.
## Inputs
### unityProjectPath
Enter the directory path to the Unity project. If no value is entered, the project is assumed to be in the repository root.
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.
**Required**: No
| YAML | Classic Editor | Required | Default |
|----------------------------|-------------------------------|----------|---------|
| `unityProjectPath` | Unity project path | No | - |

**Default Value**: -

---
## Output variables

## Outputs

This task provides output variables.
This task defines the following output variables, which you can consume in downstream steps, jobs, and stages.

### projectVersion

The project version found by the task for the specified Unity project.

### projectVersionRevision

The Unity editor version revision found by the task for the specified Unity project.

---

## How to use

### YAML

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)`.

```yaml
trigger:
- main

pool:
name: Unity Windows

steps:
- task: UnityGetProjectVersionTask@1
name: unitygetprojectversion

- script: |
echo $(unitygetprojectversion.projectVersion)
```
### Classic Pipeline Editor
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)`.

![Classic Pipeline Designer Task Configuration](../../static/img/unity-get-project-version-task/get-project-version-classic.png)

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

---

## Log

When run and successful the task will provide log output similar to this:

![Task Log](../../static/img/unity-get-project-version-task/get-project-version-log.png)
The Unity editor version revision found by the task for the specified Unity project.

0 comments on commit e11cd24

Please sign in to comment.