nuke-build / nuke

🏗 The AKEless Build System for C#/.NET
https://nuke.build
MIT License
3.07k stars 367 forks source link

Also detect Unity version from project when running UnityTasks.UnityRunTests #1428

Closed chrisyarbrough closed 4 days ago

chrisyarbrough commented 2 months ago

This implements issue #1427.

With this change, the Unity version is detected from the project, not only when using UnityTasks.Unity, but also when using UnityTasks.UnityRunTests.

The generic PreProcess method on line 111 also handles Unity runs that don't directly relate to a project (e.g. license activation). However, for the tasks which deal with projects, we want them to auto-detect the Unity editor version from the project. Previously this was only implemented when starting the general UnityTasks.Unity method, but now it's also used when running tests.

I have tested my changes in the attached repro project of the linked issue.

I confirm that the pull-request: