Skip to content

Commit

Permalink
fix(tools): SetBuildTarget and SetTestPlatform overloads in UnityTasks (
Browse files Browse the repository at this point in the history
  • Loading branch information
kkopanski authored and matkoch committed Aug 31, 2023
1 parent 0c3e9c3 commit d8d68cf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System;
using System.Linq;
using JetBrains.Annotations;
using Nuke.Common.Tooling;

namespace Nuke.Common.Tools.Unity;

Expand All @@ -15,11 +14,10 @@ public static partial class UnityProjectSettingsExtensions

/// <summary><p><em>Sets <see cref="UnityProjectSettings.BuildTarget"/>.</em></p><p>Allows the selection of an active build target before a project is loaded.</p></summary>
[Pure]
public static UnityProjectSettings SetBuildTarget(this UnityProjectSettings toolSettings, UnityBuildTarget buildTarget)
public static T SetBuildTarget<T>(this T toolSettings, UnityBuildTarget buildTarget)
where T : UnityProjectSettings
{
toolSettings = toolSettings.NewInstance();
toolSettings.BuildTarget = buildTarget.ToString();
return toolSettings;
return toolSettings.SetBuildTarget(buildTarget.ToString());
}

#endregion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System;
using System.Linq;
using JetBrains.Annotations;
using Nuke.Common.Tooling;

namespace Nuke.Common.Tools.Unity;

Expand All @@ -18,23 +17,21 @@ public static partial class UnityRunTestsSettingsExtensions
/// <p>The platform to run tests on.</p>
/// </summary>
[Pure]
public static UnityRunTestsSettings SetTestPlatform(this UnityRunTestsSettings toolSettings, UnityTestPlatform testPlatform)
public static T SetTestPlatform<T>(this T toolSettings, UnityTestPlatform testPlatform)
where T : UnityRunTestsSettings
{
toolSettings = toolSettings.NewInstance();
toolSettings.TestPlatform = testPlatform.ToString();
return toolSettings;
return toolSettings.SetTestPlatform(testPlatform.ToString());
}

/// <summary>
/// <p><em>Sets <see cref="UnityRunTestsSettings.TestPlatform"/></em></p>
/// <p>The platform to run tests on.</p>
/// </summary>
[Pure]
public static UnityRunTestsSettings SetTestPlatform(this UnityRunTestsSettings toolSettings, UnityBuildTarget buildTarget)
public static T SetTestPlatform<T>(this T toolSettings, UnityBuildTarget buildTarget)
where T : UnityRunTestsSettings
{
toolSettings = toolSettings.NewInstance();
toolSettings.TestPlatform = buildTarget.ToString();
return toolSettings;
return toolSettings.SetTestPlatform(buildTarget.ToString());
}

#endregion
Expand Down

0 comments on commit d8d68cf

Please sign in to comment.