diff --git a/.teamcity/pom.xml b/.teamcity/pom.xml index e904d7c01..7e8197f8a 100644 --- a/.teamcity/pom.xml +++ b/.teamcity/pom.xml @@ -15,7 +15,7 @@ jetbrains-all - http://download.jetbrains.com/teamcity-repository + https://download.jetbrains.com/teamcity-repository true @@ -32,7 +32,7 @@ JetBrains - http://download.jetbrains.com/teamcity-repository + https://download.jetbrains.com/teamcity-repository diff --git a/CHANGELOG.md b/CHANGELOG.md index 575ce31e2..f9e154a08 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,24 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [vNext] +## [7.0.3] / 2023-08-21 +- Fixed enumeration value sets to exclude non-public fields +- Fixed check for `NUKE_ENTERPRISE_TOKEN` in `build.sh` bootstrapping script +- Fixed default warnings with suppression +- Fixed telemetry to treat types as _common_ when their assembly points to home repository +- Fixed filtering of secrets in CLT `Output` collection +- Fixed handling of `AbsolutePath` collections in `ArgumentStringHandler` +- Fixed handling of `IAbsolutePathHolder` in `ArgumentStringHandler` +- Fixed handling of `relativePath` for `SolutionAttribute` in `StronglyTypedSolutionGenerator` +- Fixed error reporting in `StronglyTypedSolutionGenerator` +- Fixed TeamCity `pom.xml` template to use HTTPS +- Fixed duplicated payload serialization in `TeamsTasks` +- Fixed missing arguments in `OctopusTasks` +- Fixed missing command in `UnityTasks` +- Fixed missing members in `UnitBuildTarget` +- Fixed argument formatting in `MSpecTasks` +- Fixed assertion in `UnityTasks` + ## [7.0.2] / 2023-05-19 - Fixed string-based command-line tool tasks to not require interpolated strings - Fixed secret filtering @@ -1357,3 +1375,102 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. [0.3.1]: https://github.com/nuke-build/nuke/compare/0.2.10...0.3.1 [0.2.10]: https://github.com/nuke-build/nuke/compare/0.2.0...0.2.10 [0.2.0]: https://github.com/nuke-build/nuke/tree/0.2.0 + +[vNext]: https://github.com/nuke-build/nuke/compare/7.0.3...HEAD +[7.0.3]: https://github.com/nuke-build/nuke/compare/7.0.2...7.0.3 +[7.0.2]: https://github.com/nuke-build/nuke/compare/7.0.1...7.0.2 +[7.0.1]: https://github.com/nuke-build/nuke/compare/7.0.0...7.0.1 +[7.0.0]: https://github.com/nuke-build/nuke/compare/6.3.0...7.0.0 +[6.3.0]: https://github.com/nuke-build/nuke/compare/6.2.1...6.3.0 +[6.2.1]: https://github.com/nuke-build/nuke/compare/6.2.0...6.2.1 +[6.2.0]: https://github.com/nuke-build/nuke/compare/6.1.2...6.2.0 +[6.1.2]: https://github.com/nuke-build/nuke/compare/6.1.1...6.1.2 +[6.1.1]: https://github.com/nuke-build/nuke/compare/6.1.0...6.1.1 +[6.1.0]: https://github.com/nuke-build/nuke/compare/6.0.3...6.1.0 +[6.0.3]: https://github.com/nuke-build/nuke/compare/6.0.2...6.0.3 +[6.0.2]: https://github.com/nuke-build/nuke/compare/6.0.1...6.0.2 +[6.0.1]: https://github.com/nuke-build/nuke/compare/6.0.0...6.0.1 +[6.0.0]: https://github.com/nuke-build/nuke/compare/5.3.0...6.0.0 +[5.3.0]: https://github.com/nuke-build/nuke/compare/5.2.1...5.3.0 +[5.2.1]: https://github.com/nuke-build/nuke/compare/5.2.0...5.2.1 +[5.2.0]: https://github.com/nuke-build/nuke/compare/5.1.4...5.2.0 +[5.1.4]: https://github.com/nuke-build/nuke/compare/5.1.3...5.1.4 +[5.1.3]: https://github.com/nuke-build/nuke/compare/5.1.2...5.1.3 +[5.1.2]: https://github.com/nuke-build/nuke/compare/5.1.1...5.1.2 +[5.1.1]: https://github.com/nuke-build/nuke/compare/5.1.0...5.1.1 +[5.1.0]: https://github.com/nuke-build/nuke/compare/5.0.2...5.1.0 +[5.0.2]: https://github.com/nuke-build/nuke/compare/5.0.1...5.0.2 +[5.0.1]: https://github.com/nuke-build/nuke/compare/5.0.0...5.0.1 +[5.0.0]: https://github.com/nuke-build/nuke/compare/0.25.0...5.0.0 +[0.25.0]: https://github.com/nuke-build/nuke/compare/0.24.11...0.25.0 +[0.24.11]: https://github.com/nuke-build/nuke/compare/0.24.10...0.24.11 +[0.24.10]: https://github.com/nuke-build/nuke/compare/0.24.9...0.24.10 +[0.24.9]: https://github.com/nuke-build/nuke/compare/0.24.8...0.24.9 +[0.24.8]: https://github.com/nuke-build/nuke/compare/0.24.7...0.24.8 +[0.24.7]: https://github.com/nuke-build/nuke/compare/0.24.6...0.24.7 +[0.24.6]: https://github.com/nuke-build/nuke/compare/0.24.5...0.24.6 +[0.24.5]: https://github.com/nuke-build/nuke/compare/0.24.4...0.24.5 +[0.24.4]: https://github.com/nuke-build/nuke/compare/0.24.2...0.24.4 +[0.24.2]: https://github.com/nuke-build/nuke/compare/0.24.1...0.24.2 +[0.24.1]: https://github.com/nuke-build/nuke/compare/0.24.0...0.24.1 +[0.24.0]: https://github.com/nuke-build/nuke/compare/0.23.7...0.24.0 +[0.23.7]: https://github.com/nuke-build/nuke/compare/0.23.6...0.23.7 +[0.23.6]: https://github.com/nuke-build/nuke/compare/0.23.5...0.23.6 +[0.23.5]: https://github.com/nuke-build/nuke/compare/0.23.4...0.23.5 +[0.23.4]: https://github.com/nuke-build/nuke/compare/0.23.3...0.23.4 +[0.23.3]: https://github.com/nuke-build/nuke/compare/0.23.2...0.23.3 +[0.23.2]: https://github.com/nuke-build/nuke/compare/0.23.1...0.23.2 +[0.23.1]: https://github.com/nuke-build/nuke/compare/0.23.0...0.23.1 +[0.23.0]: https://github.com/nuke-build/nuke/compare/0.22.2...0.23.0 +[0.22.2]: https://github.com/nuke-build/nuke/compare/0.22.1...0.22.2 +[0.22.1]: https://github.com/nuke-build/nuke/compare/0.22.0...0.22.1 +[0.22.0]: https://github.com/nuke-build/nuke/compare/0.21.2...0.22.0 +[0.21.2]: https://github.com/nuke-build/nuke/compare/0.21.1...0.21.2 +[0.21.1]: https://github.com/nuke-build/nuke/compare/0.21.0...0.21.1 +[0.21.0]: https://github.com/nuke-build/nuke/compare/0.20.1...0.21.0 +[0.20.1]: https://github.com/nuke-build/nuke/compare/0.20.0...0.20.1 +[0.20.0]: https://github.com/nuke-build/nuke/compare/0.19.2...0.20.0 +[0.19.2]: https://github.com/nuke-build/nuke/compare/0.19.1...0.19.2 +[0.19.1]: https://github.com/nuke-build/nuke/compare/0.19.0...0.19.1 +[0.19.0]: https://github.com/nuke-build/nuke/compare/0.18.0...0.19.0 +[0.18.0]: https://github.com/nuke-build/nuke/compare/0.17.7...0.18.0 +[0.17.7]: https://github.com/nuke-build/nuke/compare/0.17.6...0.17.7 +[0.17.6]: https://github.com/nuke-build/nuke/compare/0.17.5...0.17.6 +[0.17.5]: https://github.com/nuke-build/nuke/compare/0.17.4...0.17.5 +[0.17.4]: https://github.com/nuke-build/nuke/compare/0.17.3...0.17.4 +[0.17.3]: https://github.com/nuke-build/nuke/compare/0.17.2...0.17.3 +[0.17.2]: https://github.com/nuke-build/nuke/compare/0.17.1...0.17.2 +[0.17.1]: https://github.com/nuke-build/nuke/compare/0.17.0...0.17.1 +[0.17.0]: https://github.com/nuke-build/nuke/compare/0.16.0...0.17.0 +[0.16.0]: https://github.com/nuke-build/nuke/compare/0.15.0...0.16.0 +[0.15.0]: https://github.com/nuke-build/nuke/compare/0.14.1...0.15.0 +[0.14.1]: https://github.com/nuke-build/nuke/compare/0.14.0...0.14.1 +[0.14.0]: https://github.com/nuke-build/nuke/compare/0.13.0...0.14.0 +[0.13.0]: https://github.com/nuke-build/nuke/compare/0.12.4...0.13.0 +[0.12.4]: https://github.com/nuke-build/nuke/compare/0.12.3...0.12.4 +[0.12.3]: https://github.com/nuke-build/nuke/compare/0.12.2...0.12.3 +[0.12.2]: https://github.com/nuke-build/nuke/compare/0.12.1...0.12.2 +[0.12.1]: https://github.com/nuke-build/nuke/compare/0.12.0...0.12.1 +[0.12.0]: https://github.com/nuke-build/nuke/compare/0.11.1...0.12.0 +[0.11.1]: https://github.com/nuke-build/nuke/compare/0.11.0...0.11.1 +[0.11.0]: https://github.com/nuke-build/nuke/compare/0.10.5...0.11.0 +[0.10.5]: https://github.com/nuke-build/nuke/compare/0.10.4...0.10.5 +[0.10.4]: https://github.com/nuke-build/nuke/compare/0.10.3...0.10.4 +[0.10.3]: https://github.com/nuke-build/nuke/compare/0.10.2...0.10.3 +[0.10.2]: https://github.com/nuke-build/nuke/compare/0.10.1...0.10.2 +[0.10.1]: https://github.com/nuke-build/nuke/compare/0.10.0...0.10.1 +[0.10.0]: https://github.com/nuke-build/nuke/compare/0.9.1...0.10.0 +[0.9.1]: https://github.com/nuke-build/nuke/compare/0.9.0...0.9.1 +[0.9.0]: https://github.com/nuke-build/nuke/compare/0.8.0...0.9.0 +[0.8.0]: https://github.com/nuke-build/nuke/compare/0.7.0...0.8.0 +[0.7.0]: https://github.com/nuke-build/nuke/compare/0.6.2...0.7.0 +[0.6.2]: https://github.com/nuke-build/nuke/compare/0.6.1...0.6.2 +[0.6.1]: https://github.com/nuke-build/nuke/compare/0.6.0...0.6.1 +[0.6.0]: https://github.com/nuke-build/nuke/compare/0.5.3...0.6.0 +[0.5.3]: https://github.com/nuke-build/nuke/compare/0.5.2...0.5.3 +[0.5.2]: https://github.com/nuke-build/nuke/compare/0.5.0...0.5.2 +[0.5.0]: https://github.com/nuke-build/nuke/compare/0.4.0...0.5.0 +[0.4.0]: https://github.com/nuke-build/nuke/compare/0.3.1...0.4.0 +[0.3.1]: https://github.com/nuke-build/nuke/compare/0.2.10...0.3.1 +[0.2.10]: https://github.com/nuke-build/nuke/compare/0.2.0...0.2.10 +[0.2.0]: https://github.com/nuke-build/nuke/tree/0.2.0 diff --git a/appveyor.yml b/appveyor.yml index 1de2a63af..2c9b2f882 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -37,7 +37,7 @@ environment: PublicNuGetApiKey: secure: dSaquYHVNEAZO+hhGGoGqeHaVP99BP8koHTTqcD3WInWBTmB7yE4CzxZ1pWypnX2 GitHubReleaseGitHubToken: - secure: a5UfxXiDEere9GkCCN9TUZJWacHMSkLKJi5UIqUDk7eB0DyoZomXaK918QWkyrbGlkz7hWIRIBGT/z2lCld/DgM9QP5Gx8PvEglDpTSILmGiQ2wTDySc78gG7h3dfQxg + secure: a5UfxXiDEere9GkCCN9TUZMUdyzjC01cvHthbMLtSl0w+/giDwOyApiHRRRrwyKL5yd/vjD6xDBTBj+W/ZxKzMtzC+gDCSTNO8bSJG9Rh2n9eGzLtWzEFDw/zDYZXe5N SignPathApiToken: secure: uQTH2MxpqiqWTy7EJkjtNc43ipG17EUOQN99QsODRNgtNEcikDaP0t4ylekK/ibn TwitterConsumerKey: diff --git a/build/Build.CI.AppVeyor.cs b/build/Build.CI.AppVeyor.cs index cbbc90071..e91a2c584 100644 --- a/build/Build.CI.AppVeyor.cs +++ b/build/Build.CI.AppVeyor.cs @@ -35,7 +35,7 @@ InvokedTargets = new[] { nameof(ITest.Test), nameof(IPack.Pack) }, Secrets = new string[0])] [AppVeyorSecret(nameof(PublicNuGetApiKey), "dSaquYHVNEAZO+hhGGoGqeHaVP99BP8koHTTqcD3WInWBTmB7yE4CzxZ1pWypnX2")] -[AppVeyorSecret(ICreateGitHubRelease.GitHubRelease + nameof(ICreateGitHubRelease.GitHubToken), "a5UfxXiDEere9GkCCN9TUZJWacHMSkLKJi5UIqUDk7eB0DyoZomXaK918QWkyrbGlkz7hWIRIBGT/z2lCld/DgM9QP5Gx8PvEglDpTSILmGiQ2wTDySc78gG7h3dfQxg")] +[AppVeyorSecret(ICreateGitHubRelease.GitHubRelease + nameof(ICreateGitHubRelease.GitHubToken), "a5UfxXiDEere9GkCCN9TUZMUdyzjC01cvHthbMLtSl0w+/giDwOyApiHRRRrwyKL5yd/vjD6xDBTBj+W/ZxKzMtzC+gDCSTNO8bSJG9Rh2n9eGzLtWzEFDw/zDYZXe5N")] [AppVeyorSecret(ISignPackages.SignPath + nameof(ISignPackages.ApiToken), "uQTH2MxpqiqWTy7EJkjtNc43ipG17EUOQN99QsODRNgtNEcikDaP0t4ylekK/ibn")] [AppVeyorSecret(IHazTwitterCredentials.Twitter + nameof(IHazTwitterCredentials.ConsumerKey), "mYr1Uw8bcVUyl1P0prdaUFurdiF7V283BSRlQHxe2Zg=")] [AppVeyorSecret(IHazTwitterCredentials.Twitter + nameof(IHazTwitterCredentials.ConsumerSecret), "pGt5X6KOwj/bLM4A5mnDRBqPxt7o7UreSlZSFmbfZwyfKZnhfFRnr20fXWjVqToVw7NSp30s6GxjswTrQSIogw==")] diff --git a/build/Build.GitFlow.cs b/build/Build.GitFlow.cs index 53b5be505..a1554a27b 100644 --- a/build/Build.GitFlow.cs +++ b/build/Build.GitFlow.cs @@ -51,7 +51,7 @@ partial class Build System.Console.ReadKey(); Git($"add {changelogFile}"); - Git($"commit -m \"Finalize {Path.GetFileName(changelogFile)} for {MajorMinorPatchVersion}\""); + Git($"commit -m \"chore: {Path.GetFileName(changelogFile)} for {MajorMinorPatchVersion}\""); }); [UsedImplicitly] diff --git a/source/Nuke.Build/Execution/Extensions/ArgumentsFromParametersFileAttribute.cs b/source/Nuke.Build/Execution/Extensions/ArgumentsFromParametersFileAttribute.cs index 9171cf47a..b165d1e51 100644 --- a/source/Nuke.Build/Execution/Extensions/ArgumentsFromParametersFileAttribute.cs +++ b/source/Nuke.Build/Execution/Extensions/ArgumentsFromParametersFileAttribute.cs @@ -49,9 +49,7 @@ string DecryptValue(string profile, string name, string value) // TODO: Abstract AbsolutePath/Solution/Project etc. string ConvertValue(Type scalarType, string value) - => scalarType == typeof(AbsolutePath) || - typeof(Solution).IsAssignableFrom(scalarType) || - scalarType == typeof(Project) + => scalarType.IsAssignableTo(typeof(IAbsolutePathHolder)) ? PathConstruction.HasPathRoot(value) ? value : EnvironmentInfo.WorkingDirectory.GetUnixRelativePathTo(Build.RootDirectory / value) diff --git a/source/Nuke.Build/Execution/ParameterService.cs b/source/Nuke.Build/Execution/ParameterService.cs index 54d32c1a0..b62071cc6 100644 --- a/source/Nuke.Build/Execution/ParameterService.cs +++ b/source/Nuke.Build/Execution/ParameterService.cs @@ -98,7 +98,7 @@ public static string GetParameterDescription(MemberInfo member) IEnumerable<(string Text, object Object)> TryGetFromEnumerationClass() => memberType.IsSubclassOf(typeof(Enumeration)) - ? memberType.GetFields(Static).Select(x => (x.Name, x.GetValue())) + ? memberType.GetFields(BindingFlags.Public | BindingFlags.Static).Select(x => (x.Name, x.GetValue())) : null; IEnumerable<(string Text, object Object)> TryGetFromEnum() diff --git a/source/Nuke.Build/Telemetry/Telemetry.Properties.cs b/source/Nuke.Build/Telemetry/Telemetry.Properties.cs index 19a2262c6..f980b17a8 100644 --- a/source/Nuke.Build/Telemetry/Telemetry.Properties.cs +++ b/source/Nuke.Build/Telemetry/Telemetry.Properties.cs @@ -124,7 +124,9 @@ private static IDictionary GetGeneratorProperties(Type hostType, private static bool IsCommonType(Type type) { - return type.Assembly == typeof(NukeBuild).Assembly; + return type.Assembly + .GetCustomAttributes() + .Any(x => x is { Key: "RepositoryUrl", Value: "https://github.com/nuke-build/nuke" }); } private static bool IsCustomType(Type type) diff --git a/source/Nuke.Common/CI/TeamCity/Configuration/pom.xml b/source/Nuke.Common/CI/TeamCity/Configuration/pom.xml index f40ce47b6..7e8197f8a 100644 --- a/source/Nuke.Common/CI/TeamCity/Configuration/pom.xml +++ b/source/Nuke.Common/CI/TeamCity/Configuration/pom.xml @@ -15,7 +15,7 @@ jetbrains-all - http://download.jetbrains.com/teamcity-repository + https://download.jetbrains.com/teamcity-repository true @@ -32,7 +32,7 @@ JetBrains - http://download.jetbrains.com/teamcity-repository + https://download.jetbrains.com/teamcity-repository @@ -101,4 +101,4 @@ compile - \ No newline at end of file + diff --git a/source/Nuke.Common/CI/TeamCity/TeamCityAttribute.cs b/source/Nuke.Common/CI/TeamCity/TeamCityAttribute.cs index b4202d554..d0a9c59df 100644 --- a/source/Nuke.Common/CI/TeamCity/TeamCityAttribute.cs +++ b/source/Nuke.Common/CI/TeamCity/TeamCityAttribute.cs @@ -277,20 +277,18 @@ protected virtual TeamCityParameter GetParameter(MemberInfo member, bool require var valueSet = ParameterService.GetParameterValueSet(member, Build); var valueSeparator = attribute.NotNull().Separator ?? " "; - // TODO: Abstract AbsolutePath/Solution/Project etc. + var memberType = member.GetMemberType(); var defaultValue = !member.HasCustomAttribute() ? member.GetValue(Build) : default(string); // TODO: enumerables of ... if (defaultValue != null && - (member.GetMemberType() == typeof(AbsolutePath) || - member.GetMemberType() == typeof(Solution) || - member.GetMemberType() == typeof(Project))) + (memberType.IsAssignableTo(typeof(IAbsolutePathHolder)))) defaultValue = Build.RootDirectory.GetUnixRelativePathTo(defaultValue.ToString()); TeamCityParameterType GetParameterType() { if (member.HasCustomAttribute()) return TeamCityParameterType.Password; - if (member.GetMemberType() == typeof(bool)) + if (memberType == typeof(bool)) return TeamCityParameterType.Checkbox; if (valueSet != null) return TeamCityParameterType.Select; @@ -304,11 +302,11 @@ TeamCityParameterType GetParameterType() Description = attribute.Description, Options = valueSet?.ToDictionary(x => x.Item1, x => x.Item2), Type = GetParameterType(), - DefaultValue = member.GetMemberType().IsArray && defaultValue is IEnumerable enumerable + DefaultValue = memberType.IsArray && defaultValue is IEnumerable enumerable ? enumerable.Cast().Select(x => x.ToString()).Join(valueSeparator) : defaultValue?.ToString(), Display = required ? TeamCityParameterDisplay.Prompt : TeamCityParameterDisplay.Normal, - AllowMultiple = member.GetMemberType().IsArray && valueSet is not null, + AllowMultiple = memberType.IsArray && valueSet is not null, ValueSeparator = valueSeparator }; } diff --git a/source/Nuke.Common/Tools/MSpec/MSpec.Generated.cs b/source/Nuke.Common/Tools/MSpec/MSpec.Generated.cs index 9be4fe6e3..2a2a86b7c 100644 --- a/source/Nuke.Common/Tools/MSpec/MSpec.Generated.cs +++ b/source/Nuke.Common/Tools/MSpec/MSpec.Generated.cs @@ -64,9 +64,9 @@ public static IReadOnlyCollection MSpec(ArgumentStringHandler arguments, ///
  • --teamcity via
  • ///
  • --timeinfo via
  • ///
  • --xml via
  • - ///
  • -f via
  • - ///
  • -i via
  • - ///
  • -x via
  • + ///
  • -exclude via
  • + ///
  • -filters via
  • + ///
  • -include via
  • /// /// public static IReadOnlyCollection MSpec(MSpecSettings toolSettings = null) @@ -94,9 +94,9 @@ public static IReadOnlyCollection MSpec(MSpecSettings toolSettings = nul ///
  • --teamcity via
  • ///
  • --timeinfo via
  • ///
  • --xml via
  • - ///
  • -f via
  • - ///
  • -i via
  • - ///
  • -x via
  • + ///
  • -exclude via
  • + ///
  • -filters via
  • + ///
  • -include via
  • /// /// public static IReadOnlyCollection MSpec(Configure configurator) @@ -121,9 +121,9 @@ public static IReadOnlyCollection MSpec(Configure configu ///
  • --teamcity via
  • ///
  • --timeinfo via
  • ///
  • --xml via
  • - ///
  • -f via
  • - ///
  • -i via
  • - ///
  • -x via
  • + ///
  • -exclude via
  • + ///
  • -filters via
  • + ///
  • -include via
  • /// /// public static IEnumerable<(MSpecSettings Settings, IReadOnlyCollection Output)> MSpec(CombinatorialConfigure configurator, int degreeOfParallelism = 1, bool completeOnFailure = false) @@ -210,11 +210,11 @@ protected override Arguments ConfigureProcessArguments(Arguments arguments) { arguments .Add("{value}", Assemblies, separator: ' ') - .Add("-f={value}", Filters, separator: ',') - .Add("-i={value}", Includes, separator: ',') - .Add("-x={value}", Excludes, separator: ',') - .Add("--html={value}", HtmlOutput) - .Add("--xml={value}", XmlOutput) + .Add("-filters {value}", Filters, separator: ',') + .Add("-include {value}", Includes, separator: ',') + .Add("-exclude {value}", Excludes, separator: ',') + .Add("--html {value}", HtmlOutput) + .Add("--xml {value}", XmlOutput) .Add("--teamcity", TeamCity) .Add("--no-teamcity-autodetect", NoTeamCity) .Add("--appveyor", AppVeyor) diff --git a/source/Nuke.Common/Tools/MSpec/MSpec.json b/source/Nuke.Common/Tools/MSpec/MSpec.json index 0d19beaa7..1bbfcbd2a 100644 --- a/source/Nuke.Common/Tools/MSpec/MSpec.json +++ b/source/Nuke.Common/Tools/MSpec/MSpec.json @@ -23,34 +23,34 @@ { "name": "Filters", "type": "List", - "format": "-f={value}", + "format": "-filters {value}", "separator": ",", "help": "Filter file specifying contexts to execute (full type name, one per line). Takes precedence over tags." }, { "name": "Includes", "type": "List", - "format": "-i={value}", + "format": "-include {value}", "separator": ",", "help": "Executes all specifications in contexts with these comma delimited tags. Ex. -i 'foo, bar, foo_bar'." }, { "name": "Excludes", "type": "List", - "format": "-x={value}", + "format": "-exclude {value}", "separator": ",", "help": "Exclude specifications in contexts with these comma delimited tags. Ex. -x 'foo, bar, foo_bar'." }, { "name": "HtmlOutput", "type": "string", - "format": "--html={value}", + "format": "--html {value}", "help": "Outputs the HTML report to path, one-per-assembly w/ index.html (if directory, otherwise all are in one file). Ex. --html=output/reports/" }, { "name": "XmlOutput", "type": "string", - "format": "--xml={value}", + "format": "--xml {value}", "help": "Outputs the XML report to the file referenced by the path. Ex. --xml=output/reports/MSpecResults.xml" }, { diff --git a/source/Nuke.Common/Tools/Octopus/Octopus.Generated.cs b/source/Nuke.Common/Tools/Octopus/Octopus.Generated.cs index cacc537a6..0d475189f 100644 --- a/source/Nuke.Common/Tools/Octopus/Octopus.Generated.cs +++ b/source/Nuke.Common/Tools/Octopus/Octopus.Generated.cs @@ -236,6 +236,8 @@ public static IReadOnlyCollection OctopusPush(Configure--enableServiceMessages via ///
  • --force via
  • ///
  • --forcepackagedownload via
  • + ///
  • --gitCommit via
  • + ///
  • --gitRef via
  • ///
  • --guidedfailure via
  • ///
  • --ignorechannelrules via
  • ///
  • --ignoreexisting via
  • @@ -295,6 +297,8 @@ public static IReadOnlyCollection OctopusCreateRelease(OctopusCreateRele ///
  • --enableServiceMessages via
  • ///
  • --force via
  • ///
  • --forcepackagedownload via
  • + ///
  • --gitCommit via
  • + ///
  • --gitRef via
  • ///
  • --guidedfailure via
  • ///
  • --ignorechannelrules via
  • ///
  • --ignoreexisting via
  • @@ -351,6 +355,8 @@ public static IReadOnlyCollection OctopusCreateRelease(Configure--enableServiceMessages via ///
  • --force via
  • ///
  • --forcepackagedownload via
  • + ///
  • --gitCommit via
  • + ///
  • --gitRef via
  • ///
  • --guidedfailure via
  • ///
  • --ignorechannelrules via
  • ///
  • --ignoreexisting via
  • @@ -851,6 +857,14 @@ public partial class OctopusCreateReleaseSettings : ToolSettings /// public virtual string DefaultPackageVersion { get; internal set; } /// + /// Git commit to use when creating the release. Use in conjunction with the --gitRef parameter to select any previous commit. + /// + public virtual string GitCommit { get; internal set; } + /// + /// Git reference to use when creating the release. + /// + public virtual string GitRef { get; internal set; } + /// /// Release number to use for the new release. /// public virtual string Version { get; internal set; } @@ -1025,6 +1039,8 @@ protected override Arguments ConfigureProcessArguments(Arguments arguments) .Add("create-release") .Add("--project={value}", Project) .Add("--packageversion={value}", DefaultPackageVersion) + .Add("--gitCommit={value}", GitCommit) + .Add("--gitRef={value}", GitRef) .Add("--version={value}", Version) .Add("--channel={value}", Channel) .Add("--package={value}", PackageVersions, "{key}:{value}") @@ -2515,6 +2531,54 @@ public static T ResetDefaultPackageVersion(this T toolSettings) where T : Oct return toolSettings; } #endregion + #region GitCommit + /// + ///

    Sets

    + ///

    Git commit to use when creating the release. Use in conjunction with the --gitRef parameter to select any previous commit.

    + ///
    + [Pure] + public static T SetGitCommit(this T toolSettings, string gitCommit) where T : OctopusCreateReleaseSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.GitCommit = gitCommit; + return toolSettings; + } + /// + ///

    Resets

    + ///

    Git commit to use when creating the release. Use in conjunction with the --gitRef parameter to select any previous commit.

    + ///
    + [Pure] + public static T ResetGitCommit(this T toolSettings) where T : OctopusCreateReleaseSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.GitCommit = null; + return toolSettings; + } + #endregion + #region GitRef + /// + ///

    Sets

    + ///

    Git reference to use when creating the release.

    + ///
    + [Pure] + public static T SetGitRef(this T toolSettings, string gitRef) where T : OctopusCreateReleaseSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.GitRef = gitRef; + return toolSettings; + } + /// + ///

    Resets

    + ///

    Git reference to use when creating the release.

    + ///
    + [Pure] + public static T ResetGitRef(this T toolSettings) where T : OctopusCreateReleaseSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.GitRef = null; + return toolSettings; + } + #endregion #region Version /// ///

    Sets

    diff --git a/source/Nuke.Common/Tools/Octopus/Octopus.json b/source/Nuke.Common/Tools/Octopus/Octopus.json index 46a7463e5..7e96a50b4 100644 --- a/source/Nuke.Common/Tools/Octopus/Octopus.json +++ b/source/Nuke.Common/Tools/Octopus/Octopus.json @@ -144,6 +144,18 @@ "format": "--packageversion={value}", "help": "Default version number of all packages to use for this release." }, + { + "name": "GitCommit", + "type": "string", + "format": "--gitCommit={value}", + "help": "Git commit to use when creating the release. Use in conjunction with the --gitRef parameter to select any previous commit." + }, + { + "name": "GitRef", + "type": "string", + "format": "--gitRef={value}", + "help": "Git reference to use when creating the release." + }, { "name": "Version", "type": "string", diff --git a/source/Nuke.Common/Tools/Teams/TeamsTasks.cs b/source/Nuke.Common/Tools/Teams/TeamsTasks.cs index a1821f028..c73f3da73 100644 --- a/source/Nuke.Common/Tools/Teams/TeamsTasks.cs +++ b/source/Nuke.Common/Tools/Teams/TeamsTasks.cs @@ -24,12 +24,11 @@ public static void SendTeamsMessage(Configure configurator, string public static async Task SendTeamsMessageAsync(Configure configurator, string webhook) { var message = configurator(new TeamsMessage()); - var messageJson = JsonConvert.SerializeObject(message); using var client = new HttpClient(); var response = await client.CreateRequest(HttpMethod.Post, webhook) - .WithJsonContent(messageJson) + .WithJsonContent(message) .GetResponseAsync(); var responseText = await response.GetBodyAsync(); diff --git a/source/Nuke.Common/Tools/Unity/Unity.Generated.cs b/source/Nuke.Common/Tools/Unity/Unity.Generated.cs index f231f30da..155f2351d 100644 --- a/source/Nuke.Common/Tools/Unity/Unity.Generated.cs +++ b/source/Nuke.Common/Tools/Unity/Unity.Generated.cs @@ -181,9 +181,6 @@ public static IReadOnlyCollection UnityManualLicenseFile(Configure ///

    This is a CLI wrapper with fluent API that allows to modify the following arguments:

    ///
      - ///
    • <customArguments> via
    • - ///
    • -accept-apiupdate via
    • - ///
    • -assetServerUpdate via
    • ///
    • -batchmode via
    • ///
    • -buildLinux32Player via
    • ///
    • -buildLinux64Player via
    • @@ -191,37 +188,21 @@ public static IReadOnlyCollection UnityManualLicenseFile(Configure-buildOSX64Player via ///
    • -buildOSXPlayer via
    • ///
    • -buildOSXUniversalPlayer via
    • - ///
    • -buildTarget via
    • ///
    • -buildWindows64Player via
    • ///
    • -buildWindowsPlayer via
    • - ///
    • -cacheServerIPAddress via
    • ///
    • -createProject via
    • - ///
    • -disable-assembly-updater via
    • ///
    • -editorTestsCategories via
    • ///
    • -editorTestsFilter via
    • ///
    • -editorTestsResultFile via
    • ///
    • -executeMethod via
    • ///
    • -exportPackage via
    • - ///
    • -force-clamped via
    • - ///
    • -force-d3d11 via
    • - ///
    • -force-device-index via
    • - ///
    • -force-gfx-metal via
    • - ///
    • -force-glcore via
    • - ///
    • -force-glcore via
    • - ///
    • -force-gles via
    • - ///
    • -force-gles via
    • - ///
    • -force-low-power-device via
    • ///
    • -importPackage via
    • ///
    • -nographics via
    • - ///
    • -noUpm via
    • ///
    • -password via
    • - ///
    • -projectPath via
    • ///
    • -quit via
    • ///
    • -runEditorTests via
    • ///
    • -serial via
    • - ///
    • -setDefaultPlatformTextureFormat via
    • ///
    • -silent-crashes via
    • - ///
    • -stackTraceLogType via
    • ///
    • -username via
    • ///
    /// @@ -240,9 +221,6 @@ public static IReadOnlyCollection Unity(UnitySettings toolSettings = nul /// ///

    This is a CLI wrapper with fluent API that allows to modify the following arguments:

    ///
      - ///
    • <customArguments> via
    • - ///
    • -accept-apiupdate via
    • - ///
    • -assetServerUpdate via
    • ///
    • -batchmode via
    • ///
    • -buildLinux32Player via
    • ///
    • -buildLinux64Player via
    • @@ -250,37 +228,21 @@ public static IReadOnlyCollection Unity(UnitySettings toolSettings = nul ///
    • -buildOSX64Player via
    • ///
    • -buildOSXPlayer via
    • ///
    • -buildOSXUniversalPlayer via
    • - ///
    • -buildTarget via
    • ///
    • -buildWindows64Player via
    • ///
    • -buildWindowsPlayer via
    • - ///
    • -cacheServerIPAddress via
    • ///
    • -createProject via
    • - ///
    • -disable-assembly-updater via
    • ///
    • -editorTestsCategories via
    • ///
    • -editorTestsFilter via
    • ///
    • -editorTestsResultFile via
    • ///
    • -executeMethod via
    • ///
    • -exportPackage via
    • - ///
    • -force-clamped via
    • - ///
    • -force-d3d11 via
    • - ///
    • -force-device-index via
    • - ///
    • -force-gfx-metal via
    • - ///
    • -force-glcore via
    • - ///
    • -force-glcore via
    • - ///
    • -force-gles via
    • - ///
    • -force-gles via
    • - ///
    • -force-low-power-device via
    • ///
    • -importPackage via
    • ///
    • -nographics via
    • - ///
    • -noUpm via
    • ///
    • -password via
    • - ///
    • -projectPath via
    • ///
    • -quit via
    • ///
    • -runEditorTests via
    • ///
    • -serial via
    • - ///
    • -setDefaultPlatformTextureFormat via
    • ///
    • -silent-crashes via
    • - ///
    • -stackTraceLogType via
    • ///
    • -username via
    • ///
    ///
    @@ -295,9 +257,6 @@ public static IReadOnlyCollection Unity(Configure configu /// ///

    This is a CLI wrapper with fluent API that allows to modify the following arguments:

    ///
      - ///
    • <customArguments> via
    • - ///
    • -accept-apiupdate via
    • - ///
    • -assetServerUpdate via
    • ///
    • -batchmode via
    • ///
    • -buildLinux32Player via
    • ///
    • -buildLinux64Player via
    • @@ -305,37 +264,21 @@ public static IReadOnlyCollection Unity(Configure configu ///
    • -buildOSX64Player via
    • ///
    • -buildOSXPlayer via
    • ///
    • -buildOSXUniversalPlayer via
    • - ///
    • -buildTarget via
    • ///
    • -buildWindows64Player via
    • ///
    • -buildWindowsPlayer via
    • - ///
    • -cacheServerIPAddress via
    • ///
    • -createProject via
    • - ///
    • -disable-assembly-updater via
    • ///
    • -editorTestsCategories via
    • ///
    • -editorTestsFilter via
    • ///
    • -editorTestsResultFile via
    • ///
    • -executeMethod via
    • ///
    • -exportPackage via
    • - ///
    • -force-clamped via
    • - ///
    • -force-d3d11 via
    • - ///
    • -force-device-index via
    • - ///
    • -force-gfx-metal via
    • - ///
    • -force-glcore via
    • - ///
    • -force-glcore via
    • - ///
    • -force-gles via
    • - ///
    • -force-gles via
    • - ///
    • -force-low-power-device via
    • ///
    • -importPackage via
    • ///
    • -nographics via
    • - ///
    • -noUpm via
    • ///
    • -password via
    • - ///
    • -projectPath via
    • ///
    • -quit via
    • ///
    • -runEditorTests via
    • ///
    • -serial via
    • - ///
    • -setDefaultPlatformTextureFormat via
    • ///
    • -silent-crashes via
    • - ///
    • -stackTraceLogType via
    • ///
    • -username via
    • ///
    ///
    @@ -407,6 +350,82 @@ public static IReadOnlyCollection UnityReturnLicense(Configure + ///

    (2019.2+) Run tests in the project using Unity Test Framework. This argument requires the projectPath, and it's good practice to run it with batchmode argument. quit is not required, because the Editor automatically closes down after the run is finished.

    + ///

    For more details, visit the official website.

    + ///
    + /// + ///

    This is a CLI wrapper with fluent API that allows to modify the following arguments:

    + ///
      + ///
    • -batchmode via
    • + ///
    • -nographics via
    • + ///
    • -password via
    • + ///
    • -quit via
    • + ///
    • -serial via
    • + ///
    • -silent-crashes via
    • + ///
    • -testCategory via
    • + ///
    • -testFilter via
    • + ///
    • -testPlatform via
    • + ///
    • -testResults via
    • + ///
    • -username via
    • + ///
    + ///
    + public static IReadOnlyCollection UnityRunTests(UnityRunTestsSettings toolSettings = null) + { + toolSettings = toolSettings ?? new UnityRunTestsSettings(); + PreProcess(ref toolSettings); + using var process = StartProcess(toolSettings); + AssertProcess(process.AssertWaitForExit(), toolSettings); + return process.Output; + } + /// + ///

    (2019.2+) Run tests in the project using Unity Test Framework. This argument requires the projectPath, and it's good practice to run it with batchmode argument. quit is not required, because the Editor automatically closes down after the run is finished.

    + ///

    For more details, visit the official website.

    + ///
    + /// + ///

    This is a CLI wrapper with fluent API that allows to modify the following arguments:

    + ///
      + ///
    • -batchmode via
    • + ///
    • -nographics via
    • + ///
    • -password via
    • + ///
    • -quit via
    • + ///
    • -serial via
    • + ///
    • -silent-crashes via
    • + ///
    • -testCategory via
    • + ///
    • -testFilter via
    • + ///
    • -testPlatform via
    • + ///
    • -testResults via
    • + ///
    • -username via
    • + ///
    + ///
    + public static IReadOnlyCollection UnityRunTests(Configure configurator) + { + return UnityRunTests(configurator(new UnityRunTestsSettings())); + } + /// + ///

    (2019.2+) Run tests in the project using Unity Test Framework. This argument requires the projectPath, and it's good practice to run it with batchmode argument. quit is not required, because the Editor automatically closes down after the run is finished.

    + ///

    For more details, visit the official website.

    + ///
    + /// + ///

    This is a CLI wrapper with fluent API that allows to modify the following arguments:

    + ///
      + ///
    • -batchmode via
    • + ///
    • -nographics via
    • + ///
    • -password via
    • + ///
    • -quit via
    • + ///
    • -serial via
    • + ///
    • -silent-crashes via
    • + ///
    • -testCategory via
    • + ///
    • -testFilter via
    • + ///
    • -testPlatform via
    • + ///
    • -testResults via
    • + ///
    • -username via
    • + ///
    + ///
    + public static IEnumerable<(UnityRunTestsSettings Settings, IReadOnlyCollection Output)> UnityRunTests(CombinatorialConfigure configurator, int degreeOfParallelism = 1, bool completeOnFailure = false) + { + return configurator.Invoke(UnityRunTests, UnityLogger, degreeOfParallelism, completeOnFailure); + } } #region UnityCreateManualActivationFileSettings /// @@ -535,7 +554,7 @@ protected override Arguments ConfigureProcessArguments(Arguments arguments) [PublicAPI] [ExcludeFromCodeCoverage] [Serializable] -public partial class UnitySettings : UnityBaseSettings +public partial class UnitySettings : UnityProjectSettings { /// /// Path to the Unity executable. @@ -544,10 +563,6 @@ public partial class UnitySettings : UnityBaseSettings public override Action ProcessLogger => base.ProcessLogger ?? UnityTasks.UnityLogger; public override Action ProcessExitHandler => base.ProcessExitHandler ?? UnityTasks.UnityExitHandler; /// - /// Force an update of the project in the Asset Server given by IP:port. The port is optional, and if not given it is assumed to be the standard one (10733). It is advisable to use this command in conjunction with the -projectPath argument to ensure you are working with the correct project. If no project name is given, then the last project opened by Unity is used. If no project exists at the path given by -projectPath, then one is created automatically. - /// - public virtual string AssetServerUpdate { get; internal set; } - /// /// Build a 32-bit standalone Linux player (for example, -buildLinux32Player path/to/your/build). /// public virtual string BuildLinux32Player { get; internal set; } @@ -572,10 +587,6 @@ public partial class UnitySettings : UnityBaseSettings /// public virtual string BuildOSXUniversalPlayer { get; internal set; } /// - /// Allows the selection of an active build target before a project is loaded. - /// - public virtual string BuildTarget { get; internal set; } - /// /// Build a 32-bit standalone Windows player (for example, -buildWindowsPlayer path/to/your/build.exe). /// public virtual string BuildWindowsPlayer { get; internal set; } @@ -592,67 +603,10 @@ public partial class UnitySettings : UnityBaseSettings /// public virtual string ExecuteMethod { get; internal set; } /// - /// (Windows only) Make the Editor use Direct3D 11 for rendering. Normally the graphics API depends on player settings (typically defaults to D3D11). - /// - public virtual bool? ForceD3d11 { get; internal set; } - /// - /// (macOS only) When using Metal, make the Editor use a particular GPU device by passing it the index of that GPU. - /// - public virtual bool? ForceDeviceIndex { get; internal set; } - /// - /// (macOS only) Make the Editor use Metal as the default graphics API. - /// - public virtual bool? ForceGfxMetal { get; internal set; } - /// - /// (Windows only) Make the Editor use OpenGL 3/4 core profile for rendering. The Editor tries to use the best OpenGL version available and all OpenGL extensions exposed by the OpenGL drivers. If the platform isn't supported, Direct3D is used. - /// - public virtual bool? ForceGLCore { get; internal set; } - /// - /// (Windows only) Similar to -force-glcore, but requests a specific OpenGL context version. Accepted values for XY: 32, 33, 40, 41, 42, 43, 44 or 45. - /// - public virtual UnityGLCore ForceGLCoreXY { get; internal set; } - /// - /// (Windows only) Make the Editor use OpenGL for Embedded Systems for rendering. The Editor tries to use the best OpenGL ES version available, and all OpenGL ES extensions exposed by the OpenGL drivers. - /// - public virtual bool? ForceGLES { get; internal set; } - /// - /// (Windows only) Similar to -force-gles, but requests a specific OpenGL ES context version. Accepted values for XY: 30, 31 or 32. - /// - public virtual UnityGLES ForceGLESXY { get; internal set; } - /// - /// (2017.3+) (Windows only) Used with -force-glcoreXY to prevent checking for additional OpenGL extensions, allowing it to run between platforms with the same code paths. - /// - public virtual bool? ForceClamped { get; internal set; } - /// - /// (macOS only) When using Metal, make the Editor use a low power device. - /// - public virtual bool? ForceLowPowerDevice { get; internal set; } - /// /// Import the given package. No import dialog is shown. /// public virtual string ImportPackage { get; internal set; } /// - /// (2018.1+) Sets the default texture compression to the desired format before importing a texture or building the project. This is so you don’t have to import the texture again with the format you want. The available formats are dxt, pvrtc, atc, etc, etc2, and astc. Note that this is only supported on Android. - /// - public virtual string DefaultPlatformTextureFormat { get; internal set; } - /// - /// Specify a space-separated list of assembly names as parameters for Unity to ignore on automatic updates. The space-separated list of assembly names is optional: Pass the command line options without any assembly names to ignore all assemblies. - /// - public virtual IReadOnlyList DisableAssemblyUpdater => DisableAssemblyUpdaterInternal.AsReadOnly(); - internal List DisableAssemblyUpdaterInternal { get; set; } = new List(); - /// - /// (2018.1+) Connect to the Cache Server given by IP:port on startup, overriding any configuration stored in the Editor Preferences. Use this to connect multiple instances of Unity to different Cache Servers. - /// - public virtual string CacheServerIPAddress { get; internal set; } - /// - /// (2018.1+) Disables the Unity Package Manager. - /// - public virtual bool? NoUpm { get; internal set; } - /// - /// (2017.2+) Use this command line option to specify that APIUpdater should run when Unity is launched in batch mode. Omitting this command line argument when launching Unity in batch mode results in APIUpdater not running which can lead to compiler errors. Note that in versions prior to 2017.2 there’s no way to not run APIUpdater when Unity is launched in batch mode. - /// - public virtual bool? AcceptApiUpdate { get; internal set; } - /// /// Run Editor tests from the project. This argument requires the projectPath, and it’s good practice to run it with batchmode argument. quit is not required, because the Editor automatically closes down after the run is finished. /// public virtual bool? RunEditorTests { get; internal set; } @@ -676,19 +630,6 @@ public partial class UnitySettings : UnityBaseSettings public virtual IReadOnlyList ExportPackage => ExportPackageInternal.AsReadOnly(); internal List ExportPackageInternal { get; set; } = new List(); /// - /// Custom parameters. To pass parameters, add them to the command line and retrieve them inside the function using System.Environment.GetCommandLineArgs. - /// - public virtual IReadOnlyList CustomArguments => CustomArgumentsInternal.AsReadOnly(); - internal List CustomArgumentsInternal { get; set; } = new List(); - /// - /// Detailed debugging feature. StackTraceLogging allows you to allow detailed logging. - /// - public virtual UnityStackTraceLogType StackTraceLogType { get; internal set; } - /// - /// Specify the path of the unity project. - /// - public virtual string ProjectPath { get; internal set; } - /// /// Enter a username into the log-in form during activation of the Unity Editor. /// public virtual string Username { get; internal set; } @@ -719,41 +660,22 @@ public partial class UnitySettings : UnityBaseSettings protected override Arguments ConfigureProcessArguments(Arguments arguments) { arguments - .Add("-assetServerUpdate {value}", AssetServerUpdate) .Add("-buildLinux32Player {value}", BuildLinux32Player) .Add("-buildLinux64Player {value}", BuildLinux64Player) .Add("-buildLinuxUniversalPlayer {value}", BuildLinuxUniversalPlayer) .Add("-buildOSXPlayer {value}", BuildOSXPlayer) .Add("-buildOSX64Player {value}", BuildOSX64Player) .Add("-buildOSXUniversalPlayer {value}", BuildOSXUniversalPlayer) - .Add("-buildTarget {value}", BuildTarget) .Add("-buildWindowsPlayer {value}", BuildWindowsPlayer) .Add("-buildWindows64Player {value}", BuildWindows64Player) .Add("-createProject {value}", CreateProject) .Add("-executeMethod {value}", ExecuteMethod) - .Add("-force-d3d11", ForceD3d11) - .Add("-force-device-index", ForceDeviceIndex) - .Add("-force-gfx-metal", ForceGfxMetal) - .Add("-force-glcore", ForceGLCore) - .Add("-force-glcore{value}", ForceGLCoreXY) - .Add("-force-gles", ForceGLES) - .Add("-force-gles{value}", ForceGLESXY) - .Add("-force-clamped", ForceClamped) - .Add("-force-low-power-device", ForceLowPowerDevice) .Add("-importPackage {value}", ImportPackage) - .Add("-setDefaultPlatformTextureFormat {value}", DefaultPlatformTextureFormat) - .Add("-disable-assembly-updater {value}", DisableAssemblyUpdater, separator: ' ') - .Add("-cacheServerIPAddress {value}", CacheServerIPAddress) - .Add("-noUpm", NoUpm) - .Add("-accept-apiupdate", AcceptApiUpdate) .Add("-runEditorTests", RunEditorTests) .Add("-editorTestsCategories {value}", EditorTestsCategories, separator: ',') .Add("-editorTestsFilter {value}", EditorTestsFilter, separator: ',') .Add("-editorTestsResultFile {value}", EditorTestsResultFile) .Add("-exportPackage {value}", ExportPackage, separator: ' ') - .Add("{value}", CustomArguments, separator: ' ') - .Add("-stackTraceLogType {value}", StackTraceLogType) - .Add("-projectPath {value}", ProjectPath) .Add("-username {value}", Username) .Add("-password {value}", Password, secret: true) .Add("-serial {value}", Serial, secret: true) @@ -823,6 +745,86 @@ protected override Arguments ConfigureProcessArguments(Arguments arguments) } } #endregion +#region UnityRunTestsSettings +/// +/// Used within . +/// +[PublicAPI] +[ExcludeFromCodeCoverage] +[Serializable] +public partial class UnityRunTestsSettings : UnityBaseSettings +{ + /// + /// Path to the Unity executable. + /// + public override string ProcessToolPath => base.ProcessToolPath ?? GetProcessToolPath(); + public override Action ProcessLogger => base.ProcessLogger ?? UnityTasks.UnityLogger; + public override Action ProcessExitHandler => base.ProcessExitHandler ?? UnityTasks.UnityExitHandler; + /// + /// A list of test categories to include in the run, or a regular expression pattern to match category names. If using both TestFilters and TestCategories, then only tests that match both are run. This argument supports negation using '!'. If using '!MyCategory' then no tests with the 'MyCategory' category will be included in the run. + /// + public virtual IReadOnlyList TestCategories => TestCategoriesInternal.AsReadOnly(); + internal List TestCategoriesInternal { get; set; } = new List(); + /// + /// A list of test names to run, or a regular expression pattern to match tests by their full name. This argument supports negation using '!'. If using the test filter '!MyNamespace.Something.MyTest', then all tests except that test will be run. It is also possible to run a specific variation of a parameterized test like so: 'ClassName.MethodName(Param1,Param2)'. + /// + public virtual IReadOnlyList TestFilters => TestFiltersInternal.AsReadOnly(); + internal List TestFiltersInternal { get; set; } = new List(); + /// + /// Path where the result file should be placed. If the path is a folder, a default file name is used. If not specified, the results are placed in the project's root folder. + /// + public virtual string TestResultFile { get; internal set; } + /// + /// The platform to run tests on. + /// + public virtual string TestPlatform { get; internal set; } + /// + /// Enter a username into the log-in form during activation of the Unity Editor. + /// + public virtual string Username { get; internal set; } + /// + /// Enter a password into the log-in form during activation of the Unity Editor. + /// + public virtual string Password { get; internal set; } + /// + /// Activate Unity with the specified serial key. It is good practice to pass the -batchmode and -quit arguments as well, in order to quit Unity when done, if using this for automated activation of Unity. Please allow a few seconds before the license file is created, because Unity needs to communicate with the license server. Make sure that license file folder exists, and has appropriate permissions before running Unity with this argument. If activation fails, see the Editor.log for info. + /// + public virtual string Serial { get; internal set; } + /// + /// Run Unity in batch mode. This should always be used in conjunction with the other command line arguments, because it ensures no pop-up windows appear and eliminates the need for any human intervention. When an exception occurs during execution of the script code, the Asset server updates fail, or other operations that fail, Unity immediately exits with return code 1.Note that in batch mode, Unity sends a minimal version of its log output to the console. However, the Log Files still contain the full log information. Opening a project in batch mode while the Editor has the same project open is not supported; only a single instance of Unity can run at a time. + /// + public virtual bool? BatchMode { get; internal set; } + /// + /// Don't display a crash dialog. + /// + public virtual bool? SilentCrashes { get; internal set; } + /// + /// When running in batch mode, do not initialize the graphics device at all. This makes it possible to run your automated workflows on machines that don't even have a GPU (automated workflows only work when you have a window in focus, otherwise you can't send simulated input commands). Please note that -nographics does not allow you to bake GI on OSX, since Enlighten requires GPU acceleration. + /// + public virtual bool? NoGraphics { get; internal set; } + /// + /// Quit the Unity Editor after other commands have finished executing. Note that this can cause error messages to be hidden (however, they still appear in the Editor.log file). + /// + public virtual bool? Quit { get; internal set; } + protected override Arguments ConfigureProcessArguments(Arguments arguments) + { + arguments + .Add("-runTests") + .Add("-testCategory {value}", TestCategories, separator: ';', quoteMultiple: true) + .Add("-testFilter {value}", TestFilters, separator: ';', quoteMultiple: true) + .Add("-testResults {value}", TestResultFile) + .Add("-testPlatform {value}", TestPlatform) + .Add("-username {value}", Username) + .Add("-password {value}", Password, secret: true) + .Add("-serial {value}", Serial, secret: true) + .Add("-batchmode", BatchMode) + .Add("-silent-crashes", SilentCrashes) + .Add("-nographics", NoGraphics) + .Add("-quit", Quit); + return base.ConfigureProcessArguments(arguments); + } +} +#endregion #region UnityBaseSettings /// /// Used within . @@ -857,74 +859,187 @@ protected override Arguments ConfigureProcessArguments(Arguments arguments) } } #endregion -#region UnityCreateManualActivationFileSettingsExtensions +#region UnityProjectSettings /// /// Used within . /// [PublicAPI] [ExcludeFromCodeCoverage] -public static partial class UnityCreateManualActivationFileSettingsExtensions +[Serializable] +public partial class UnityProjectSettings : UnityBaseSettings { - #region Username /// - ///

    Sets

    - ///

    Enter a username into the log-in form during activation of the Unity Editor.

    + /// Force an update of the project in the Asset Server given by IP:port. The port is optional, and if not given it is assumed to be the standard one (10733). It is advisable to use this command in conjunction with the -projectPath argument to ensure you are working with the correct project. If no project name is given, then the last project opened by Unity is used. If no project exists at the path given by -projectPath, then one is created automatically. ///
    - [Pure] - public static T SetUsername(this T toolSettings, string username) where T : UnityCreateManualActivationFileSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.Username = username; - return toolSettings; - } + public virtual string AssetServerUpdate { get; internal set; } /// - ///

    Resets

    - ///

    Enter a username into the log-in form during activation of the Unity Editor.

    + /// Allows the selection of an active build target before a project is loaded. ///
    - [Pure] - public static T ResetUsername(this T toolSettings) where T : UnityCreateManualActivationFileSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.Username = null; - return toolSettings; - } - #endregion - #region Password + public virtual string BuildTarget { get; internal set; } /// - ///

    Sets

    - ///

    Enter a password into the log-in form during activation of the Unity Editor.

    + /// (Windows only) Make the Editor use Direct3D 11 for rendering. Normally the graphics API depends on player settings (typically defaults to D3D11). ///
    - [Pure] - public static T SetPassword(this T toolSettings, [Secret] string password) where T : UnityCreateManualActivationFileSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.Password = password; - return toolSettings; - } + public virtual bool? ForceD3d11 { get; internal set; } /// - ///

    Resets

    - ///

    Enter a password into the log-in form during activation of the Unity Editor.

    + /// (macOS only) When using Metal, make the Editor use a particular GPU device by passing it the index of that GPU. ///
    - [Pure] - public static T ResetPassword(this T toolSettings) where T : UnityCreateManualActivationFileSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.Password = null; - return toolSettings; - } - #endregion - #region Serial + public virtual bool? ForceDeviceIndex { get; internal set; } /// - ///

    Sets

    - ///

    Activate Unity with the specified serial key. It is good practice to pass the -batchmode and -quit arguments as well, in order to quit Unity when done, if using this for automated activation of Unity. Please allow a few seconds before the license file is created, because Unity needs to communicate with the license server. Make sure that license file folder exists, and has appropriate permissions before running Unity with this argument. If activation fails, see the Editor.log for info.

    + /// (macOS only) Make the Editor use Metal as the default graphics API. ///
    - [Pure] - public static T SetSerial(this T toolSettings, [Secret] string serial) where T : UnityCreateManualActivationFileSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.Serial = serial; - return toolSettings; - } + public virtual bool? ForceGfxMetal { get; internal set; } + /// + /// (Windows only) Make the Editor use OpenGL 3/4 core profile for rendering. The Editor tries to use the best OpenGL version available and all OpenGL extensions exposed by the OpenGL drivers. If the platform isn't supported, Direct3D is used. + /// + public virtual bool? ForceGLCore { get; internal set; } + /// + /// (Windows only) Similar to -force-glcore, but requests a specific OpenGL context version. Accepted values for XY: 32, 33, 40, 41, 42, 43, 44 or 45. + /// + public virtual UnityGLCore ForceGLCoreXY { get; internal set; } + /// + /// (Windows only) Make the Editor use OpenGL for Embedded Systems for rendering. The Editor tries to use the best OpenGL ES version available, and all OpenGL ES extensions exposed by the OpenGL drivers. + /// + public virtual bool? ForceGLES { get; internal set; } + /// + /// (Windows only) Similar to -force-gles, but requests a specific OpenGL ES context version. Accepted values for XY: 30, 31 or 32. + /// + public virtual UnityGLES ForceGLESXY { get; internal set; } + /// + /// (2017.3+) (Windows only) Used with -force-glcoreXY to prevent checking for additional OpenGL extensions, allowing it to run between platforms with the same code paths. + /// + public virtual bool? ForceClamped { get; internal set; } + /// + /// (macOS only) When using Metal, make the Editor use a low power device. + /// + public virtual bool? ForceLowPowerDevice { get; internal set; } + /// + /// (2018.1+) Sets the default texture compression to the desired format before importing a texture or building the project. This is so you don’t have to import the texture again with the format you want. The available formats are dxt, pvrtc, atc, etc, etc2, and astc. Note that this is only supported on Android. + /// + public virtual string DefaultPlatformTextureFormat { get; internal set; } + /// + /// Specify a space-separated list of assembly names as parameters for Unity to ignore on automatic updates. The space-separated list of assembly names is optional: Pass the command line options without any assembly names to ignore all assemblies. + /// + public virtual IReadOnlyList DisableAssemblyUpdater => DisableAssemblyUpdaterInternal.AsReadOnly(); + internal List DisableAssemblyUpdaterInternal { get; set; } = new List(); + /// + /// (2018.1+) Connect to the Cache Server given by IP:port on startup, overriding any configuration stored in the Editor Preferences. Use this to connect multiple instances of Unity to different Cache Servers. + /// + public virtual string CacheServerIPAddress { get; internal set; } + /// + /// (2018.1+) Disables the Unity Package Manager. + /// + public virtual bool? NoUpm { get; internal set; } + /// + /// (2017.2+) Use this command line option to specify that APIUpdater should run when Unity is launched in batch mode. Omitting this command line argument when launching Unity in batch mode results in APIUpdater not running which can lead to compiler errors. Note that in versions prior to 2017.2 there’s no way to not run APIUpdater when Unity is launched in batch mode. + /// + public virtual bool? AcceptApiUpdate { get; internal set; } + /// + /// Custom parameters. To pass parameters, add them to the command line and retrieve them inside the function using System.Environment.GetCommandLineArgs. + /// + public virtual IReadOnlyList CustomArguments => CustomArgumentsInternal.AsReadOnly(); + internal List CustomArgumentsInternal { get; set; } = new List(); + /// + /// Detailed debugging feature. StackTraceLogging allows you to allow detailed logging. + /// + public virtual UnityStackTraceLogType StackTraceLogType { get; internal set; } + /// + /// Specify the path of the unity project. + /// + public virtual string ProjectPath { get; internal set; } + protected override Arguments ConfigureProcessArguments(Arguments arguments) + { + arguments + .Add("-assetServerUpdate {value}", AssetServerUpdate) + .Add("-buildTarget {value}", BuildTarget) + .Add("-force-d3d11", ForceD3d11) + .Add("-force-device-index", ForceDeviceIndex) + .Add("-force-gfx-metal", ForceGfxMetal) + .Add("-force-glcore", ForceGLCore) + .Add("-force-glcore{value}", ForceGLCoreXY) + .Add("-force-gles", ForceGLES) + .Add("-force-gles{value}", ForceGLESXY) + .Add("-force-clamped", ForceClamped) + .Add("-force-low-power-device", ForceLowPowerDevice) + .Add("-setDefaultPlatformTextureFormat {value}", DefaultPlatformTextureFormat) + .Add("-disable-assembly-updater {value}", DisableAssemblyUpdater, separator: ' ') + .Add("-cacheServerIPAddress {value}", CacheServerIPAddress) + .Add("-noUpm", NoUpm) + .Add("-accept-apiupdate", AcceptApiUpdate) + .Add("{value}", CustomArguments, separator: ' ') + .Add("-stackTraceLogType {value}", StackTraceLogType) + .Add("-projectPath {value}", ProjectPath); + return base.ConfigureProcessArguments(arguments); + } +} +#endregion +#region UnityCreateManualActivationFileSettingsExtensions +/// +/// Used within . +/// +[PublicAPI] +[ExcludeFromCodeCoverage] +public static partial class UnityCreateManualActivationFileSettingsExtensions +{ + #region Username + /// + ///

    Sets

    + ///

    Enter a username into the log-in form during activation of the Unity Editor.

    + ///
    + [Pure] + public static T SetUsername(this T toolSettings, string username) where T : UnityCreateManualActivationFileSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.Username = username; + return toolSettings; + } + /// + ///

    Resets

    + ///

    Enter a username into the log-in form during activation of the Unity Editor.

    + ///
    + [Pure] + public static T ResetUsername(this T toolSettings) where T : UnityCreateManualActivationFileSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.Username = null; + return toolSettings; + } + #endregion + #region Password + /// + ///

    Sets

    + ///

    Enter a password into the log-in form during activation of the Unity Editor.

    + ///
    + [Pure] + public static T SetPassword(this T toolSettings, [Secret] string password) where T : UnityCreateManualActivationFileSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.Password = password; + return toolSettings; + } + /// + ///

    Resets

    + ///

    Enter a password into the log-in form during activation of the Unity Editor.

    + ///
    + [Pure] + public static T ResetPassword(this T toolSettings) where T : UnityCreateManualActivationFileSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.Password = null; + return toolSettings; + } + #endregion + #region Serial + /// + ///

    Sets

    + ///

    Activate Unity with the specified serial key. It is good practice to pass the -batchmode and -quit arguments as well, in order to quit Unity when done, if using this for automated activation of Unity. Please allow a few seconds before the license file is created, because Unity needs to communicate with the license server. Make sure that license file folder exists, and has appropriate permissions before running Unity with this argument. If activation fails, see the Editor.log for info.

    + ///
    + [Pure] + public static T SetSerial(this T toolSettings, [Secret] string serial) where T : UnityCreateManualActivationFileSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.Serial = serial; + return toolSettings; + } /// ///

    Resets

    ///

    Activate Unity with the specified serial key. It is good practice to pass the -batchmode and -quit arguments as well, in order to quit Unity when done, if using this for automated activation of Unity. Please allow a few seconds before the license file is created, because Unity needs to communicate with the license server. Make sure that license file folder exists, and has appropriate permissions before running Unity with this argument. If activation fails, see the Editor.log for info.

    @@ -1509,30 +1624,6 @@ public static T ToggleQuit(this T toolSettings) where T : UnityManualLicenseF [ExcludeFromCodeCoverage] public static partial class UnitySettingsExtensions { - #region AssetServerUpdate - /// - ///

    Sets

    - ///

    Force an update of the project in the Asset Server given by IP:port. The port is optional, and if not given it is assumed to be the standard one (10733). It is advisable to use this command in conjunction with the -projectPath argument to ensure you are working with the correct project. If no project name is given, then the last project opened by Unity is used. If no project exists at the path given by -projectPath, then one is created automatically.

    - ///
    - [Pure] - public static T SetAssetServerUpdate(this T toolSettings, string assetServerUpdate) where T : UnitySettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.AssetServerUpdate = assetServerUpdate; - return toolSettings; - } - /// - ///

    Resets

    - ///

    Force an update of the project in the Asset Server given by IP:port. The port is optional, and if not given it is assumed to be the standard one (10733). It is advisable to use this command in conjunction with the -projectPath argument to ensure you are working with the correct project. If no project name is given, then the last project opened by Unity is used. If no project exists at the path given by -projectPath, then one is created automatically.

    - ///
    - [Pure] - public static T ResetAssetServerUpdate(this T toolSettings) where T : UnitySettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.AssetServerUpdate = null; - return toolSettings; - } - #endregion #region BuildLinux32Player /// ///

    Sets

    @@ -1677,30 +1768,6 @@ public static T ResetBuildOSXUniversalPlayer(this T toolSettings) where T : U return toolSettings; } #endregion - #region BuildTarget - /// - ///

    Sets

    - ///

    Allows the selection of an active build target before a project is loaded.

    - ///
    - [Pure] - public static T SetBuildTarget(this T toolSettings, string buildTarget) where T : UnitySettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.BuildTarget = buildTarget; - return toolSettings; - } - /// - ///

    Resets

    - ///

    Allows the selection of an active build target before a project is loaded.

    - ///
    - [Pure] - public static T ResetBuildTarget(this T toolSettings) where T : UnitySettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.BuildTarget = null; - return toolSettings; - } - #endregion #region BuildWindowsPlayer /// ///

    Sets

    @@ -1797,1191 +1864,1202 @@ public static T ResetExecuteMethod(this T toolSettings) where T : UnitySettin return toolSettings; } #endregion - #region ForceD3d11 + #region ImportPackage /// - ///

    Sets

    - ///

    (Windows only) Make the Editor use Direct3D 11 for rendering. Normally the graphics API depends on player settings (typically defaults to D3D11).

    + ///

    Sets

    + ///

    Import the given package. No import dialog is shown.

    ///
    [Pure] - public static T SetForceD3d11(this T toolSettings, bool? forceD3d11) where T : UnitySettings + public static T SetImportPackage(this T toolSettings, string importPackage) where T : UnitySettings { toolSettings = toolSettings.NewInstance(); - toolSettings.ForceD3d11 = forceD3d11; + toolSettings.ImportPackage = importPackage; return toolSettings; } /// - ///

    Resets

    - ///

    (Windows only) Make the Editor use Direct3D 11 for rendering. Normally the graphics API depends on player settings (typically defaults to D3D11).

    + ///

    Resets

    + ///

    Import the given package. No import dialog is shown.

    ///
    [Pure] - public static T ResetForceD3d11(this T toolSettings) where T : UnitySettings + public static T ResetImportPackage(this T toolSettings) where T : UnitySettings { toolSettings = toolSettings.NewInstance(); - toolSettings.ForceD3d11 = null; + toolSettings.ImportPackage = null; return toolSettings; } + #endregion + #region RunEditorTests /// - ///

    Enables

    - ///

    (Windows only) Make the Editor use Direct3D 11 for rendering. Normally the graphics API depends on player settings (typically defaults to D3D11).

    + ///

    Sets

    + ///

    Run Editor tests from the project. This argument requires the projectPath, and it’s good practice to run it with batchmode argument. quit is not required, because the Editor automatically closes down after the run is finished.

    ///
    [Pure] - public static T EnableForceD3d11(this T toolSettings) where T : UnitySettings + public static T SetRunEditorTests(this T toolSettings, bool? runEditorTests) where T : UnitySettings { toolSettings = toolSettings.NewInstance(); - toolSettings.ForceD3d11 = true; + toolSettings.RunEditorTests = runEditorTests; return toolSettings; } /// - ///

    Disables

    - ///

    (Windows only) Make the Editor use Direct3D 11 for rendering. Normally the graphics API depends on player settings (typically defaults to D3D11).

    + ///

    Resets

    + ///

    Run Editor tests from the project. This argument requires the projectPath, and it’s good practice to run it with batchmode argument. quit is not required, because the Editor automatically closes down after the run is finished.

    ///
    [Pure] - public static T DisableForceD3d11(this T toolSettings) where T : UnitySettings + public static T ResetRunEditorTests(this T toolSettings) where T : UnitySettings { toolSettings = toolSettings.NewInstance(); - toolSettings.ForceD3d11 = false; + toolSettings.RunEditorTests = null; return toolSettings; } /// - ///

    Toggles

    - ///

    (Windows only) Make the Editor use Direct3D 11 for rendering. Normally the graphics API depends on player settings (typically defaults to D3D11).

    + ///

    Enables

    + ///

    Run Editor tests from the project. This argument requires the projectPath, and it’s good practice to run it with batchmode argument. quit is not required, because the Editor automatically closes down after the run is finished.

    ///
    [Pure] - public static T ToggleForceD3d11(this T toolSettings) where T : UnitySettings + public static T EnableRunEditorTests(this T toolSettings) where T : UnitySettings { toolSettings = toolSettings.NewInstance(); - toolSettings.ForceD3d11 = !toolSettings.ForceD3d11; + toolSettings.RunEditorTests = true; return toolSettings; } - #endregion - #region ForceDeviceIndex /// - ///

    Sets

    - ///

    (macOS only) When using Metal, make the Editor use a particular GPU device by passing it the index of that GPU.

    + ///

    Disables

    + ///

    Run Editor tests from the project. This argument requires the projectPath, and it’s good practice to run it with batchmode argument. quit is not required, because the Editor automatically closes down after the run is finished.

    ///
    [Pure] - public static T SetForceDeviceIndex(this T toolSettings, bool? forceDeviceIndex) where T : UnitySettings + public static T DisableRunEditorTests(this T toolSettings) where T : UnitySettings { toolSettings = toolSettings.NewInstance(); - toolSettings.ForceDeviceIndex = forceDeviceIndex; + toolSettings.RunEditorTests = false; return toolSettings; } /// - ///

    Resets

    - ///

    (macOS only) When using Metal, make the Editor use a particular GPU device by passing it the index of that GPU.

    + ///

    Toggles

    + ///

    Run Editor tests from the project. This argument requires the projectPath, and it’s good practice to run it with batchmode argument. quit is not required, because the Editor automatically closes down after the run is finished.

    ///
    [Pure] - public static T ResetForceDeviceIndex(this T toolSettings) where T : UnitySettings + public static T ToggleRunEditorTests(this T toolSettings) where T : UnitySettings { toolSettings = toolSettings.NewInstance(); - toolSettings.ForceDeviceIndex = null; + toolSettings.RunEditorTests = !toolSettings.RunEditorTests; return toolSettings; } + #endregion + #region EditorTestsCategories /// - ///

    Enables

    - ///

    (macOS only) When using Metal, make the Editor use a particular GPU device by passing it the index of that GPU.

    + ///

    Sets to a new list

    + ///

    Filter editor tests by categories.

    ///
    [Pure] - public static T EnableForceDeviceIndex(this T toolSettings) where T : UnitySettings + public static T SetEditorTestsCategories(this T toolSettings, params string[] editorTestsCategories) where T : UnitySettings { toolSettings = toolSettings.NewInstance(); - toolSettings.ForceDeviceIndex = true; + toolSettings.EditorTestsCategoriesInternal = editorTestsCategories.ToList(); return toolSettings; } /// - ///

    Disables

    - ///

    (macOS only) When using Metal, make the Editor use a particular GPU device by passing it the index of that GPU.

    + ///

    Sets to a new list

    + ///

    Filter editor tests by categories.

    ///
    [Pure] - public static T DisableForceDeviceIndex(this T toolSettings) where T : UnitySettings + public static T SetEditorTestsCategories(this T toolSettings, IEnumerable editorTestsCategories) where T : UnitySettings { toolSettings = toolSettings.NewInstance(); - toolSettings.ForceDeviceIndex = false; + toolSettings.EditorTestsCategoriesInternal = editorTestsCategories.ToList(); return toolSettings; } /// - ///

    Toggles

    - ///

    (macOS only) When using Metal, make the Editor use a particular GPU device by passing it the index of that GPU.

    - ///
    + ///

    Adds values to

    + ///

    Filter editor tests by categories.

    + ///
    [Pure] - public static T ToggleForceDeviceIndex(this T toolSettings) where T : UnitySettings + public static T AddEditorTestsCategories(this T toolSettings, params string[] editorTestsCategories) where T : UnitySettings { toolSettings = toolSettings.NewInstance(); - toolSettings.ForceDeviceIndex = !toolSettings.ForceDeviceIndex; + toolSettings.EditorTestsCategoriesInternal.AddRange(editorTestsCategories); return toolSettings; } - #endregion - #region ForceGfxMetal /// - ///

    Sets

    - ///

    (macOS only) Make the Editor use Metal as the default graphics API.

    + ///

    Adds values to

    + ///

    Filter editor tests by categories.

    ///
    [Pure] - public static T SetForceGfxMetal(this T toolSettings, bool? forceGfxMetal) where T : UnitySettings + public static T AddEditorTestsCategories(this T toolSettings, IEnumerable editorTestsCategories) where T : UnitySettings { toolSettings = toolSettings.NewInstance(); - toolSettings.ForceGfxMetal = forceGfxMetal; + toolSettings.EditorTestsCategoriesInternal.AddRange(editorTestsCategories); return toolSettings; } /// - ///

    Resets

    - ///

    (macOS only) Make the Editor use Metal as the default graphics API.

    + ///

    Clears

    + ///

    Filter editor tests by categories.

    ///
    [Pure] - public static T ResetForceGfxMetal(this T toolSettings) where T : UnitySettings + public static T ClearEditorTestsCategories(this T toolSettings) where T : UnitySettings { toolSettings = toolSettings.NewInstance(); - toolSettings.ForceGfxMetal = null; + toolSettings.EditorTestsCategoriesInternal.Clear(); return toolSettings; } /// - ///

    Enables

    - ///

    (macOS only) Make the Editor use Metal as the default graphics API.

    + ///

    Removes values from

    + ///

    Filter editor tests by categories.

    ///
    [Pure] - public static T EnableForceGfxMetal(this T toolSettings) where T : UnitySettings + public static T RemoveEditorTestsCategories(this T toolSettings, params string[] editorTestsCategories) where T : UnitySettings { toolSettings = toolSettings.NewInstance(); - toolSettings.ForceGfxMetal = true; + var hashSet = new HashSet(editorTestsCategories); + toolSettings.EditorTestsCategoriesInternal.RemoveAll(x => hashSet.Contains(x)); return toolSettings; } /// - ///

    Disables

    - ///

    (macOS only) Make the Editor use Metal as the default graphics API.

    + ///

    Removes values from

    + ///

    Filter editor tests by categories.

    ///
    [Pure] - public static T DisableForceGfxMetal(this T toolSettings) where T : UnitySettings + public static T RemoveEditorTestsCategories(this T toolSettings, IEnumerable editorTestsCategories) where T : UnitySettings { toolSettings = toolSettings.NewInstance(); - toolSettings.ForceGfxMetal = false; + var hashSet = new HashSet(editorTestsCategories); + toolSettings.EditorTestsCategoriesInternal.RemoveAll(x => hashSet.Contains(x)); return toolSettings; } + #endregion + #region EditorTestsFilter /// - ///

    Toggles

    - ///

    (macOS only) Make the Editor use Metal as the default graphics API.

    + ///

    Sets to a new list

    + ///

    Filter editor tests by names.

    ///
    [Pure] - public static T ToggleForceGfxMetal(this T toolSettings) where T : UnitySettings + public static T SetEditorTestsFilter(this T toolSettings, params string[] editorTestsFilter) where T : UnitySettings { toolSettings = toolSettings.NewInstance(); - toolSettings.ForceGfxMetal = !toolSettings.ForceGfxMetal; + toolSettings.EditorTestsFilterInternal = editorTestsFilter.ToList(); return toolSettings; } - #endregion - #region ForceGLCore /// - ///

    Sets

    - ///

    (Windows only) Make the Editor use OpenGL 3/4 core profile for rendering. The Editor tries to use the best OpenGL version available and all OpenGL extensions exposed by the OpenGL drivers. If the platform isn't supported, Direct3D is used.

    + ///

    Sets to a new list

    + ///

    Filter editor tests by names.

    ///
    [Pure] - public static T SetForceGLCore(this T toolSettings, bool? forceGLCore) where T : UnitySettings + public static T SetEditorTestsFilter(this T toolSettings, IEnumerable editorTestsFilter) where T : UnitySettings { toolSettings = toolSettings.NewInstance(); - toolSettings.ForceGLCore = forceGLCore; + toolSettings.EditorTestsFilterInternal = editorTestsFilter.ToList(); return toolSettings; } /// - ///

    Resets

    - ///

    (Windows only) Make the Editor use OpenGL 3/4 core profile for rendering. The Editor tries to use the best OpenGL version available and all OpenGL extensions exposed by the OpenGL drivers. If the platform isn't supported, Direct3D is used.

    + ///

    Adds values to

    + ///

    Filter editor tests by names.

    ///
    [Pure] - public static T ResetForceGLCore(this T toolSettings) where T : UnitySettings + public static T AddEditorTestsFilter(this T toolSettings, params string[] editorTestsFilter) where T : UnitySettings { toolSettings = toolSettings.NewInstance(); - toolSettings.ForceGLCore = null; + toolSettings.EditorTestsFilterInternal.AddRange(editorTestsFilter); return toolSettings; } /// - ///

    Enables

    - ///

    (Windows only) Make the Editor use OpenGL 3/4 core profile for rendering. The Editor tries to use the best OpenGL version available and all OpenGL extensions exposed by the OpenGL drivers. If the platform isn't supported, Direct3D is used.

    + ///

    Adds values to

    + ///

    Filter editor tests by names.

    ///
    [Pure] - public static T EnableForceGLCore(this T toolSettings) where T : UnitySettings + public static T AddEditorTestsFilter(this T toolSettings, IEnumerable editorTestsFilter) where T : UnitySettings { toolSettings = toolSettings.NewInstance(); - toolSettings.ForceGLCore = true; + toolSettings.EditorTestsFilterInternal.AddRange(editorTestsFilter); return toolSettings; } /// - ///

    Disables

    - ///

    (Windows only) Make the Editor use OpenGL 3/4 core profile for rendering. The Editor tries to use the best OpenGL version available and all OpenGL extensions exposed by the OpenGL drivers. If the platform isn't supported, Direct3D is used.

    + ///

    Clears

    + ///

    Filter editor tests by names.

    ///
    [Pure] - public static T DisableForceGLCore(this T toolSettings) where T : UnitySettings + public static T ClearEditorTestsFilter(this T toolSettings) where T : UnitySettings { toolSettings = toolSettings.NewInstance(); - toolSettings.ForceGLCore = false; + toolSettings.EditorTestsFilterInternal.Clear(); return toolSettings; } /// - ///

    Toggles

    - ///

    (Windows only) Make the Editor use OpenGL 3/4 core profile for rendering. The Editor tries to use the best OpenGL version available and all OpenGL extensions exposed by the OpenGL drivers. If the platform isn't supported, Direct3D is used.

    + ///

    Removes values from

    + ///

    Filter editor tests by names.

    ///
    [Pure] - public static T ToggleForceGLCore(this T toolSettings) where T : UnitySettings + public static T RemoveEditorTestsFilter(this T toolSettings, params string[] editorTestsFilter) where T : UnitySettings { toolSettings = toolSettings.NewInstance(); - toolSettings.ForceGLCore = !toolSettings.ForceGLCore; + var hashSet = new HashSet(editorTestsFilter); + toolSettings.EditorTestsFilterInternal.RemoveAll(x => hashSet.Contains(x)); return toolSettings; } - #endregion - #region ForceGLCoreXY /// - ///

    Sets

    - ///

    (Windows only) Similar to -force-glcore, but requests a specific OpenGL context version. Accepted values for XY: 32, 33, 40, 41, 42, 43, 44 or 45.

    + ///

    Removes values from

    + ///

    Filter editor tests by names.

    ///
    [Pure] - public static T SetForceGLCoreXY(this T toolSettings, UnityGLCore forceGLCoreXY) where T : UnitySettings + public static T RemoveEditorTestsFilter(this T toolSettings, IEnumerable editorTestsFilter) where T : UnitySettings { toolSettings = toolSettings.NewInstance(); - toolSettings.ForceGLCoreXY = forceGLCoreXY; + var hashSet = new HashSet(editorTestsFilter); + toolSettings.EditorTestsFilterInternal.RemoveAll(x => hashSet.Contains(x)); return toolSettings; } + #endregion + #region EditorTestsResultFile /// - ///

    Resets

    - ///

    (Windows only) Similar to -force-glcore, but requests a specific OpenGL context version. Accepted values for XY: 32, 33, 40, 41, 42, 43, 44 or 45.

    + ///

    Sets

    + ///

    Path where the result file should be placed. If the path is a folder, a default file name is used. If not specified, the results are placed in the project's root folder.

    ///
    [Pure] - public static T ResetForceGLCoreXY(this T toolSettings) where T : UnitySettings + public static T SetEditorTestsResultFile(this T toolSettings, string editorTestsResultFile) where T : UnitySettings { toolSettings = toolSettings.NewInstance(); - toolSettings.ForceGLCoreXY = null; + toolSettings.EditorTestsResultFile = editorTestsResultFile; return toolSettings; } - #endregion - #region ForceGLES /// - ///

    Sets

    - ///

    (Windows only) Make the Editor use OpenGL for Embedded Systems for rendering. The Editor tries to use the best OpenGL ES version available, and all OpenGL ES extensions exposed by the OpenGL drivers.

    + ///

    Resets

    + ///

    Path where the result file should be placed. If the path is a folder, a default file name is used. If not specified, the results are placed in the project's root folder.

    ///
    [Pure] - public static T SetForceGLES(this T toolSettings, bool? forceGLES) where T : UnitySettings + public static T ResetEditorTestsResultFile(this T toolSettings) where T : UnitySettings { toolSettings = toolSettings.NewInstance(); - toolSettings.ForceGLES = forceGLES; + toolSettings.EditorTestsResultFile = null; return toolSettings; } + #endregion + #region ExportPackage /// - ///

    Resets

    - ///

    (Windows only) Make the Editor use OpenGL for Embedded Systems for rendering. The Editor tries to use the best OpenGL ES version available, and all OpenGL ES extensions exposed by the OpenGL drivers.

    + ///

    Sets to a new list

    + ///

    Export a package, given a path (or set of given paths).-exportPackage <exportAssetPath> <exportFileName> In this example exportAssetPath is a folder (relative to to the Unity project root) to export from the Unity project, and exportFileName is the package name. Currently, this option only exports whole folders at a time. You normally need to use this command with the -projectPath argument.

    ///
    [Pure] - public static T ResetForceGLES(this T toolSettings) where T : UnitySettings + public static T SetExportPackage(this T toolSettings, params string[] exportPackage) where T : UnitySettings { toolSettings = toolSettings.NewInstance(); - toolSettings.ForceGLES = null; + toolSettings.ExportPackageInternal = exportPackage.ToList(); return toolSettings; } /// - ///

    Enables

    - ///

    (Windows only) Make the Editor use OpenGL for Embedded Systems for rendering. The Editor tries to use the best OpenGL ES version available, and all OpenGL ES extensions exposed by the OpenGL drivers.

    + ///

    Sets to a new list

    + ///

    Export a package, given a path (or set of given paths).-exportPackage <exportAssetPath> <exportFileName> In this example exportAssetPath is a folder (relative to to the Unity project root) to export from the Unity project, and exportFileName is the package name. Currently, this option only exports whole folders at a time. You normally need to use this command with the -projectPath argument.

    ///
    [Pure] - public static T EnableForceGLES(this T toolSettings) where T : UnitySettings + public static T SetExportPackage(this T toolSettings, IEnumerable exportPackage) where T : UnitySettings { toolSettings = toolSettings.NewInstance(); - toolSettings.ForceGLES = true; + toolSettings.ExportPackageInternal = exportPackage.ToList(); return toolSettings; } /// - ///

    Disables

    - ///

    (Windows only) Make the Editor use OpenGL for Embedded Systems for rendering. The Editor tries to use the best OpenGL ES version available, and all OpenGL ES extensions exposed by the OpenGL drivers.

    + ///

    Adds values to

    + ///

    Export a package, given a path (or set of given paths).-exportPackage <exportAssetPath> <exportFileName> In this example exportAssetPath is a folder (relative to to the Unity project root) to export from the Unity project, and exportFileName is the package name. Currently, this option only exports whole folders at a time. You normally need to use this command with the -projectPath argument.

    ///
    [Pure] - public static T DisableForceGLES(this T toolSettings) where T : UnitySettings + public static T AddExportPackage(this T toolSettings, params string[] exportPackage) where T : UnitySettings { toolSettings = toolSettings.NewInstance(); - toolSettings.ForceGLES = false; + toolSettings.ExportPackageInternal.AddRange(exportPackage); return toolSettings; } /// - ///

    Toggles

    - ///

    (Windows only) Make the Editor use OpenGL for Embedded Systems for rendering. The Editor tries to use the best OpenGL ES version available, and all OpenGL ES extensions exposed by the OpenGL drivers.

    + ///

    Adds values to

    + ///

    Export a package, given a path (or set of given paths).-exportPackage <exportAssetPath> <exportFileName> In this example exportAssetPath is a folder (relative to to the Unity project root) to export from the Unity project, and exportFileName is the package name. Currently, this option only exports whole folders at a time. You normally need to use this command with the -projectPath argument.

    ///
    [Pure] - public static T ToggleForceGLES(this T toolSettings) where T : UnitySettings + public static T AddExportPackage(this T toolSettings, IEnumerable exportPackage) where T : UnitySettings { toolSettings = toolSettings.NewInstance(); - toolSettings.ForceGLES = !toolSettings.ForceGLES; + toolSettings.ExportPackageInternal.AddRange(exportPackage); return toolSettings; } - #endregion - #region ForceGLESXY /// - ///

    Sets

    - ///

    (Windows only) Similar to -force-gles, but requests a specific OpenGL ES context version. Accepted values for XY: 30, 31 or 32.

    + ///

    Clears

    + ///

    Export a package, given a path (or set of given paths).-exportPackage <exportAssetPath> <exportFileName> In this example exportAssetPath is a folder (relative to to the Unity project root) to export from the Unity project, and exportFileName is the package name. Currently, this option only exports whole folders at a time. You normally need to use this command with the -projectPath argument.

    ///
    [Pure] - public static T SetForceGLESXY(this T toolSettings, UnityGLES forceGLESXY) where T : UnitySettings + public static T ClearExportPackage(this T toolSettings) where T : UnitySettings { toolSettings = toolSettings.NewInstance(); - toolSettings.ForceGLESXY = forceGLESXY; + toolSettings.ExportPackageInternal.Clear(); return toolSettings; } /// - ///

    Resets

    - ///

    (Windows only) Similar to -force-gles, but requests a specific OpenGL ES context version. Accepted values for XY: 30, 31 or 32.

    + ///

    Removes values from

    + ///

    Export a package, given a path (or set of given paths).-exportPackage <exportAssetPath> <exportFileName> In this example exportAssetPath is a folder (relative to to the Unity project root) to export from the Unity project, and exportFileName is the package name. Currently, this option only exports whole folders at a time. You normally need to use this command with the -projectPath argument.

    ///
    [Pure] - public static T ResetForceGLESXY(this T toolSettings) where T : UnitySettings + public static T RemoveExportPackage(this T toolSettings, params string[] exportPackage) where T : UnitySettings { toolSettings = toolSettings.NewInstance(); - toolSettings.ForceGLESXY = null; + var hashSet = new HashSet(exportPackage); + toolSettings.ExportPackageInternal.RemoveAll(x => hashSet.Contains(x)); return toolSettings; } - #endregion - #region ForceClamped /// - ///

    Sets

    - ///

    (2017.3+) (Windows only) Used with -force-glcoreXY to prevent checking for additional OpenGL extensions, allowing it to run between platforms with the same code paths.

    + ///

    Removes values from

    + ///

    Export a package, given a path (or set of given paths).-exportPackage <exportAssetPath> <exportFileName> In this example exportAssetPath is a folder (relative to to the Unity project root) to export from the Unity project, and exportFileName is the package name. Currently, this option only exports whole folders at a time. You normally need to use this command with the -projectPath argument.

    ///
    [Pure] - public static T SetForceClamped(this T toolSettings, bool? forceClamped) where T : UnitySettings + public static T RemoveExportPackage(this T toolSettings, IEnumerable exportPackage) where T : UnitySettings { toolSettings = toolSettings.NewInstance(); - toolSettings.ForceClamped = forceClamped; + var hashSet = new HashSet(exportPackage); + toolSettings.ExportPackageInternal.RemoveAll(x => hashSet.Contains(x)); return toolSettings; } + #endregion + #region Username /// - ///

    Resets

    - ///

    (2017.3+) (Windows only) Used with -force-glcoreXY to prevent checking for additional OpenGL extensions, allowing it to run between platforms with the same code paths.

    + ///

    Sets

    + ///

    Enter a username into the log-in form during activation of the Unity Editor.

    ///
    [Pure] - public static T ResetForceClamped(this T toolSettings) where T : UnitySettings + public static T SetUsername(this T toolSettings, string username) where T : UnitySettings { toolSettings = toolSettings.NewInstance(); - toolSettings.ForceClamped = null; + toolSettings.Username = username; return toolSettings; } /// - ///

    Enables

    - ///

    (2017.3+) (Windows only) Used with -force-glcoreXY to prevent checking for additional OpenGL extensions, allowing it to run between platforms with the same code paths.

    + ///

    Resets

    + ///

    Enter a username into the log-in form during activation of the Unity Editor.

    ///
    [Pure] - public static T EnableForceClamped(this T toolSettings) where T : UnitySettings + public static T ResetUsername(this T toolSettings) where T : UnitySettings { toolSettings = toolSettings.NewInstance(); - toolSettings.ForceClamped = true; + toolSettings.Username = null; return toolSettings; } + #endregion + #region Password /// - ///

    Disables

    - ///

    (2017.3+) (Windows only) Used with -force-glcoreXY to prevent checking for additional OpenGL extensions, allowing it to run between platforms with the same code paths.

    + ///

    Sets

    + ///

    Enter a password into the log-in form during activation of the Unity Editor.

    ///
    [Pure] - public static T DisableForceClamped(this T toolSettings) where T : UnitySettings + public static T SetPassword(this T toolSettings, [Secret] string password) where T : UnitySettings { toolSettings = toolSettings.NewInstance(); - toolSettings.ForceClamped = false; + toolSettings.Password = password; return toolSettings; } /// - ///

    Toggles

    - ///

    (2017.3+) (Windows only) Used with -force-glcoreXY to prevent checking for additional OpenGL extensions, allowing it to run between platforms with the same code paths.

    + ///

    Resets

    + ///

    Enter a password into the log-in form during activation of the Unity Editor.

    ///
    [Pure] - public static T ToggleForceClamped(this T toolSettings) where T : UnitySettings + public static T ResetPassword(this T toolSettings) where T : UnitySettings { toolSettings = toolSettings.NewInstance(); - toolSettings.ForceClamped = !toolSettings.ForceClamped; + toolSettings.Password = null; return toolSettings; } #endregion - #region ForceLowPowerDevice + #region Serial /// - ///

    Sets

    - ///

    (macOS only) When using Metal, make the Editor use a low power device.

    + ///

    Sets

    + ///

    Activate Unity with the specified serial key. It is good practice to pass the -batchmode and -quit arguments as well, in order to quit Unity when done, if using this for automated activation of Unity. Please allow a few seconds before the license file is created, because Unity needs to communicate with the license server. Make sure that license file folder exists, and has appropriate permissions before running Unity with this argument. If activation fails, see the Editor.log for info.

    ///
    [Pure] - public static T SetForceLowPowerDevice(this T toolSettings, bool? forceLowPowerDevice) where T : UnitySettings + public static T SetSerial(this T toolSettings, [Secret] string serial) where T : UnitySettings { toolSettings = toolSettings.NewInstance(); - toolSettings.ForceLowPowerDevice = forceLowPowerDevice; + toolSettings.Serial = serial; return toolSettings; } /// - ///

    Resets

    - ///

    (macOS only) When using Metal, make the Editor use a low power device.

    + ///

    Resets

    + ///

    Activate Unity with the specified serial key. It is good practice to pass the -batchmode and -quit arguments as well, in order to quit Unity when done, if using this for automated activation of Unity. Please allow a few seconds before the license file is created, because Unity needs to communicate with the license server. Make sure that license file folder exists, and has appropriate permissions before running Unity with this argument. If activation fails, see the Editor.log for info.

    ///
    [Pure] - public static T ResetForceLowPowerDevice(this T toolSettings) where T : UnitySettings + public static T ResetSerial(this T toolSettings) where T : UnitySettings { toolSettings = toolSettings.NewInstance(); - toolSettings.ForceLowPowerDevice = null; + toolSettings.Serial = null; return toolSettings; } + #endregion + #region BatchMode /// - ///

    Enables

    - ///

    (macOS only) When using Metal, make the Editor use a low power device.

    + ///

    Sets

    + ///

    Run Unity in batch mode. This should always be used in conjunction with the other command line arguments, because it ensures no pop-up windows appear and eliminates the need for any human intervention. When an exception occurs during execution of the script code, the Asset server updates fail, or other operations that fail, Unity immediately exits with return code 1.Note that in batch mode, Unity sends a minimal version of its log output to the console. However, the Log Files still contain the full log information. Opening a project in batch mode while the Editor has the same project open is not supported; only a single instance of Unity can run at a time.

    ///
    [Pure] - public static T EnableForceLowPowerDevice(this T toolSettings) where T : UnitySettings + public static T SetBatchMode(this T toolSettings, bool? batchMode) where T : UnitySettings { toolSettings = toolSettings.NewInstance(); - toolSettings.ForceLowPowerDevice = true; + toolSettings.BatchMode = batchMode; return toolSettings; } /// - ///

    Disables

    - ///

    (macOS only) When using Metal, make the Editor use a low power device.

    + ///

    Resets

    + ///

    Run Unity in batch mode. This should always be used in conjunction with the other command line arguments, because it ensures no pop-up windows appear and eliminates the need for any human intervention. When an exception occurs during execution of the script code, the Asset server updates fail, or other operations that fail, Unity immediately exits with return code 1.Note that in batch mode, Unity sends a minimal version of its log output to the console. However, the Log Files still contain the full log information. Opening a project in batch mode while the Editor has the same project open is not supported; only a single instance of Unity can run at a time.

    ///
    [Pure] - public static T DisableForceLowPowerDevice(this T toolSettings) where T : UnitySettings + public static T ResetBatchMode(this T toolSettings) where T : UnitySettings { toolSettings = toolSettings.NewInstance(); - toolSettings.ForceLowPowerDevice = false; + toolSettings.BatchMode = null; return toolSettings; } /// - ///

    Toggles

    - ///

    (macOS only) When using Metal, make the Editor use a low power device.

    + ///

    Enables

    + ///

    Run Unity in batch mode. This should always be used in conjunction with the other command line arguments, because it ensures no pop-up windows appear and eliminates the need for any human intervention. When an exception occurs during execution of the script code, the Asset server updates fail, or other operations that fail, Unity immediately exits with return code 1.Note that in batch mode, Unity sends a minimal version of its log output to the console. However, the Log Files still contain the full log information. Opening a project in batch mode while the Editor has the same project open is not supported; only a single instance of Unity can run at a time.

    ///
    [Pure] - public static T ToggleForceLowPowerDevice(this T toolSettings) where T : UnitySettings + public static T EnableBatchMode(this T toolSettings) where T : UnitySettings { toolSettings = toolSettings.NewInstance(); - toolSettings.ForceLowPowerDevice = !toolSettings.ForceLowPowerDevice; + toolSettings.BatchMode = true; return toolSettings; } - #endregion - #region ImportPackage /// - ///

    Sets

    - ///

    Import the given package. No import dialog is shown.

    + ///

    Disables

    + ///

    Run Unity in batch mode. This should always be used in conjunction with the other command line arguments, because it ensures no pop-up windows appear and eliminates the need for any human intervention. When an exception occurs during execution of the script code, the Asset server updates fail, or other operations that fail, Unity immediately exits with return code 1.Note that in batch mode, Unity sends a minimal version of its log output to the console. However, the Log Files still contain the full log information. Opening a project in batch mode while the Editor has the same project open is not supported; only a single instance of Unity can run at a time.

    ///
    [Pure] - public static T SetImportPackage(this T toolSettings, string importPackage) where T : UnitySettings + public static T DisableBatchMode(this T toolSettings) where T : UnitySettings { toolSettings = toolSettings.NewInstance(); - toolSettings.ImportPackage = importPackage; + toolSettings.BatchMode = false; return toolSettings; } /// - ///

    Resets

    - ///

    Import the given package. No import dialog is shown.

    + ///

    Toggles

    + ///

    Run Unity in batch mode. This should always be used in conjunction with the other command line arguments, because it ensures no pop-up windows appear and eliminates the need for any human intervention. When an exception occurs during execution of the script code, the Asset server updates fail, or other operations that fail, Unity immediately exits with return code 1.Note that in batch mode, Unity sends a minimal version of its log output to the console. However, the Log Files still contain the full log information. Opening a project in batch mode while the Editor has the same project open is not supported; only a single instance of Unity can run at a time.

    ///
    [Pure] - public static T ResetImportPackage(this T toolSettings) where T : UnitySettings + public static T ToggleBatchMode(this T toolSettings) where T : UnitySettings { toolSettings = toolSettings.NewInstance(); - toolSettings.ImportPackage = null; + toolSettings.BatchMode = !toolSettings.BatchMode; return toolSettings; } #endregion - #region DefaultPlatformTextureFormat + #region SilentCrashes /// - ///

    Sets

    - ///

    (2018.1+) Sets the default texture compression to the desired format before importing a texture or building the project. This is so you don’t have to import the texture again with the format you want. The available formats are dxt, pvrtc, atc, etc, etc2, and astc. Note that this is only supported on Android.

    + ///

    Sets

    + ///

    Don't display a crash dialog.

    ///
    [Pure] - public static T SetDefaultPlatformTextureFormat(this T toolSettings, string defaultPlatformTextureFormat) where T : UnitySettings + public static T SetSilentCrashes(this T toolSettings, bool? silentCrashes) where T : UnitySettings { toolSettings = toolSettings.NewInstance(); - toolSettings.DefaultPlatformTextureFormat = defaultPlatformTextureFormat; + toolSettings.SilentCrashes = silentCrashes; return toolSettings; } /// - ///

    Resets

    - ///

    (2018.1+) Sets the default texture compression to the desired format before importing a texture or building the project. This is so you don’t have to import the texture again with the format you want. The available formats are dxt, pvrtc, atc, etc, etc2, and astc. Note that this is only supported on Android.

    + ///

    Resets

    + ///

    Don't display a crash dialog.

    ///
    [Pure] - public static T ResetDefaultPlatformTextureFormat(this T toolSettings) where T : UnitySettings + public static T ResetSilentCrashes(this T toolSettings) where T : UnitySettings { toolSettings = toolSettings.NewInstance(); - toolSettings.DefaultPlatformTextureFormat = null; + toolSettings.SilentCrashes = null; return toolSettings; } - #endregion - #region DisableAssemblyUpdater /// - ///

    Sets to a new list

    - ///

    Specify a space-separated list of assembly names as parameters for Unity to ignore on automatic updates. The space-separated list of assembly names is optional: Pass the command line options without any assembly names to ignore all assemblies.

    + ///

    Enables

    + ///

    Don't display a crash dialog.

    ///
    [Pure] - public static T SetDisableAssemblyUpdater(this T toolSettings, params string[] disableAssemblyUpdater) where T : UnitySettings + public static T EnableSilentCrashes(this T toolSettings) where T : UnitySettings { toolSettings = toolSettings.NewInstance(); - toolSettings.DisableAssemblyUpdaterInternal = disableAssemblyUpdater.ToList(); + toolSettings.SilentCrashes = true; return toolSettings; } /// - ///

    Sets to a new list

    - ///

    Specify a space-separated list of assembly names as parameters for Unity to ignore on automatic updates. The space-separated list of assembly names is optional: Pass the command line options without any assembly names to ignore all assemblies.

    + ///

    Disables

    + ///

    Don't display a crash dialog.

    ///
    [Pure] - public static T SetDisableAssemblyUpdater(this T toolSettings, IEnumerable disableAssemblyUpdater) where T : UnitySettings + public static T DisableSilentCrashes(this T toolSettings) where T : UnitySettings { toolSettings = toolSettings.NewInstance(); - toolSettings.DisableAssemblyUpdaterInternal = disableAssemblyUpdater.ToList(); + toolSettings.SilentCrashes = false; return toolSettings; } /// - ///

    Adds values to

    - ///

    Specify a space-separated list of assembly names as parameters for Unity to ignore on automatic updates. The space-separated list of assembly names is optional: Pass the command line options without any assembly names to ignore all assemblies.

    + ///

    Toggles

    + ///

    Don't display a crash dialog.

    ///
    [Pure] - public static T AddDisableAssemblyUpdater(this T toolSettings, params string[] disableAssemblyUpdater) where T : UnitySettings + public static T ToggleSilentCrashes(this T toolSettings) where T : UnitySettings { toolSettings = toolSettings.NewInstance(); - toolSettings.DisableAssemblyUpdaterInternal.AddRange(disableAssemblyUpdater); + toolSettings.SilentCrashes = !toolSettings.SilentCrashes; return toolSettings; } + #endregion + #region NoGraphics /// - ///

    Adds values to

    - ///

    Specify a space-separated list of assembly names as parameters for Unity to ignore on automatic updates. The space-separated list of assembly names is optional: Pass the command line options without any assembly names to ignore all assemblies.

    + ///

    Sets

    + ///

    When running in batch mode, do not initialize the graphics device at all. This makes it possible to run your automated workflows on machines that don't even have a GPU (automated workflows only work when you have a window in focus, otherwise you can't send simulated input commands). Please note that -nographics does not allow you to bake GI on OSX, since Enlighten requires GPU acceleration.

    ///
    [Pure] - public static T AddDisableAssemblyUpdater(this T toolSettings, IEnumerable disableAssemblyUpdater) where T : UnitySettings + public static T SetNoGraphics(this T toolSettings, bool? noGraphics) where T : UnitySettings { toolSettings = toolSettings.NewInstance(); - toolSettings.DisableAssemblyUpdaterInternal.AddRange(disableAssemblyUpdater); + toolSettings.NoGraphics = noGraphics; return toolSettings; } /// - ///

    Clears

    - ///

    Specify a space-separated list of assembly names as parameters for Unity to ignore on automatic updates. The space-separated list of assembly names is optional: Pass the command line options without any assembly names to ignore all assemblies.

    + ///

    Resets

    + ///

    When running in batch mode, do not initialize the graphics device at all. This makes it possible to run your automated workflows on machines that don't even have a GPU (automated workflows only work when you have a window in focus, otherwise you can't send simulated input commands). Please note that -nographics does not allow you to bake GI on OSX, since Enlighten requires GPU acceleration.

    ///
    [Pure] - public static T ClearDisableAssemblyUpdater(this T toolSettings) where T : UnitySettings + public static T ResetNoGraphics(this T toolSettings) where T : UnitySettings { toolSettings = toolSettings.NewInstance(); - toolSettings.DisableAssemblyUpdaterInternal.Clear(); + toolSettings.NoGraphics = null; return toolSettings; } /// - ///

    Removes values from

    - ///

    Specify a space-separated list of assembly names as parameters for Unity to ignore on automatic updates. The space-separated list of assembly names is optional: Pass the command line options without any assembly names to ignore all assemblies.

    + ///

    Enables

    + ///

    When running in batch mode, do not initialize the graphics device at all. This makes it possible to run your automated workflows on machines that don't even have a GPU (automated workflows only work when you have a window in focus, otherwise you can't send simulated input commands). Please note that -nographics does not allow you to bake GI on OSX, since Enlighten requires GPU acceleration.

    ///
    [Pure] - public static T RemoveDisableAssemblyUpdater(this T toolSettings, params string[] disableAssemblyUpdater) where T : UnitySettings + public static T EnableNoGraphics(this T toolSettings) where T : UnitySettings { toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(disableAssemblyUpdater); - toolSettings.DisableAssemblyUpdaterInternal.RemoveAll(x => hashSet.Contains(x)); + toolSettings.NoGraphics = true; return toolSettings; } /// - ///

    Removes values from

    - ///

    Specify a space-separated list of assembly names as parameters for Unity to ignore on automatic updates. The space-separated list of assembly names is optional: Pass the command line options without any assembly names to ignore all assemblies.

    + ///

    Disables

    + ///

    When running in batch mode, do not initialize the graphics device at all. This makes it possible to run your automated workflows on machines that don't even have a GPU (automated workflows only work when you have a window in focus, otherwise you can't send simulated input commands). Please note that -nographics does not allow you to bake GI on OSX, since Enlighten requires GPU acceleration.

    ///
    [Pure] - public static T RemoveDisableAssemblyUpdater(this T toolSettings, IEnumerable disableAssemblyUpdater) where T : UnitySettings + public static T DisableNoGraphics(this T toolSettings) where T : UnitySettings { toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(disableAssemblyUpdater); - toolSettings.DisableAssemblyUpdaterInternal.RemoveAll(x => hashSet.Contains(x)); + toolSettings.NoGraphics = false; return toolSettings; } - #endregion - #region CacheServerIPAddress /// - ///

    Sets

    - ///

    (2018.1+) Connect to the Cache Server given by IP:port on startup, overriding any configuration stored in the Editor Preferences. Use this to connect multiple instances of Unity to different Cache Servers.

    + ///

    Toggles

    + ///

    When running in batch mode, do not initialize the graphics device at all. This makes it possible to run your automated workflows on machines that don't even have a GPU (automated workflows only work when you have a window in focus, otherwise you can't send simulated input commands). Please note that -nographics does not allow you to bake GI on OSX, since Enlighten requires GPU acceleration.

    ///
    [Pure] - public static T SetCacheServerIPAddress(this T toolSettings, string cacheServerIPAddress) where T : UnitySettings + public static T ToggleNoGraphics(this T toolSettings) where T : UnitySettings { toolSettings = toolSettings.NewInstance(); - toolSettings.CacheServerIPAddress = cacheServerIPAddress; + toolSettings.NoGraphics = !toolSettings.NoGraphics; return toolSettings; } + #endregion + #region Quit /// - ///

    Resets

    - ///

    (2018.1+) Connect to the Cache Server given by IP:port on startup, overriding any configuration stored in the Editor Preferences. Use this to connect multiple instances of Unity to different Cache Servers.

    + ///

    Sets

    + ///

    Quit the Unity Editor after other commands have finished executing. Note that this can cause error messages to be hidden (however, they still appear in the Editor.log file).

    ///
    [Pure] - public static T ResetCacheServerIPAddress(this T toolSettings) where T : UnitySettings + public static T SetQuit(this T toolSettings, bool? quit) where T : UnitySettings { toolSettings = toolSettings.NewInstance(); - toolSettings.CacheServerIPAddress = null; + toolSettings.Quit = quit; return toolSettings; } - #endregion - #region NoUpm /// - ///

    Sets

    - ///

    (2018.1+) Disables the Unity Package Manager.

    + ///

    Resets

    + ///

    Quit the Unity Editor after other commands have finished executing. Note that this can cause error messages to be hidden (however, they still appear in the Editor.log file).

    ///
    [Pure] - public static T SetNoUpm(this T toolSettings, bool? noUpm) where T : UnitySettings + public static T ResetQuit(this T toolSettings) where T : UnitySettings { toolSettings = toolSettings.NewInstance(); - toolSettings.NoUpm = noUpm; + toolSettings.Quit = null; return toolSettings; } /// - ///

    Resets

    - ///

    (2018.1+) Disables the Unity Package Manager.

    + ///

    Enables

    + ///

    Quit the Unity Editor after other commands have finished executing. Note that this can cause error messages to be hidden (however, they still appear in the Editor.log file).

    ///
    [Pure] - public static T ResetNoUpm(this T toolSettings) where T : UnitySettings + public static T EnableQuit(this T toolSettings) where T : UnitySettings { toolSettings = toolSettings.NewInstance(); - toolSettings.NoUpm = null; + toolSettings.Quit = true; return toolSettings; } /// - ///

    Enables

    - ///

    (2018.1+) Disables the Unity Package Manager.

    + ///

    Disables

    + ///

    Quit the Unity Editor after other commands have finished executing. Note that this can cause error messages to be hidden (however, they still appear in the Editor.log file).

    ///
    [Pure] - public static T EnableNoUpm(this T toolSettings) where T : UnitySettings + public static T DisableQuit(this T toolSettings) where T : UnitySettings { toolSettings = toolSettings.NewInstance(); - toolSettings.NoUpm = true; + toolSettings.Quit = false; return toolSettings; } /// - ///

    Disables

    - ///

    (2018.1+) Disables the Unity Package Manager.

    + ///

    Toggles

    + ///

    Quit the Unity Editor after other commands have finished executing. Note that this can cause error messages to be hidden (however, they still appear in the Editor.log file).

    ///
    [Pure] - public static T DisableNoUpm(this T toolSettings) where T : UnitySettings + public static T ToggleQuit(this T toolSettings) where T : UnitySettings { toolSettings = toolSettings.NewInstance(); - toolSettings.NoUpm = false; + toolSettings.Quit = !toolSettings.Quit; return toolSettings; } + #endregion +} +#endregion +#region UnityReturnLicenseSettingsExtensions +/// +/// Used within . +/// +[PublicAPI] +[ExcludeFromCodeCoverage] +public static partial class UnityReturnLicenseSettingsExtensions +{ + #region Username /// - ///

    Toggles

    - ///

    (2018.1+) Disables the Unity Package Manager.

    + ///

    Sets

    + ///

    Enter a username into the log-in form during activation of the Unity Editor.

    ///
    [Pure] - public static T ToggleNoUpm(this T toolSettings) where T : UnitySettings + public static T SetUsername(this T toolSettings, string username) where T : UnityReturnLicenseSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.NoUpm = !toolSettings.NoUpm; + toolSettings.Username = username; return toolSettings; } - #endregion - #region AcceptApiUpdate /// - ///

    Sets

    - ///

    (2017.2+) Use this command line option to specify that APIUpdater should run when Unity is launched in batch mode. Omitting this command line argument when launching Unity in batch mode results in APIUpdater not running which can lead to compiler errors. Note that in versions prior to 2017.2 there’s no way to not run APIUpdater when Unity is launched in batch mode.

    + ///

    Resets

    + ///

    Enter a username into the log-in form during activation of the Unity Editor.

    ///
    [Pure] - public static T SetAcceptApiUpdate(this T toolSettings, bool? acceptApiUpdate) where T : UnitySettings + public static T ResetUsername(this T toolSettings) where T : UnityReturnLicenseSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.AcceptApiUpdate = acceptApiUpdate; + toolSettings.Username = null; return toolSettings; } + #endregion + #region Password /// - ///

    Resets

    - ///

    (2017.2+) Use this command line option to specify that APIUpdater should run when Unity is launched in batch mode. Omitting this command line argument when launching Unity in batch mode results in APIUpdater not running which can lead to compiler errors. Note that in versions prior to 2017.2 there’s no way to not run APIUpdater when Unity is launched in batch mode.

    + ///

    Sets

    + ///

    Enter a password into the log-in form during activation of the Unity Editor.

    ///
    [Pure] - public static T ResetAcceptApiUpdate(this T toolSettings) where T : UnitySettings + public static T SetPassword(this T toolSettings, [Secret] string password) where T : UnityReturnLicenseSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.AcceptApiUpdate = null; + toolSettings.Password = password; return toolSettings; } /// - ///

    Enables

    - ///

    (2017.2+) Use this command line option to specify that APIUpdater should run when Unity is launched in batch mode. Omitting this command line argument when launching Unity in batch mode results in APIUpdater not running which can lead to compiler errors. Note that in versions prior to 2017.2 there’s no way to not run APIUpdater when Unity is launched in batch mode.

    + ///

    Resets

    + ///

    Enter a password into the log-in form during activation of the Unity Editor.

    ///
    [Pure] - public static T EnableAcceptApiUpdate(this T toolSettings) where T : UnitySettings + public static T ResetPassword(this T toolSettings) where T : UnityReturnLicenseSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.AcceptApiUpdate = true; + toolSettings.Password = null; return toolSettings; } + #endregion + #region Serial /// - ///

    Disables

    - ///

    (2017.2+) Use this command line option to specify that APIUpdater should run when Unity is launched in batch mode. Omitting this command line argument when launching Unity in batch mode results in APIUpdater not running which can lead to compiler errors. Note that in versions prior to 2017.2 there’s no way to not run APIUpdater when Unity is launched in batch mode.

    + ///

    Sets

    + ///

    Activate Unity with the specified serial key. It is good practice to pass the -batchmode and -quit arguments as well, in order to quit Unity when done, if using this for automated activation of Unity. Please allow a few seconds before the license file is created, because Unity needs to communicate with the license server. Make sure that license file folder exists, and has appropriate permissions before running Unity with this argument. If activation fails, see the Editor.log for info.

    ///
    [Pure] - public static T DisableAcceptApiUpdate(this T toolSettings) where T : UnitySettings + public static T SetSerial(this T toolSettings, [Secret] string serial) where T : UnityReturnLicenseSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.AcceptApiUpdate = false; + toolSettings.Serial = serial; return toolSettings; } /// - ///

    Toggles

    - ///

    (2017.2+) Use this command line option to specify that APIUpdater should run when Unity is launched in batch mode. Omitting this command line argument when launching Unity in batch mode results in APIUpdater not running which can lead to compiler errors. Note that in versions prior to 2017.2 there’s no way to not run APIUpdater when Unity is launched in batch mode.

    + ///

    Resets

    + ///

    Activate Unity with the specified serial key. It is good practice to pass the -batchmode and -quit arguments as well, in order to quit Unity when done, if using this for automated activation of Unity. Please allow a few seconds before the license file is created, because Unity needs to communicate with the license server. Make sure that license file folder exists, and has appropriate permissions before running Unity with this argument. If activation fails, see the Editor.log for info.

    ///
    [Pure] - public static T ToggleAcceptApiUpdate(this T toolSettings) where T : UnitySettings + public static T ResetSerial(this T toolSettings) where T : UnityReturnLicenseSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.AcceptApiUpdate = !toolSettings.AcceptApiUpdate; + toolSettings.Serial = null; return toolSettings; } #endregion - #region RunEditorTests + #region BatchMode /// - ///

    Sets

    - ///

    Run Editor tests from the project. This argument requires the projectPath, and it’s good practice to run it with batchmode argument. quit is not required, because the Editor automatically closes down after the run is finished.

    + ///

    Sets

    + ///

    Run Unity in batch mode. This should always be used in conjunction with the other command line arguments, because it ensures no pop-up windows appear and eliminates the need for any human intervention. When an exception occurs during execution of the script code, the Asset server updates fail, or other operations that fail, Unity immediately exits with return code 1.Note that in batch mode, Unity sends a minimal version of its log output to the console. However, the Log Files still contain the full log information. Opening a project in batch mode while the Editor has the same project open is not supported; only a single instance of Unity can run at a time.

    ///
    [Pure] - public static T SetRunEditorTests(this T toolSettings, bool? runEditorTests) where T : UnitySettings + public static T SetBatchMode(this T toolSettings, bool? batchMode) where T : UnityReturnLicenseSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.RunEditorTests = runEditorTests; + toolSettings.BatchMode = batchMode; return toolSettings; } /// - ///

    Resets

    - ///

    Run Editor tests from the project. This argument requires the projectPath, and it’s good practice to run it with batchmode argument. quit is not required, because the Editor automatically closes down after the run is finished.

    + ///

    Resets

    + ///

    Run Unity in batch mode. This should always be used in conjunction with the other command line arguments, because it ensures no pop-up windows appear and eliminates the need for any human intervention. When an exception occurs during execution of the script code, the Asset server updates fail, or other operations that fail, Unity immediately exits with return code 1.Note that in batch mode, Unity sends a minimal version of its log output to the console. However, the Log Files still contain the full log information. Opening a project in batch mode while the Editor has the same project open is not supported; only a single instance of Unity can run at a time.

    ///
    [Pure] - public static T ResetRunEditorTests(this T toolSettings) where T : UnitySettings + public static T ResetBatchMode(this T toolSettings) where T : UnityReturnLicenseSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.RunEditorTests = null; + toolSettings.BatchMode = null; return toolSettings; } /// - ///

    Enables

    - ///

    Run Editor tests from the project. This argument requires the projectPath, and it’s good practice to run it with batchmode argument. quit is not required, because the Editor automatically closes down after the run is finished.

    + ///

    Enables

    + ///

    Run Unity in batch mode. This should always be used in conjunction with the other command line arguments, because it ensures no pop-up windows appear and eliminates the need for any human intervention. When an exception occurs during execution of the script code, the Asset server updates fail, or other operations that fail, Unity immediately exits with return code 1.Note that in batch mode, Unity sends a minimal version of its log output to the console. However, the Log Files still contain the full log information. Opening a project in batch mode while the Editor has the same project open is not supported; only a single instance of Unity can run at a time.

    ///
    [Pure] - public static T EnableRunEditorTests(this T toolSettings) where T : UnitySettings + public static T EnableBatchMode(this T toolSettings) where T : UnityReturnLicenseSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.RunEditorTests = true; + toolSettings.BatchMode = true; return toolSettings; } /// - ///

    Disables

    - ///

    Run Editor tests from the project. This argument requires the projectPath, and it’s good practice to run it with batchmode argument. quit is not required, because the Editor automatically closes down after the run is finished.

    + ///

    Disables

    + ///

    Run Unity in batch mode. This should always be used in conjunction with the other command line arguments, because it ensures no pop-up windows appear and eliminates the need for any human intervention. When an exception occurs during execution of the script code, the Asset server updates fail, or other operations that fail, Unity immediately exits with return code 1.Note that in batch mode, Unity sends a minimal version of its log output to the console. However, the Log Files still contain the full log information. Opening a project in batch mode while the Editor has the same project open is not supported; only a single instance of Unity can run at a time.

    ///
    [Pure] - public static T DisableRunEditorTests(this T toolSettings) where T : UnitySettings + public static T DisableBatchMode(this T toolSettings) where T : UnityReturnLicenseSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.RunEditorTests = false; + toolSettings.BatchMode = false; return toolSettings; } /// - ///

    Toggles

    - ///

    Run Editor tests from the project. This argument requires the projectPath, and it’s good practice to run it with batchmode argument. quit is not required, because the Editor automatically closes down after the run is finished.

    + ///

    Toggles

    + ///

    Run Unity in batch mode. This should always be used in conjunction with the other command line arguments, because it ensures no pop-up windows appear and eliminates the need for any human intervention. When an exception occurs during execution of the script code, the Asset server updates fail, or other operations that fail, Unity immediately exits with return code 1.Note that in batch mode, Unity sends a minimal version of its log output to the console. However, the Log Files still contain the full log information. Opening a project in batch mode while the Editor has the same project open is not supported; only a single instance of Unity can run at a time.

    ///
    [Pure] - public static T ToggleRunEditorTests(this T toolSettings) where T : UnitySettings + public static T ToggleBatchMode(this T toolSettings) where T : UnityReturnLicenseSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.RunEditorTests = !toolSettings.RunEditorTests; + toolSettings.BatchMode = !toolSettings.BatchMode; return toolSettings; } #endregion - #region EditorTestsCategories + #region SilentCrashes /// - ///

    Sets to a new list

    - ///

    Filter editor tests by categories.

    + ///

    Sets

    + ///

    Don't display a crash dialog.

    ///
    [Pure] - public static T SetEditorTestsCategories(this T toolSettings, params string[] editorTestsCategories) where T : UnitySettings + public static T SetSilentCrashes(this T toolSettings, bool? silentCrashes) where T : UnityReturnLicenseSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.EditorTestsCategoriesInternal = editorTestsCategories.ToList(); + toolSettings.SilentCrashes = silentCrashes; return toolSettings; } /// - ///

    Sets to a new list

    - ///

    Filter editor tests by categories.

    + ///

    Resets

    + ///

    Don't display a crash dialog.

    ///
    [Pure] - public static T SetEditorTestsCategories(this T toolSettings, IEnumerable editorTestsCategories) where T : UnitySettings + public static T ResetSilentCrashes(this T toolSettings) where T : UnityReturnLicenseSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.EditorTestsCategoriesInternal = editorTestsCategories.ToList(); + toolSettings.SilentCrashes = null; return toolSettings; } /// - ///

    Adds values to

    - ///

    Filter editor tests by categories.

    + ///

    Enables

    + ///

    Don't display a crash dialog.

    ///
    [Pure] - public static T AddEditorTestsCategories(this T toolSettings, params string[] editorTestsCategories) where T : UnitySettings + public static T EnableSilentCrashes(this T toolSettings) where T : UnityReturnLicenseSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.EditorTestsCategoriesInternal.AddRange(editorTestsCategories); + toolSettings.SilentCrashes = true; return toolSettings; } /// - ///

    Adds values to

    - ///

    Filter editor tests by categories.

    + ///

    Disables

    + ///

    Don't display a crash dialog.

    ///
    [Pure] - public static T AddEditorTestsCategories(this T toolSettings, IEnumerable editorTestsCategories) where T : UnitySettings + public static T DisableSilentCrashes(this T toolSettings) where T : UnityReturnLicenseSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.EditorTestsCategoriesInternal.AddRange(editorTestsCategories); + toolSettings.SilentCrashes = false; return toolSettings; } /// - ///

    Clears

    - ///

    Filter editor tests by categories.

    + ///

    Toggles

    + ///

    Don't display a crash dialog.

    ///
    [Pure] - public static T ClearEditorTestsCategories(this T toolSettings) where T : UnitySettings + public static T ToggleSilentCrashes(this T toolSettings) where T : UnityReturnLicenseSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.EditorTestsCategoriesInternal.Clear(); + toolSettings.SilentCrashes = !toolSettings.SilentCrashes; return toolSettings; } + #endregion + #region NoGraphics /// - ///

    Removes values from

    - ///

    Filter editor tests by categories.

    + ///

    Sets

    + ///

    When running in batch mode, do not initialize the graphics device at all. This makes it possible to run your automated workflows on machines that don't even have a GPU (automated workflows only work when you have a window in focus, otherwise you can't send simulated input commands). Please note that -nographics does not allow you to bake GI on OSX, since Enlighten requires GPU acceleration.

    ///
    [Pure] - public static T RemoveEditorTestsCategories(this T toolSettings, params string[] editorTestsCategories) where T : UnitySettings + public static T SetNoGraphics(this T toolSettings, bool? noGraphics) where T : UnityReturnLicenseSettings { toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(editorTestsCategories); - toolSettings.EditorTestsCategoriesInternal.RemoveAll(x => hashSet.Contains(x)); + toolSettings.NoGraphics = noGraphics; return toolSettings; } /// - ///

    Removes values from

    - ///

    Filter editor tests by categories.

    + ///

    Resets

    + ///

    When running in batch mode, do not initialize the graphics device at all. This makes it possible to run your automated workflows on machines that don't even have a GPU (automated workflows only work when you have a window in focus, otherwise you can't send simulated input commands). Please note that -nographics does not allow you to bake GI on OSX, since Enlighten requires GPU acceleration.

    ///
    [Pure] - public static T RemoveEditorTestsCategories(this T toolSettings, IEnumerable editorTestsCategories) where T : UnitySettings + public static T ResetNoGraphics(this T toolSettings) where T : UnityReturnLicenseSettings { toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(editorTestsCategories); - toolSettings.EditorTestsCategoriesInternal.RemoveAll(x => hashSet.Contains(x)); + toolSettings.NoGraphics = null; return toolSettings; } - #endregion - #region EditorTestsFilter /// - ///

    Sets to a new list

    - ///

    Filter editor tests by names.

    + ///

    Enables

    + ///

    When running in batch mode, do not initialize the graphics device at all. This makes it possible to run your automated workflows on machines that don't even have a GPU (automated workflows only work when you have a window in focus, otherwise you can't send simulated input commands). Please note that -nographics does not allow you to bake GI on OSX, since Enlighten requires GPU acceleration.

    ///
    [Pure] - public static T SetEditorTestsFilter(this T toolSettings, params string[] editorTestsFilter) where T : UnitySettings + public static T EnableNoGraphics(this T toolSettings) where T : UnityReturnLicenseSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.EditorTestsFilterInternal = editorTestsFilter.ToList(); + toolSettings.NoGraphics = true; return toolSettings; } /// - ///

    Sets to a new list

    - ///

    Filter editor tests by names.

    + ///

    Disables

    + ///

    When running in batch mode, do not initialize the graphics device at all. This makes it possible to run your automated workflows on machines that don't even have a GPU (automated workflows only work when you have a window in focus, otherwise you can't send simulated input commands). Please note that -nographics does not allow you to bake GI on OSX, since Enlighten requires GPU acceleration.

    ///
    [Pure] - public static T SetEditorTestsFilter(this T toolSettings, IEnumerable editorTestsFilter) where T : UnitySettings + public static T DisableNoGraphics(this T toolSettings) where T : UnityReturnLicenseSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.EditorTestsFilterInternal = editorTestsFilter.ToList(); + toolSettings.NoGraphics = false; return toolSettings; } /// - ///

    Adds values to

    - ///

    Filter editor tests by names.

    - ///
    - [Pure] - public static T AddEditorTestsFilter(this T toolSettings, params string[] editorTestsFilter) where T : UnitySettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.EditorTestsFilterInternal.AddRange(editorTestsFilter); - return toolSettings; - } - /// - ///

    Adds values to

    - ///

    Filter editor tests by names.

    + ///

    Toggles

    + ///

    When running in batch mode, do not initialize the graphics device at all. This makes it possible to run your automated workflows on machines that don't even have a GPU (automated workflows only work when you have a window in focus, otherwise you can't send simulated input commands). Please note that -nographics does not allow you to bake GI on OSX, since Enlighten requires GPU acceleration.

    ///
    [Pure] - public static T AddEditorTestsFilter(this T toolSettings, IEnumerable editorTestsFilter) where T : UnitySettings + public static T ToggleNoGraphics(this T toolSettings) where T : UnityReturnLicenseSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.EditorTestsFilterInternal.AddRange(editorTestsFilter); + toolSettings.NoGraphics = !toolSettings.NoGraphics; return toolSettings; } + #endregion + #region Quit /// - ///

    Clears

    - ///

    Filter editor tests by names.

    + ///

    Sets

    + ///

    Quit the Unity Editor after other commands have finished executing. Note that this can cause error messages to be hidden (however, they still appear in the Editor.log file).

    ///
    [Pure] - public static T ClearEditorTestsFilter(this T toolSettings) where T : UnitySettings + public static T SetQuit(this T toolSettings, bool? quit) where T : UnityReturnLicenseSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.EditorTestsFilterInternal.Clear(); + toolSettings.Quit = quit; return toolSettings; } /// - ///

    Removes values from

    - ///

    Filter editor tests by names.

    + ///

    Resets

    + ///

    Quit the Unity Editor after other commands have finished executing. Note that this can cause error messages to be hidden (however, they still appear in the Editor.log file).

    ///
    [Pure] - public static T RemoveEditorTestsFilter(this T toolSettings, params string[] editorTestsFilter) where T : UnitySettings + public static T ResetQuit(this T toolSettings) where T : UnityReturnLicenseSettings { toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(editorTestsFilter); - toolSettings.EditorTestsFilterInternal.RemoveAll(x => hashSet.Contains(x)); + toolSettings.Quit = null; return toolSettings; } /// - ///

    Removes values from

    - ///

    Filter editor tests by names.

    + ///

    Enables

    + ///

    Quit the Unity Editor after other commands have finished executing. Note that this can cause error messages to be hidden (however, they still appear in the Editor.log file).

    ///
    [Pure] - public static T RemoveEditorTestsFilter(this T toolSettings, IEnumerable editorTestsFilter) where T : UnitySettings + public static T EnableQuit(this T toolSettings) where T : UnityReturnLicenseSettings { toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(editorTestsFilter); - toolSettings.EditorTestsFilterInternal.RemoveAll(x => hashSet.Contains(x)); + toolSettings.Quit = true; return toolSettings; } - #endregion - #region EditorTestsResultFile /// - ///

    Sets

    - ///

    Path where the result file should be placed. If the path is a folder, a default file name is used. If not specified, the results are placed in the project's root folder.

    + ///

    Disables

    + ///

    Quit the Unity Editor after other commands have finished executing. Note that this can cause error messages to be hidden (however, they still appear in the Editor.log file).

    ///
    [Pure] - public static T SetEditorTestsResultFile(this T toolSettings, string editorTestsResultFile) where T : UnitySettings + public static T DisableQuit(this T toolSettings) where T : UnityReturnLicenseSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.EditorTestsResultFile = editorTestsResultFile; + toolSettings.Quit = false; return toolSettings; } /// - ///

    Resets

    - ///

    Path where the result file should be placed. If the path is a folder, a default file name is used. If not specified, the results are placed in the project's root folder.

    + ///

    Toggles

    + ///

    Quit the Unity Editor after other commands have finished executing. Note that this can cause error messages to be hidden (however, they still appear in the Editor.log file).

    ///
    [Pure] - public static T ResetEditorTestsResultFile(this T toolSettings) where T : UnitySettings + public static T ToggleQuit(this T toolSettings) where T : UnityReturnLicenseSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.EditorTestsResultFile = null; + toolSettings.Quit = !toolSettings.Quit; return toolSettings; } #endregion - #region ExportPackage +} +#endregion +#region UnityRunTestsSettingsExtensions +/// +/// Used within . +/// +[PublicAPI] +[ExcludeFromCodeCoverage] +public static partial class UnityRunTestsSettingsExtensions +{ + #region TestCategories /// - ///

    Sets to a new list

    - ///

    Export a package, given a path (or set of given paths).-exportPackage <exportAssetPath> <exportFileName> In this example exportAssetPath is a folder (relative to to the Unity project root) to export from the Unity project, and exportFileName is the package name. Currently, this option only exports whole folders at a time. You normally need to use this command with the -projectPath argument.

    + ///

    Sets to a new list

    + ///

    A list of test categories to include in the run, or a regular expression pattern to match category names. If using both TestFilters and TestCategories, then only tests that match both are run. This argument supports negation using '!'. If using '!MyCategory' then no tests with the 'MyCategory' category will be included in the run.

    ///
    [Pure] - public static T SetExportPackage(this T toolSettings, params string[] exportPackage) where T : UnitySettings + public static T SetTestCategories(this T toolSettings, params string[] testCategories) where T : UnityRunTestsSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.ExportPackageInternal = exportPackage.ToList(); + toolSettings.TestCategoriesInternal = testCategories.ToList(); return toolSettings; } /// - ///

    Sets to a new list

    - ///

    Export a package, given a path (or set of given paths).-exportPackage <exportAssetPath> <exportFileName> In this example exportAssetPath is a folder (relative to to the Unity project root) to export from the Unity project, and exportFileName is the package name. Currently, this option only exports whole folders at a time. You normally need to use this command with the -projectPath argument.

    + ///

    Sets to a new list

    + ///

    A list of test categories to include in the run, or a regular expression pattern to match category names. If using both TestFilters and TestCategories, then only tests that match both are run. This argument supports negation using '!'. If using '!MyCategory' then no tests with the 'MyCategory' category will be included in the run.

    ///
    [Pure] - public static T SetExportPackage(this T toolSettings, IEnumerable exportPackage) where T : UnitySettings + public static T SetTestCategories(this T toolSettings, IEnumerable testCategories) where T : UnityRunTestsSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.ExportPackageInternal = exportPackage.ToList(); + toolSettings.TestCategoriesInternal = testCategories.ToList(); return toolSettings; } /// - ///

    Adds values to

    - ///

    Export a package, given a path (or set of given paths).-exportPackage <exportAssetPath> <exportFileName> In this example exportAssetPath is a folder (relative to to the Unity project root) to export from the Unity project, and exportFileName is the package name. Currently, this option only exports whole folders at a time. You normally need to use this command with the -projectPath argument.

    + ///

    Adds values to

    + ///

    A list of test categories to include in the run, or a regular expression pattern to match category names. If using both TestFilters and TestCategories, then only tests that match both are run. This argument supports negation using '!'. If using '!MyCategory' then no tests with the 'MyCategory' category will be included in the run.

    ///
    [Pure] - public static T AddExportPackage(this T toolSettings, params string[] exportPackage) where T : UnitySettings + public static T AddTestCategories(this T toolSettings, params string[] testCategories) where T : UnityRunTestsSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.ExportPackageInternal.AddRange(exportPackage); + toolSettings.TestCategoriesInternal.AddRange(testCategories); return toolSettings; } /// - ///

    Adds values to

    - ///

    Export a package, given a path (or set of given paths).-exportPackage <exportAssetPath> <exportFileName> In this example exportAssetPath is a folder (relative to to the Unity project root) to export from the Unity project, and exportFileName is the package name. Currently, this option only exports whole folders at a time. You normally need to use this command with the -projectPath argument.

    + ///

    Adds values to

    + ///

    A list of test categories to include in the run, or a regular expression pattern to match category names. If using both TestFilters and TestCategories, then only tests that match both are run. This argument supports negation using '!'. If using '!MyCategory' then no tests with the 'MyCategory' category will be included in the run.

    ///
    [Pure] - public static T AddExportPackage(this T toolSettings, IEnumerable exportPackage) where T : UnitySettings + public static T AddTestCategories(this T toolSettings, IEnumerable testCategories) where T : UnityRunTestsSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.ExportPackageInternal.AddRange(exportPackage); + toolSettings.TestCategoriesInternal.AddRange(testCategories); return toolSettings; } /// - ///

    Clears

    - ///

    Export a package, given a path (or set of given paths).-exportPackage <exportAssetPath> <exportFileName> In this example exportAssetPath is a folder (relative to to the Unity project root) to export from the Unity project, and exportFileName is the package name. Currently, this option only exports whole folders at a time. You normally need to use this command with the -projectPath argument.

    + ///

    Clears

    + ///

    A list of test categories to include in the run, or a regular expression pattern to match category names. If using both TestFilters and TestCategories, then only tests that match both are run. This argument supports negation using '!'. If using '!MyCategory' then no tests with the 'MyCategory' category will be included in the run.

    ///
    [Pure] - public static T ClearExportPackage(this T toolSettings) where T : UnitySettings + public static T ClearTestCategories(this T toolSettings) where T : UnityRunTestsSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.ExportPackageInternal.Clear(); + toolSettings.TestCategoriesInternal.Clear(); return toolSettings; } /// - ///

    Removes values from

    - ///

    Export a package, given a path (or set of given paths).-exportPackage <exportAssetPath> <exportFileName> In this example exportAssetPath is a folder (relative to to the Unity project root) to export from the Unity project, and exportFileName is the package name. Currently, this option only exports whole folders at a time. You normally need to use this command with the -projectPath argument.

    + ///

    Removes values from

    + ///

    A list of test categories to include in the run, or a regular expression pattern to match category names. If using both TestFilters and TestCategories, then only tests that match both are run. This argument supports negation using '!'. If using '!MyCategory' then no tests with the 'MyCategory' category will be included in the run.

    ///
    [Pure] - public static T RemoveExportPackage(this T toolSettings, params string[] exportPackage) where T : UnitySettings + public static T RemoveTestCategories(this T toolSettings, params string[] testCategories) where T : UnityRunTestsSettings { toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(exportPackage); - toolSettings.ExportPackageInternal.RemoveAll(x => hashSet.Contains(x)); + var hashSet = new HashSet(testCategories); + toolSettings.TestCategoriesInternal.RemoveAll(x => hashSet.Contains(x)); return toolSettings; } /// - ///

    Removes values from

    - ///

    Export a package, given a path (or set of given paths).-exportPackage <exportAssetPath> <exportFileName> In this example exportAssetPath is a folder (relative to to the Unity project root) to export from the Unity project, and exportFileName is the package name. Currently, this option only exports whole folders at a time. You normally need to use this command with the -projectPath argument.

    + ///

    Removes values from

    + ///

    A list of test categories to include in the run, or a regular expression pattern to match category names. If using both TestFilters and TestCategories, then only tests that match both are run. This argument supports negation using '!'. If using '!MyCategory' then no tests with the 'MyCategory' category will be included in the run.

    ///
    [Pure] - public static T RemoveExportPackage(this T toolSettings, IEnumerable exportPackage) where T : UnitySettings + public static T RemoveTestCategories(this T toolSettings, IEnumerable testCategories) where T : UnityRunTestsSettings { toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(exportPackage); - toolSettings.ExportPackageInternal.RemoveAll(x => hashSet.Contains(x)); + var hashSet = new HashSet(testCategories); + toolSettings.TestCategoriesInternal.RemoveAll(x => hashSet.Contains(x)); return toolSettings; } #endregion - #region CustomArguments + #region TestFilters /// - ///

    Sets to a new list

    - ///

    Custom parameters. To pass parameters, add them to the command line and retrieve them inside the function using System.Environment.GetCommandLineArgs.

    + ///

    Sets to a new list

    + ///

    A list of test names to run, or a regular expression pattern to match tests by their full name. This argument supports negation using '!'. If using the test filter '!MyNamespace.Something.MyTest', then all tests except that test will be run. It is also possible to run a specific variation of a parameterized test like so: 'ClassName.MethodName(Param1,Param2)'.

    ///
    [Pure] - public static T SetCustomArguments(this T toolSettings, params string[] customArguments) where T : UnitySettings + public static T SetTestFilters(this T toolSettings, params string[] testFilters) where T : UnityRunTestsSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.CustomArgumentsInternal = customArguments.ToList(); + toolSettings.TestFiltersInternal = testFilters.ToList(); return toolSettings; } /// - ///

    Sets to a new list

    - ///

    Custom parameters. To pass parameters, add them to the command line and retrieve them inside the function using System.Environment.GetCommandLineArgs.

    + ///

    Sets to a new list

    + ///

    A list of test names to run, or a regular expression pattern to match tests by their full name. This argument supports negation using '!'. If using the test filter '!MyNamespace.Something.MyTest', then all tests except that test will be run. It is also possible to run a specific variation of a parameterized test like so: 'ClassName.MethodName(Param1,Param2)'.

    ///
    [Pure] - public static T SetCustomArguments(this T toolSettings, IEnumerable customArguments) where T : UnitySettings + public static T SetTestFilters(this T toolSettings, IEnumerable testFilters) where T : UnityRunTestsSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.CustomArgumentsInternal = customArguments.ToList(); + toolSettings.TestFiltersInternal = testFilters.ToList(); return toolSettings; } /// - ///

    Adds values to

    - ///

    Custom parameters. To pass parameters, add them to the command line and retrieve them inside the function using System.Environment.GetCommandLineArgs.

    + ///

    Adds values to

    + ///

    A list of test names to run, or a regular expression pattern to match tests by their full name. This argument supports negation using '!'. If using the test filter '!MyNamespace.Something.MyTest', then all tests except that test will be run. It is also possible to run a specific variation of a parameterized test like so: 'ClassName.MethodName(Param1,Param2)'.

    ///
    [Pure] - public static T AddCustomArguments(this T toolSettings, params string[] customArguments) where T : UnitySettings + public static T AddTestFilters(this T toolSettings, params string[] testFilters) where T : UnityRunTestsSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.CustomArgumentsInternal.AddRange(customArguments); + toolSettings.TestFiltersInternal.AddRange(testFilters); return toolSettings; } /// - ///

    Adds values to

    - ///

    Custom parameters. To pass parameters, add them to the command line and retrieve them inside the function using System.Environment.GetCommandLineArgs.

    + ///

    Adds values to

    + ///

    A list of test names to run, or a regular expression pattern to match tests by their full name. This argument supports negation using '!'. If using the test filter '!MyNamespace.Something.MyTest', then all tests except that test will be run. It is also possible to run a specific variation of a parameterized test like so: 'ClassName.MethodName(Param1,Param2)'.

    ///
    [Pure] - public static T AddCustomArguments(this T toolSettings, IEnumerable customArguments) where T : UnitySettings + public static T AddTestFilters(this T toolSettings, IEnumerable testFilters) where T : UnityRunTestsSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.CustomArgumentsInternal.AddRange(customArguments); + toolSettings.TestFiltersInternal.AddRange(testFilters); return toolSettings; } /// - ///

    Clears

    - ///

    Custom parameters. To pass parameters, add them to the command line and retrieve them inside the function using System.Environment.GetCommandLineArgs.

    + ///

    Clears

    + ///

    A list of test names to run, or a regular expression pattern to match tests by their full name. This argument supports negation using '!'. If using the test filter '!MyNamespace.Something.MyTest', then all tests except that test will be run. It is also possible to run a specific variation of a parameterized test like so: 'ClassName.MethodName(Param1,Param2)'.

    ///
    [Pure] - public static T ClearCustomArguments(this T toolSettings) where T : UnitySettings + public static T ClearTestFilters(this T toolSettings) where T : UnityRunTestsSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.CustomArgumentsInternal.Clear(); + toolSettings.TestFiltersInternal.Clear(); return toolSettings; } /// - ///

    Removes values from

    - ///

    Custom parameters. To pass parameters, add them to the command line and retrieve them inside the function using System.Environment.GetCommandLineArgs.

    + ///

    Removes values from

    + ///

    A list of test names to run, or a regular expression pattern to match tests by their full name. This argument supports negation using '!'. If using the test filter '!MyNamespace.Something.MyTest', then all tests except that test will be run. It is also possible to run a specific variation of a parameterized test like so: 'ClassName.MethodName(Param1,Param2)'.

    ///
    [Pure] - public static T RemoveCustomArguments(this T toolSettings, params string[] customArguments) where T : UnitySettings + public static T RemoveTestFilters(this T toolSettings, params string[] testFilters) where T : UnityRunTestsSettings { toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(customArguments); - toolSettings.CustomArgumentsInternal.RemoveAll(x => hashSet.Contains(x)); + var hashSet = new HashSet(testFilters); + toolSettings.TestFiltersInternal.RemoveAll(x => hashSet.Contains(x)); return toolSettings; } /// - ///

    Removes values from

    - ///

    Custom parameters. To pass parameters, add them to the command line and retrieve them inside the function using System.Environment.GetCommandLineArgs.

    + ///

    Removes values from

    + ///

    A list of test names to run, or a regular expression pattern to match tests by their full name. This argument supports negation using '!'. If using the test filter '!MyNamespace.Something.MyTest', then all tests except that test will be run. It is also possible to run a specific variation of a parameterized test like so: 'ClassName.MethodName(Param1,Param2)'.

    ///
    [Pure] - public static T RemoveCustomArguments(this T toolSettings, IEnumerable customArguments) where T : UnitySettings + public static T RemoveTestFilters(this T toolSettings, IEnumerable testFilters) where T : UnityRunTestsSettings { toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(customArguments); - toolSettings.CustomArgumentsInternal.RemoveAll(x => hashSet.Contains(x)); + var hashSet = new HashSet(testFilters); + toolSettings.TestFiltersInternal.RemoveAll(x => hashSet.Contains(x)); return toolSettings; } #endregion - #region StackTraceLogType + #region TestResultFile /// - ///

    Sets

    - ///

    Detailed debugging feature. StackTraceLogging allows you to allow detailed logging.

    + ///

    Sets

    + ///

    Path where the result file should be placed. If the path is a folder, a default file name is used. If not specified, the results are placed in the project's root folder.

    ///
    [Pure] - public static T SetStackTraceLogType(this T toolSettings, UnityStackTraceLogType stackTraceLogType) where T : UnitySettings + public static T SetTestResultFile(this T toolSettings, string testResultFile) where T : UnityRunTestsSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.StackTraceLogType = stackTraceLogType; + toolSettings.TestResultFile = testResultFile; return toolSettings; } /// - ///

    Resets

    - ///

    Detailed debugging feature. StackTraceLogging allows you to allow detailed logging.

    + ///

    Resets

    + ///

    Path where the result file should be placed. If the path is a folder, a default file name is used. If not specified, the results are placed in the project's root folder.

    ///
    [Pure] - public static T ResetStackTraceLogType(this T toolSettings) where T : UnitySettings + public static T ResetTestResultFile(this T toolSettings) where T : UnityRunTestsSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.StackTraceLogType = null; + toolSettings.TestResultFile = null; return toolSettings; } #endregion - #region ProjectPath + #region TestPlatform /// - ///

    Sets

    - ///

    Specify the path of the unity project.

    + ///

    Sets

    + ///

    The platform to run tests on.

    ///
    [Pure] - public static T SetProjectPath(this T toolSettings, string projectPath) where T : UnitySettings + public static T SetTestPlatform(this T toolSettings, string testPlatform) where T : UnityRunTestsSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.ProjectPath = projectPath; + toolSettings.TestPlatform = testPlatform; return toolSettings; } /// - ///

    Resets

    - ///

    Specify the path of the unity project.

    + ///

    Resets

    + ///

    The platform to run tests on.

    ///
    [Pure] - public static T ResetProjectPath(this T toolSettings) where T : UnitySettings + public static T ResetTestPlatform(this T toolSettings) where T : UnityRunTestsSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.ProjectPath = null; + toolSettings.TestPlatform = null; return toolSettings; } #endregion #region Username /// - ///

    Sets

    + ///

    Sets

    ///

    Enter a username into the log-in form during activation of the Unity Editor.

    ///
    [Pure] - public static T SetUsername(this T toolSettings, string username) where T : UnitySettings + public static T SetUsername(this T toolSettings, string username) where T : UnityRunTestsSettings { toolSettings = toolSettings.NewInstance(); toolSettings.Username = username; return toolSettings; } /// - ///

    Resets

    + ///

    Resets

    ///

    Enter a username into the log-in form during activation of the Unity Editor.

    ///
    [Pure] - public static T ResetUsername(this T toolSettings) where T : UnitySettings + public static T ResetUsername(this T toolSettings) where T : UnityRunTestsSettings { toolSettings = toolSettings.NewInstance(); toolSettings.Username = null; @@ -2990,783 +3068,1350 @@ public static T ResetUsername(this T toolSettings) where T : UnitySettings #endregion #region Password /// - ///

    Sets

    + ///

    Sets

    + ///

    Enter a password into the log-in form during activation of the Unity Editor.

    + ///
    + [Pure] + public static T SetPassword(this T toolSettings, [Secret] string password) where T : UnityRunTestsSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.Password = password; + return toolSettings; + } + /// + ///

    Resets

    ///

    Enter a password into the log-in form during activation of the Unity Editor.

    ///
    [Pure] - public static T SetPassword(this T toolSettings, [Secret] string password) where T : UnitySettings + public static T ResetPassword(this T toolSettings) where T : UnityRunTestsSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.Password = null; + return toolSettings; + } + #endregion + #region Serial + /// + ///

    Sets

    + ///

    Activate Unity with the specified serial key. It is good practice to pass the -batchmode and -quit arguments as well, in order to quit Unity when done, if using this for automated activation of Unity. Please allow a few seconds before the license file is created, because Unity needs to communicate with the license server. Make sure that license file folder exists, and has appropriate permissions before running Unity with this argument. If activation fails, see the Editor.log for info.

    + ///
    + [Pure] + public static T SetSerial(this T toolSettings, [Secret] string serial) where T : UnityRunTestsSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.Serial = serial; + return toolSettings; + } + /// + ///

    Resets

    + ///

    Activate Unity with the specified serial key. It is good practice to pass the -batchmode and -quit arguments as well, in order to quit Unity when done, if using this for automated activation of Unity. Please allow a few seconds before the license file is created, because Unity needs to communicate with the license server. Make sure that license file folder exists, and has appropriate permissions before running Unity with this argument. If activation fails, see the Editor.log for info.

    + ///
    + [Pure] + public static T ResetSerial(this T toolSettings) where T : UnityRunTestsSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.Serial = null; + return toolSettings; + } + #endregion + #region BatchMode + /// + ///

    Sets

    + ///

    Run Unity in batch mode. This should always be used in conjunction with the other command line arguments, because it ensures no pop-up windows appear and eliminates the need for any human intervention. When an exception occurs during execution of the script code, the Asset server updates fail, or other operations that fail, Unity immediately exits with return code 1.Note that in batch mode, Unity sends a minimal version of its log output to the console. However, the Log Files still contain the full log information. Opening a project in batch mode while the Editor has the same project open is not supported; only a single instance of Unity can run at a time.

    + ///
    + [Pure] + public static T SetBatchMode(this T toolSettings, bool? batchMode) where T : UnityRunTestsSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.BatchMode = batchMode; + return toolSettings; + } + /// + ///

    Resets

    + ///

    Run Unity in batch mode. This should always be used in conjunction with the other command line arguments, because it ensures no pop-up windows appear and eliminates the need for any human intervention. When an exception occurs during execution of the script code, the Asset server updates fail, or other operations that fail, Unity immediately exits with return code 1.Note that in batch mode, Unity sends a minimal version of its log output to the console. However, the Log Files still contain the full log information. Opening a project in batch mode while the Editor has the same project open is not supported; only a single instance of Unity can run at a time.

    + ///
    + [Pure] + public static T ResetBatchMode(this T toolSettings) where T : UnityRunTestsSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.BatchMode = null; + return toolSettings; + } + /// + ///

    Enables

    + ///

    Run Unity in batch mode. This should always be used in conjunction with the other command line arguments, because it ensures no pop-up windows appear and eliminates the need for any human intervention. When an exception occurs during execution of the script code, the Asset server updates fail, or other operations that fail, Unity immediately exits with return code 1.Note that in batch mode, Unity sends a minimal version of its log output to the console. However, the Log Files still contain the full log information. Opening a project in batch mode while the Editor has the same project open is not supported; only a single instance of Unity can run at a time.

    + ///
    + [Pure] + public static T EnableBatchMode(this T toolSettings) where T : UnityRunTestsSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.BatchMode = true; + return toolSettings; + } + /// + ///

    Disables

    + ///

    Run Unity in batch mode. This should always be used in conjunction with the other command line arguments, because it ensures no pop-up windows appear and eliminates the need for any human intervention. When an exception occurs during execution of the script code, the Asset server updates fail, or other operations that fail, Unity immediately exits with return code 1.Note that in batch mode, Unity sends a minimal version of its log output to the console. However, the Log Files still contain the full log information. Opening a project in batch mode while the Editor has the same project open is not supported; only a single instance of Unity can run at a time.

    + ///
    + [Pure] + public static T DisableBatchMode(this T toolSettings) where T : UnityRunTestsSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.BatchMode = false; + return toolSettings; + } + /// + ///

    Toggles

    + ///

    Run Unity in batch mode. This should always be used in conjunction with the other command line arguments, because it ensures no pop-up windows appear and eliminates the need for any human intervention. When an exception occurs during execution of the script code, the Asset server updates fail, or other operations that fail, Unity immediately exits with return code 1.Note that in batch mode, Unity sends a minimal version of its log output to the console. However, the Log Files still contain the full log information. Opening a project in batch mode while the Editor has the same project open is not supported; only a single instance of Unity can run at a time.

    + ///
    + [Pure] + public static T ToggleBatchMode(this T toolSettings) where T : UnityRunTestsSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.BatchMode = !toolSettings.BatchMode; + return toolSettings; + } + #endregion + #region SilentCrashes + /// + ///

    Sets

    + ///

    Don't display a crash dialog.

    + ///
    + [Pure] + public static T SetSilentCrashes(this T toolSettings, bool? silentCrashes) where T : UnityRunTestsSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.SilentCrashes = silentCrashes; + return toolSettings; + } + /// + ///

    Resets

    + ///

    Don't display a crash dialog.

    + ///
    + [Pure] + public static T ResetSilentCrashes(this T toolSettings) where T : UnityRunTestsSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.SilentCrashes = null; + return toolSettings; + } + /// + ///

    Enables

    + ///

    Don't display a crash dialog.

    + ///
    + [Pure] + public static T EnableSilentCrashes(this T toolSettings) where T : UnityRunTestsSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.SilentCrashes = true; + return toolSettings; + } + /// + ///

    Disables

    + ///

    Don't display a crash dialog.

    + ///
    + [Pure] + public static T DisableSilentCrashes(this T toolSettings) where T : UnityRunTestsSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.SilentCrashes = false; + return toolSettings; + } + /// + ///

    Toggles

    + ///

    Don't display a crash dialog.

    + ///
    + [Pure] + public static T ToggleSilentCrashes(this T toolSettings) where T : UnityRunTestsSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.SilentCrashes = !toolSettings.SilentCrashes; + return toolSettings; + } + #endregion + #region NoGraphics + /// + ///

    Sets

    + ///

    When running in batch mode, do not initialize the graphics device at all. This makes it possible to run your automated workflows on machines that don't even have a GPU (automated workflows only work when you have a window in focus, otherwise you can't send simulated input commands). Please note that -nographics does not allow you to bake GI on OSX, since Enlighten requires GPU acceleration.

    + ///
    + [Pure] + public static T SetNoGraphics(this T toolSettings, bool? noGraphics) where T : UnityRunTestsSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.NoGraphics = noGraphics; + return toolSettings; + } + /// + ///

    Resets

    + ///

    When running in batch mode, do not initialize the graphics device at all. This makes it possible to run your automated workflows on machines that don't even have a GPU (automated workflows only work when you have a window in focus, otherwise you can't send simulated input commands). Please note that -nographics does not allow you to bake GI on OSX, since Enlighten requires GPU acceleration.

    + ///
    + [Pure] + public static T ResetNoGraphics(this T toolSettings) where T : UnityRunTestsSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.NoGraphics = null; + return toolSettings; + } + /// + ///

    Enables

    + ///

    When running in batch mode, do not initialize the graphics device at all. This makes it possible to run your automated workflows on machines that don't even have a GPU (automated workflows only work when you have a window in focus, otherwise you can't send simulated input commands). Please note that -nographics does not allow you to bake GI on OSX, since Enlighten requires GPU acceleration.

    + ///
    + [Pure] + public static T EnableNoGraphics(this T toolSettings) where T : UnityRunTestsSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.NoGraphics = true; + return toolSettings; + } + /// + ///

    Disables

    + ///

    When running in batch mode, do not initialize the graphics device at all. This makes it possible to run your automated workflows on machines that don't even have a GPU (automated workflows only work when you have a window in focus, otherwise you can't send simulated input commands). Please note that -nographics does not allow you to bake GI on OSX, since Enlighten requires GPU acceleration.

    + ///
    + [Pure] + public static T DisableNoGraphics(this T toolSettings) where T : UnityRunTestsSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.NoGraphics = false; + return toolSettings; + } + /// + ///

    Toggles

    + ///

    When running in batch mode, do not initialize the graphics device at all. This makes it possible to run your automated workflows on machines that don't even have a GPU (automated workflows only work when you have a window in focus, otherwise you can't send simulated input commands). Please note that -nographics does not allow you to bake GI on OSX, since Enlighten requires GPU acceleration.

    + ///
    + [Pure] + public static T ToggleNoGraphics(this T toolSettings) where T : UnityRunTestsSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.NoGraphics = !toolSettings.NoGraphics; + return toolSettings; + } + #endregion + #region Quit + /// + ///

    Sets

    + ///

    Quit the Unity Editor after other commands have finished executing. Note that this can cause error messages to be hidden (however, they still appear in the Editor.log file).

    + ///
    + [Pure] + public static T SetQuit(this T toolSettings, bool? quit) where T : UnityRunTestsSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.Quit = quit; + return toolSettings; + } + /// + ///

    Resets

    + ///

    Quit the Unity Editor after other commands have finished executing. Note that this can cause error messages to be hidden (however, they still appear in the Editor.log file).

    + ///
    + [Pure] + public static T ResetQuit(this T toolSettings) where T : UnityRunTestsSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.Quit = null; + return toolSettings; + } + /// + ///

    Enables

    + ///

    Quit the Unity Editor after other commands have finished executing. Note that this can cause error messages to be hidden (however, they still appear in the Editor.log file).

    + ///
    + [Pure] + public static T EnableQuit(this T toolSettings) where T : UnityRunTestsSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.Quit = true; + return toolSettings; + } + /// + ///

    Disables

    + ///

    Quit the Unity Editor after other commands have finished executing. Note that this can cause error messages to be hidden (however, they still appear in the Editor.log file).

    + ///
    + [Pure] + public static T DisableQuit(this T toolSettings) where T : UnityRunTestsSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.Quit = false; + return toolSettings; + } + /// + ///

    Toggles

    + ///

    Quit the Unity Editor after other commands have finished executing. Note that this can cause error messages to be hidden (however, they still appear in the Editor.log file).

    + ///
    + [Pure] + public static T ToggleQuit(this T toolSettings) where T : UnityRunTestsSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.Quit = !toolSettings.Quit; + return toolSettings; + } + #endregion +} +#endregion +#region UnityBaseSettingsExtensions +/// +/// Used within . +/// +[PublicAPI] +[ExcludeFromCodeCoverage] +public static partial class UnityBaseSettingsExtensions +{ + #region LogFile + /// + ///

    Sets

    + ///

    Specify where the Editor or Windows/Linux/OSX standalone log file are written.

    + ///
    + [Pure] + public static T SetLogFile(this T toolSettings, string logFile) where T : UnityBaseSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.LogFile = logFile; + return toolSettings; + } + /// + ///

    Resets

    + ///

    Specify where the Editor or Windows/Linux/OSX standalone log file are written.

    + ///
    + [Pure] + public static T ResetLogFile(this T toolSettings) where T : UnityBaseSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.LogFile = null; + return toolSettings; + } + #endregion + #region MinimalOutput + /// + ///

    Sets

    + ///

    (experimental) If set to true only warnings and errors will be printed to the output.

    + ///
    + [Pure] + public static T SetMinimalOutput(this T toolSettings, bool? minimalOutput) where T : UnityBaseSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.MinimalOutput = minimalOutput; + return toolSettings; + } + /// + ///

    Resets

    + ///

    (experimental) If set to true only warnings and errors will be printed to the output.

    + ///
    + [Pure] + public static T ResetMinimalOutput(this T toolSettings) where T : UnityBaseSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.MinimalOutput = null; + return toolSettings; + } + /// + ///

    Enables

    + ///

    (experimental) If set to true only warnings and errors will be printed to the output.

    + ///
    + [Pure] + public static T EnableMinimalOutput(this T toolSettings) where T : UnityBaseSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.MinimalOutput = true; + return toolSettings; + } + /// + ///

    Disables

    + ///

    (experimental) If set to true only warnings and errors will be printed to the output.

    + ///
    + [Pure] + public static T DisableMinimalOutput(this T toolSettings) where T : UnityBaseSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.MinimalOutput = false; + return toolSettings; + } + /// + ///

    Toggles

    + ///

    (experimental) If set to true only warnings and errors will be printed to the output.

    + ///
    + [Pure] + public static T ToggleMinimalOutput(this T toolSettings) where T : UnityBaseSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.MinimalOutput = !toolSettings.MinimalOutput; + return toolSettings; + } + #endregion + #region StableExitCodes + /// + ///

    Sets to a new list

    + ///

    Define exit codes which will not fail the build.

    + ///
    + [Pure] + public static T SetStableExitCodes(this T toolSettings, params int[] stableExitCodes) where T : UnityBaseSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.StableExitCodesInternal = stableExitCodes.ToList(); + return toolSettings; + } + /// + ///

    Sets to a new list

    + ///

    Define exit codes which will not fail the build.

    + ///
    + [Pure] + public static T SetStableExitCodes(this T toolSettings, IEnumerable stableExitCodes) where T : UnityBaseSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.StableExitCodesInternal = stableExitCodes.ToList(); + return toolSettings; + } + /// + ///

    Adds values to

    + ///

    Define exit codes which will not fail the build.

    + ///
    + [Pure] + public static T AddStableExitCodes(this T toolSettings, params int[] stableExitCodes) where T : UnityBaseSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.StableExitCodesInternal.AddRange(stableExitCodes); + return toolSettings; + } + /// + ///

    Adds values to

    + ///

    Define exit codes which will not fail the build.

    + ///
    + [Pure] + public static T AddStableExitCodes(this T toolSettings, IEnumerable stableExitCodes) where T : UnityBaseSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.StableExitCodesInternal.AddRange(stableExitCodes); + return toolSettings; + } + /// + ///

    Clears

    + ///

    Define exit codes which will not fail the build.

    + ///
    + [Pure] + public static T ClearStableExitCodes(this T toolSettings) where T : UnityBaseSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.StableExitCodesInternal.Clear(); + return toolSettings; + } + /// + ///

    Removes values from

    + ///

    Define exit codes which will not fail the build.

    + ///
    + [Pure] + public static T RemoveStableExitCodes(this T toolSettings, params int[] stableExitCodes) where T : UnityBaseSettings + { + toolSettings = toolSettings.NewInstance(); + var hashSet = new HashSet(stableExitCodes); + toolSettings.StableExitCodesInternal.RemoveAll(x => hashSet.Contains(x)); + return toolSettings; + } + /// + ///

    Removes values from

    + ///

    Define exit codes which will not fail the build.

    + ///
    + [Pure] + public static T RemoveStableExitCodes(this T toolSettings, IEnumerable stableExitCodes) where T : UnityBaseSettings + { + toolSettings = toolSettings.NewInstance(); + var hashSet = new HashSet(stableExitCodes); + toolSettings.StableExitCodesInternal.RemoveAll(x => hashSet.Contains(x)); + return toolSettings; + } + #endregion + #region HubVersion + /// + ///

    Sets

    + ///

    Defines the Unity version to use. The version must be installed via Unity Hub.

    + ///
    + [Pure] + public static T SetHubVersion(this T toolSettings, string hubVersion) where T : UnityBaseSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.HubVersion = hubVersion; + return toolSettings; + } + /// + ///

    Resets

    + ///

    Defines the Unity version to use. The version must be installed via Unity Hub.

    + ///
    + [Pure] + public static T ResetHubVersion(this T toolSettings) where T : UnityBaseSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.HubVersion = null; + return toolSettings; + } + #endregion +} +#endregion +#region UnityProjectSettingsExtensions +/// +/// Used within . +/// +[PublicAPI] +[ExcludeFromCodeCoverage] +public static partial class UnityProjectSettingsExtensions +{ + #region AssetServerUpdate + /// + ///

    Sets

    + ///

    Force an update of the project in the Asset Server given by IP:port. The port is optional, and if not given it is assumed to be the standard one (10733). It is advisable to use this command in conjunction with the -projectPath argument to ensure you are working with the correct project. If no project name is given, then the last project opened by Unity is used. If no project exists at the path given by -projectPath, then one is created automatically.

    + ///
    + [Pure] + public static T SetAssetServerUpdate(this T toolSettings, string assetServerUpdate) where T : UnityProjectSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.AssetServerUpdate = assetServerUpdate; + return toolSettings; + } + /// + ///

    Resets

    + ///

    Force an update of the project in the Asset Server given by IP:port. The port is optional, and if not given it is assumed to be the standard one (10733). It is advisable to use this command in conjunction with the -projectPath argument to ensure you are working with the correct project. If no project name is given, then the last project opened by Unity is used. If no project exists at the path given by -projectPath, then one is created automatically.

    + ///
    + [Pure] + public static T ResetAssetServerUpdate(this T toolSettings) where T : UnityProjectSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.AssetServerUpdate = null; + return toolSettings; + } + #endregion + #region BuildTarget + /// + ///

    Sets

    + ///

    Allows the selection of an active build target before a project is loaded.

    + ///
    + [Pure] + public static T SetBuildTarget(this T toolSettings, string buildTarget) where T : UnityProjectSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.BuildTarget = buildTarget; + return toolSettings; + } + /// + ///

    Resets

    + ///

    Allows the selection of an active build target before a project is loaded.

    + ///
    + [Pure] + public static T ResetBuildTarget(this T toolSettings) where T : UnityProjectSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.BuildTarget = null; + return toolSettings; + } + #endregion + #region ForceD3d11 + /// + ///

    Sets

    + ///

    (Windows only) Make the Editor use Direct3D 11 for rendering. Normally the graphics API depends on player settings (typically defaults to D3D11).

    + ///
    + [Pure] + public static T SetForceD3d11(this T toolSettings, bool? forceD3d11) where T : UnityProjectSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.ForceD3d11 = forceD3d11; + return toolSettings; + } + /// + ///

    Resets

    + ///

    (Windows only) Make the Editor use Direct3D 11 for rendering. Normally the graphics API depends on player settings (typically defaults to D3D11).

    + ///
    + [Pure] + public static T ResetForceD3d11(this T toolSettings) where T : UnityProjectSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.ForceD3d11 = null; + return toolSettings; + } + /// + ///

    Enables

    + ///

    (Windows only) Make the Editor use Direct3D 11 for rendering. Normally the graphics API depends on player settings (typically defaults to D3D11).

    + ///
    + [Pure] + public static T EnableForceD3d11(this T toolSettings) where T : UnityProjectSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.ForceD3d11 = true; + return toolSettings; + } + /// + ///

    Disables

    + ///

    (Windows only) Make the Editor use Direct3D 11 for rendering. Normally the graphics API depends on player settings (typically defaults to D3D11).

    + ///
    + [Pure] + public static T DisableForceD3d11(this T toolSettings) where T : UnityProjectSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.ForceD3d11 = false; + return toolSettings; + } + /// + ///

    Toggles

    + ///

    (Windows only) Make the Editor use Direct3D 11 for rendering. Normally the graphics API depends on player settings (typically defaults to D3D11).

    + ///
    + [Pure] + public static T ToggleForceD3d11(this T toolSettings) where T : UnityProjectSettings + { + toolSettings = toolSettings.NewInstance(); + toolSettings.ForceD3d11 = !toolSettings.ForceD3d11; + return toolSettings; + } + #endregion + #region ForceDeviceIndex + /// + ///

    Sets

    + ///

    (macOS only) When using Metal, make the Editor use a particular GPU device by passing it the index of that GPU.

    + ///
    + [Pure] + public static T SetForceDeviceIndex(this T toolSettings, bool? forceDeviceIndex) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.Password = password; + toolSettings.ForceDeviceIndex = forceDeviceIndex; return toolSettings; } /// - ///

    Resets

    - ///

    Enter a password into the log-in form during activation of the Unity Editor.

    + ///

    Resets

    + ///

    (macOS only) When using Metal, make the Editor use a particular GPU device by passing it the index of that GPU.

    ///
    [Pure] - public static T ResetPassword(this T toolSettings) where T : UnitySettings + public static T ResetForceDeviceIndex(this T toolSettings) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.Password = null; + toolSettings.ForceDeviceIndex = null; return toolSettings; } - #endregion - #region Serial /// - ///

    Sets

    - ///

    Activate Unity with the specified serial key. It is good practice to pass the -batchmode and -quit arguments as well, in order to quit Unity when done, if using this for automated activation of Unity. Please allow a few seconds before the license file is created, because Unity needs to communicate with the license server. Make sure that license file folder exists, and has appropriate permissions before running Unity with this argument. If activation fails, see the Editor.log for info.

    + ///

    Enables

    + ///

    (macOS only) When using Metal, make the Editor use a particular GPU device by passing it the index of that GPU.

    ///
    [Pure] - public static T SetSerial(this T toolSettings, [Secret] string serial) where T : UnitySettings + public static T EnableForceDeviceIndex(this T toolSettings) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.Serial = serial; + toolSettings.ForceDeviceIndex = true; return toolSettings; } /// - ///

    Resets

    - ///

    Activate Unity with the specified serial key. It is good practice to pass the -batchmode and -quit arguments as well, in order to quit Unity when done, if using this for automated activation of Unity. Please allow a few seconds before the license file is created, because Unity needs to communicate with the license server. Make sure that license file folder exists, and has appropriate permissions before running Unity with this argument. If activation fails, see the Editor.log for info.

    + ///

    Disables

    + ///

    (macOS only) When using Metal, make the Editor use a particular GPU device by passing it the index of that GPU.

    ///
    [Pure] - public static T ResetSerial(this T toolSettings) where T : UnitySettings + public static T DisableForceDeviceIndex(this T toolSettings) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.Serial = null; + toolSettings.ForceDeviceIndex = false; return toolSettings; } - #endregion - #region BatchMode /// - ///

    Sets

    - ///

    Run Unity in batch mode. This should always be used in conjunction with the other command line arguments, because it ensures no pop-up windows appear and eliminates the need for any human intervention. When an exception occurs during execution of the script code, the Asset server updates fail, or other operations that fail, Unity immediately exits with return code 1.Note that in batch mode, Unity sends a minimal version of its log output to the console. However, the Log Files still contain the full log information. Opening a project in batch mode while the Editor has the same project open is not supported; only a single instance of Unity can run at a time.

    + ///

    Toggles

    + ///

    (macOS only) When using Metal, make the Editor use a particular GPU device by passing it the index of that GPU.

    ///
    [Pure] - public static T SetBatchMode(this T toolSettings, bool? batchMode) where T : UnitySettings + public static T ToggleForceDeviceIndex(this T toolSettings) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.BatchMode = batchMode; + toolSettings.ForceDeviceIndex = !toolSettings.ForceDeviceIndex; return toolSettings; } + #endregion + #region ForceGfxMetal /// - ///

    Resets

    - ///

    Run Unity in batch mode. This should always be used in conjunction with the other command line arguments, because it ensures no pop-up windows appear and eliminates the need for any human intervention. When an exception occurs during execution of the script code, the Asset server updates fail, or other operations that fail, Unity immediately exits with return code 1.Note that in batch mode, Unity sends a minimal version of its log output to the console. However, the Log Files still contain the full log information. Opening a project in batch mode while the Editor has the same project open is not supported; only a single instance of Unity can run at a time.

    + ///

    Sets

    + ///

    (macOS only) Make the Editor use Metal as the default graphics API.

    ///
    [Pure] - public static T ResetBatchMode(this T toolSettings) where T : UnitySettings + public static T SetForceGfxMetal(this T toolSettings, bool? forceGfxMetal) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.BatchMode = null; + toolSettings.ForceGfxMetal = forceGfxMetal; return toolSettings; } /// - ///

    Enables

    - ///

    Run Unity in batch mode. This should always be used in conjunction with the other command line arguments, because it ensures no pop-up windows appear and eliminates the need for any human intervention. When an exception occurs during execution of the script code, the Asset server updates fail, or other operations that fail, Unity immediately exits with return code 1.Note that in batch mode, Unity sends a minimal version of its log output to the console. However, the Log Files still contain the full log information. Opening a project in batch mode while the Editor has the same project open is not supported; only a single instance of Unity can run at a time.

    + ///

    Resets

    + ///

    (macOS only) Make the Editor use Metal as the default graphics API.

    ///
    [Pure] - public static T EnableBatchMode(this T toolSettings) where T : UnitySettings + public static T ResetForceGfxMetal(this T toolSettings) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.BatchMode = true; + toolSettings.ForceGfxMetal = null; return toolSettings; } /// - ///

    Disables

    - ///

    Run Unity in batch mode. This should always be used in conjunction with the other command line arguments, because it ensures no pop-up windows appear and eliminates the need for any human intervention. When an exception occurs during execution of the script code, the Asset server updates fail, or other operations that fail, Unity immediately exits with return code 1.Note that in batch mode, Unity sends a minimal version of its log output to the console. However, the Log Files still contain the full log information. Opening a project in batch mode while the Editor has the same project open is not supported; only a single instance of Unity can run at a time.

    + ///

    Enables

    + ///

    (macOS only) Make the Editor use Metal as the default graphics API.

    ///
    [Pure] - public static T DisableBatchMode(this T toolSettings) where T : UnitySettings + public static T EnableForceGfxMetal(this T toolSettings) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.BatchMode = false; + toolSettings.ForceGfxMetal = true; return toolSettings; } /// - ///

    Toggles

    - ///

    Run Unity in batch mode. This should always be used in conjunction with the other command line arguments, because it ensures no pop-up windows appear and eliminates the need for any human intervention. When an exception occurs during execution of the script code, the Asset server updates fail, or other operations that fail, Unity immediately exits with return code 1.Note that in batch mode, Unity sends a minimal version of its log output to the console. However, the Log Files still contain the full log information. Opening a project in batch mode while the Editor has the same project open is not supported; only a single instance of Unity can run at a time.

    + ///

    Disables

    + ///

    (macOS only) Make the Editor use Metal as the default graphics API.

    ///
    [Pure] - public static T ToggleBatchMode(this T toolSettings) where T : UnitySettings + public static T DisableForceGfxMetal(this T toolSettings) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.BatchMode = !toolSettings.BatchMode; + toolSettings.ForceGfxMetal = false; return toolSettings; } - #endregion - #region SilentCrashes /// - ///

    Sets

    - ///

    Don't display a crash dialog.

    + ///

    Toggles

    + ///

    (macOS only) Make the Editor use Metal as the default graphics API.

    ///
    [Pure] - public static T SetSilentCrashes(this T toolSettings, bool? silentCrashes) where T : UnitySettings + public static T ToggleForceGfxMetal(this T toolSettings) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.SilentCrashes = silentCrashes; + toolSettings.ForceGfxMetal = !toolSettings.ForceGfxMetal; return toolSettings; } + #endregion + #region ForceGLCore /// - ///

    Resets

    - ///

    Don't display a crash dialog.

    + ///

    Sets

    + ///

    (Windows only) Make the Editor use OpenGL 3/4 core profile for rendering. The Editor tries to use the best OpenGL version available and all OpenGL extensions exposed by the OpenGL drivers. If the platform isn't supported, Direct3D is used.

    ///
    [Pure] - public static T ResetSilentCrashes(this T toolSettings) where T : UnitySettings + public static T SetForceGLCore(this T toolSettings, bool? forceGLCore) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.SilentCrashes = null; + toolSettings.ForceGLCore = forceGLCore; return toolSettings; } /// - ///

    Enables

    - ///

    Don't display a crash dialog.

    + ///

    Resets

    + ///

    (Windows only) Make the Editor use OpenGL 3/4 core profile for rendering. The Editor tries to use the best OpenGL version available and all OpenGL extensions exposed by the OpenGL drivers. If the platform isn't supported, Direct3D is used.

    ///
    [Pure] - public static T EnableSilentCrashes(this T toolSettings) where T : UnitySettings + public static T ResetForceGLCore(this T toolSettings) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.SilentCrashes = true; + toolSettings.ForceGLCore = null; return toolSettings; } /// - ///

    Disables

    - ///

    Don't display a crash dialog.

    + ///

    Enables

    + ///

    (Windows only) Make the Editor use OpenGL 3/4 core profile for rendering. The Editor tries to use the best OpenGL version available and all OpenGL extensions exposed by the OpenGL drivers. If the platform isn't supported, Direct3D is used.

    ///
    [Pure] - public static T DisableSilentCrashes(this T toolSettings) where T : UnitySettings + public static T EnableForceGLCore(this T toolSettings) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.SilentCrashes = false; + toolSettings.ForceGLCore = true; return toolSettings; } /// - ///

    Toggles

    - ///

    Don't display a crash dialog.

    + ///

    Disables

    + ///

    (Windows only) Make the Editor use OpenGL 3/4 core profile for rendering. The Editor tries to use the best OpenGL version available and all OpenGL extensions exposed by the OpenGL drivers. If the platform isn't supported, Direct3D is used.

    ///
    [Pure] - public static T ToggleSilentCrashes(this T toolSettings) where T : UnitySettings + public static T DisableForceGLCore(this T toolSettings) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.SilentCrashes = !toolSettings.SilentCrashes; + toolSettings.ForceGLCore = false; return toolSettings; } - #endregion - #region NoGraphics /// - ///

    Sets

    - ///

    When running in batch mode, do not initialize the graphics device at all. This makes it possible to run your automated workflows on machines that don't even have a GPU (automated workflows only work when you have a window in focus, otherwise you can't send simulated input commands). Please note that -nographics does not allow you to bake GI on OSX, since Enlighten requires GPU acceleration.

    + ///

    Toggles

    + ///

    (Windows only) Make the Editor use OpenGL 3/4 core profile for rendering. The Editor tries to use the best OpenGL version available and all OpenGL extensions exposed by the OpenGL drivers. If the platform isn't supported, Direct3D is used.

    ///
    [Pure] - public static T SetNoGraphics(this T toolSettings, bool? noGraphics) where T : UnitySettings + public static T ToggleForceGLCore(this T toolSettings) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.NoGraphics = noGraphics; + toolSettings.ForceGLCore = !toolSettings.ForceGLCore; return toolSettings; } + #endregion + #region ForceGLCoreXY /// - ///

    Resets

    - ///

    When running in batch mode, do not initialize the graphics device at all. This makes it possible to run your automated workflows on machines that don't even have a GPU (automated workflows only work when you have a window in focus, otherwise you can't send simulated input commands). Please note that -nographics does not allow you to bake GI on OSX, since Enlighten requires GPU acceleration.

    + ///

    Sets

    + ///

    (Windows only) Similar to -force-glcore, but requests a specific OpenGL context version. Accepted values for XY: 32, 33, 40, 41, 42, 43, 44 or 45.

    ///
    [Pure] - public static T ResetNoGraphics(this T toolSettings) where T : UnitySettings + public static T SetForceGLCoreXY(this T toolSettings, UnityGLCore forceGLCoreXY) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.NoGraphics = null; + toolSettings.ForceGLCoreXY = forceGLCoreXY; return toolSettings; } /// - ///

    Enables

    - ///

    When running in batch mode, do not initialize the graphics device at all. This makes it possible to run your automated workflows on machines that don't even have a GPU (automated workflows only work when you have a window in focus, otherwise you can't send simulated input commands). Please note that -nographics does not allow you to bake GI on OSX, since Enlighten requires GPU acceleration.

    + ///

    Resets

    + ///

    (Windows only) Similar to -force-glcore, but requests a specific OpenGL context version. Accepted values for XY: 32, 33, 40, 41, 42, 43, 44 or 45.

    ///
    [Pure] - public static T EnableNoGraphics(this T toolSettings) where T : UnitySettings + public static T ResetForceGLCoreXY(this T toolSettings) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.NoGraphics = true; + toolSettings.ForceGLCoreXY = null; return toolSettings; } + #endregion + #region ForceGLES /// - ///

    Disables

    - ///

    When running in batch mode, do not initialize the graphics device at all. This makes it possible to run your automated workflows on machines that don't even have a GPU (automated workflows only work when you have a window in focus, otherwise you can't send simulated input commands). Please note that -nographics does not allow you to bake GI on OSX, since Enlighten requires GPU acceleration.

    + ///

    Sets

    + ///

    (Windows only) Make the Editor use OpenGL for Embedded Systems for rendering. The Editor tries to use the best OpenGL ES version available, and all OpenGL ES extensions exposed by the OpenGL drivers.

    ///
    [Pure] - public static T DisableNoGraphics(this T toolSettings) where T : UnitySettings + public static T SetForceGLES(this T toolSettings, bool? forceGLES) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.NoGraphics = false; + toolSettings.ForceGLES = forceGLES; return toolSettings; } /// - ///

    Toggles

    - ///

    When running in batch mode, do not initialize the graphics device at all. This makes it possible to run your automated workflows on machines that don't even have a GPU (automated workflows only work when you have a window in focus, otherwise you can't send simulated input commands). Please note that -nographics does not allow you to bake GI on OSX, since Enlighten requires GPU acceleration.

    + ///

    Resets

    + ///

    (Windows only) Make the Editor use OpenGL for Embedded Systems for rendering. The Editor tries to use the best OpenGL ES version available, and all OpenGL ES extensions exposed by the OpenGL drivers.

    ///
    [Pure] - public static T ToggleNoGraphics(this T toolSettings) where T : UnitySettings + public static T ResetForceGLES(this T toolSettings) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.NoGraphics = !toolSettings.NoGraphics; + toolSettings.ForceGLES = null; return toolSettings; } - #endregion - #region Quit /// - ///

    Sets

    - ///

    Quit the Unity Editor after other commands have finished executing. Note that this can cause error messages to be hidden (however, they still appear in the Editor.log file).

    + ///

    Enables

    + ///

    (Windows only) Make the Editor use OpenGL for Embedded Systems for rendering. The Editor tries to use the best OpenGL ES version available, and all OpenGL ES extensions exposed by the OpenGL drivers.

    ///
    [Pure] - public static T SetQuit(this T toolSettings, bool? quit) where T : UnitySettings + public static T EnableForceGLES(this T toolSettings) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.Quit = quit; + toolSettings.ForceGLES = true; return toolSettings; } /// - ///

    Resets

    - ///

    Quit the Unity Editor after other commands have finished executing. Note that this can cause error messages to be hidden (however, they still appear in the Editor.log file).

    + ///

    Disables

    + ///

    (Windows only) Make the Editor use OpenGL for Embedded Systems for rendering. The Editor tries to use the best OpenGL ES version available, and all OpenGL ES extensions exposed by the OpenGL drivers.

    ///
    [Pure] - public static T ResetQuit(this T toolSettings) where T : UnitySettings + public static T DisableForceGLES(this T toolSettings) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.Quit = null; + toolSettings.ForceGLES = false; return toolSettings; } /// - ///

    Enables

    - ///

    Quit the Unity Editor after other commands have finished executing. Note that this can cause error messages to be hidden (however, they still appear in the Editor.log file).

    + ///

    Toggles

    + ///

    (Windows only) Make the Editor use OpenGL for Embedded Systems for rendering. The Editor tries to use the best OpenGL ES version available, and all OpenGL ES extensions exposed by the OpenGL drivers.

    ///
    [Pure] - public static T EnableQuit(this T toolSettings) where T : UnitySettings + public static T ToggleForceGLES(this T toolSettings) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.Quit = true; + toolSettings.ForceGLES = !toolSettings.ForceGLES; return toolSettings; } + #endregion + #region ForceGLESXY /// - ///

    Disables

    - ///

    Quit the Unity Editor after other commands have finished executing. Note that this can cause error messages to be hidden (however, they still appear in the Editor.log file).

    + ///

    Sets

    + ///

    (Windows only) Similar to -force-gles, but requests a specific OpenGL ES context version. Accepted values for XY: 30, 31 or 32.

    ///
    [Pure] - public static T DisableQuit(this T toolSettings) where T : UnitySettings + public static T SetForceGLESXY(this T toolSettings, UnityGLES forceGLESXY) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.Quit = false; + toolSettings.ForceGLESXY = forceGLESXY; return toolSettings; } /// - ///

    Toggles

    - ///

    Quit the Unity Editor after other commands have finished executing. Note that this can cause error messages to be hidden (however, they still appear in the Editor.log file).

    + ///

    Resets

    + ///

    (Windows only) Similar to -force-gles, but requests a specific OpenGL ES context version. Accepted values for XY: 30, 31 or 32.

    ///
    [Pure] - public static T ToggleQuit(this T toolSettings) where T : UnitySettings + public static T ResetForceGLESXY(this T toolSettings) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.Quit = !toolSettings.Quit; + toolSettings.ForceGLESXY = null; return toolSettings; } #endregion -} -#endregion -#region UnityReturnLicenseSettingsExtensions -/// -/// Used within . -/// -[PublicAPI] -[ExcludeFromCodeCoverage] -public static partial class UnityReturnLicenseSettingsExtensions -{ - #region Username + #region ForceClamped /// - ///

    Sets

    - ///

    Enter a username into the log-in form during activation of the Unity Editor.

    + ///

    Sets

    + ///

    (2017.3+) (Windows only) Used with -force-glcoreXY to prevent checking for additional OpenGL extensions, allowing it to run between platforms with the same code paths.

    ///
    [Pure] - public static T SetUsername(this T toolSettings, string username) where T : UnityReturnLicenseSettings + public static T SetForceClamped(this T toolSettings, bool? forceClamped) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.Username = username; + toolSettings.ForceClamped = forceClamped; return toolSettings; } /// - ///

    Resets

    - ///

    Enter a username into the log-in form during activation of the Unity Editor.

    + ///

    Resets

    + ///

    (2017.3+) (Windows only) Used with -force-glcoreXY to prevent checking for additional OpenGL extensions, allowing it to run between platforms with the same code paths.

    ///
    [Pure] - public static T ResetUsername(this T toolSettings) where T : UnityReturnLicenseSettings + public static T ResetForceClamped(this T toolSettings) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.Username = null; + toolSettings.ForceClamped = null; return toolSettings; } - #endregion - #region Password /// - ///

    Sets

    - ///

    Enter a password into the log-in form during activation of the Unity Editor.

    + ///

    Enables

    + ///

    (2017.3+) (Windows only) Used with -force-glcoreXY to prevent checking for additional OpenGL extensions, allowing it to run between platforms with the same code paths.

    ///
    [Pure] - public static T SetPassword(this T toolSettings, [Secret] string password) where T : UnityReturnLicenseSettings + public static T EnableForceClamped(this T toolSettings) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.Password = password; + toolSettings.ForceClamped = true; return toolSettings; } /// - ///

    Resets

    - ///

    Enter a password into the log-in form during activation of the Unity Editor.

    + ///

    Disables

    + ///

    (2017.3+) (Windows only) Used with -force-glcoreXY to prevent checking for additional OpenGL extensions, allowing it to run between platforms with the same code paths.

    ///
    [Pure] - public static T ResetPassword(this T toolSettings) where T : UnityReturnLicenseSettings + public static T DisableForceClamped(this T toolSettings) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.Password = null; + toolSettings.ForceClamped = false; return toolSettings; } - #endregion - #region Serial /// - ///

    Sets

    - ///

    Activate Unity with the specified serial key. It is good practice to pass the -batchmode and -quit arguments as well, in order to quit Unity when done, if using this for automated activation of Unity. Please allow a few seconds before the license file is created, because Unity needs to communicate with the license server. Make sure that license file folder exists, and has appropriate permissions before running Unity with this argument. If activation fails, see the Editor.log for info.

    + ///

    Toggles

    + ///

    (2017.3+) (Windows only) Used with -force-glcoreXY to prevent checking for additional OpenGL extensions, allowing it to run between platforms with the same code paths.

    ///
    [Pure] - public static T SetSerial(this T toolSettings, [Secret] string serial) where T : UnityReturnLicenseSettings + public static T ToggleForceClamped(this T toolSettings) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.Serial = serial; + toolSettings.ForceClamped = !toolSettings.ForceClamped; return toolSettings; } + #endregion + #region ForceLowPowerDevice /// - ///

    Resets

    - ///

    Activate Unity with the specified serial key. It is good practice to pass the -batchmode and -quit arguments as well, in order to quit Unity when done, if using this for automated activation of Unity. Please allow a few seconds before the license file is created, because Unity needs to communicate with the license server. Make sure that license file folder exists, and has appropriate permissions before running Unity with this argument. If activation fails, see the Editor.log for info.

    + ///

    Sets

    + ///

    (macOS only) When using Metal, make the Editor use a low power device.

    ///
    [Pure] - public static T ResetSerial(this T toolSettings) where T : UnityReturnLicenseSettings + public static T SetForceLowPowerDevice(this T toolSettings, bool? forceLowPowerDevice) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.Serial = null; + toolSettings.ForceLowPowerDevice = forceLowPowerDevice; return toolSettings; } - #endregion - #region BatchMode /// - ///

    Sets

    - ///

    Run Unity in batch mode. This should always be used in conjunction with the other command line arguments, because it ensures no pop-up windows appear and eliminates the need for any human intervention. When an exception occurs during execution of the script code, the Asset server updates fail, or other operations that fail, Unity immediately exits with return code 1.Note that in batch mode, Unity sends a minimal version of its log output to the console. However, the Log Files still contain the full log information. Opening a project in batch mode while the Editor has the same project open is not supported; only a single instance of Unity can run at a time.

    + ///

    Resets

    + ///

    (macOS only) When using Metal, make the Editor use a low power device.

    ///
    [Pure] - public static T SetBatchMode(this T toolSettings, bool? batchMode) where T : UnityReturnLicenseSettings + public static T ResetForceLowPowerDevice(this T toolSettings) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.BatchMode = batchMode; + toolSettings.ForceLowPowerDevice = null; return toolSettings; } /// - ///

    Resets

    - ///

    Run Unity in batch mode. This should always be used in conjunction with the other command line arguments, because it ensures no pop-up windows appear and eliminates the need for any human intervention. When an exception occurs during execution of the script code, the Asset server updates fail, or other operations that fail, Unity immediately exits with return code 1.Note that in batch mode, Unity sends a minimal version of its log output to the console. However, the Log Files still contain the full log information. Opening a project in batch mode while the Editor has the same project open is not supported; only a single instance of Unity can run at a time.

    + ///

    Enables

    + ///

    (macOS only) When using Metal, make the Editor use a low power device.

    ///
    [Pure] - public static T ResetBatchMode(this T toolSettings) where T : UnityReturnLicenseSettings + public static T EnableForceLowPowerDevice(this T toolSettings) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.BatchMode = null; + toolSettings.ForceLowPowerDevice = true; return toolSettings; } /// - ///

    Enables

    - ///

    Run Unity in batch mode. This should always be used in conjunction with the other command line arguments, because it ensures no pop-up windows appear and eliminates the need for any human intervention. When an exception occurs during execution of the script code, the Asset server updates fail, or other operations that fail, Unity immediately exits with return code 1.Note that in batch mode, Unity sends a minimal version of its log output to the console. However, the Log Files still contain the full log information. Opening a project in batch mode while the Editor has the same project open is not supported; only a single instance of Unity can run at a time.

    + ///

    Disables

    + ///

    (macOS only) When using Metal, make the Editor use a low power device.

    ///
    [Pure] - public static T EnableBatchMode(this T toolSettings) where T : UnityReturnLicenseSettings + public static T DisableForceLowPowerDevice(this T toolSettings) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.BatchMode = true; + toolSettings.ForceLowPowerDevice = false; return toolSettings; } /// - ///

    Disables

    - ///

    Run Unity in batch mode. This should always be used in conjunction with the other command line arguments, because it ensures no pop-up windows appear and eliminates the need for any human intervention. When an exception occurs during execution of the script code, the Asset server updates fail, or other operations that fail, Unity immediately exits with return code 1.Note that in batch mode, Unity sends a minimal version of its log output to the console. However, the Log Files still contain the full log information. Opening a project in batch mode while the Editor has the same project open is not supported; only a single instance of Unity can run at a time.

    + ///

    Toggles

    + ///

    (macOS only) When using Metal, make the Editor use a low power device.

    ///
    [Pure] - public static T DisableBatchMode(this T toolSettings) where T : UnityReturnLicenseSettings + public static T ToggleForceLowPowerDevice(this T toolSettings) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.BatchMode = false; + toolSettings.ForceLowPowerDevice = !toolSettings.ForceLowPowerDevice; return toolSettings; } + #endregion + #region DefaultPlatformTextureFormat /// - ///

    Toggles

    - ///

    Run Unity in batch mode. This should always be used in conjunction with the other command line arguments, because it ensures no pop-up windows appear and eliminates the need for any human intervention. When an exception occurs during execution of the script code, the Asset server updates fail, or other operations that fail, Unity immediately exits with return code 1.Note that in batch mode, Unity sends a minimal version of its log output to the console. However, the Log Files still contain the full log information. Opening a project in batch mode while the Editor has the same project open is not supported; only a single instance of Unity can run at a time.

    + ///

    Sets

    + ///

    (2018.1+) Sets the default texture compression to the desired format before importing a texture or building the project. This is so you don’t have to import the texture again with the format you want. The available formats are dxt, pvrtc, atc, etc, etc2, and astc. Note that this is only supported on Android.

    ///
    [Pure] - public static T ToggleBatchMode(this T toolSettings) where T : UnityReturnLicenseSettings + public static T SetDefaultPlatformTextureFormat(this T toolSettings, string defaultPlatformTextureFormat) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.BatchMode = !toolSettings.BatchMode; + toolSettings.DefaultPlatformTextureFormat = defaultPlatformTextureFormat; return toolSettings; } - #endregion - #region SilentCrashes /// - ///

    Sets

    - ///

    Don't display a crash dialog.

    + ///

    Resets

    + ///

    (2018.1+) Sets the default texture compression to the desired format before importing a texture or building the project. This is so you don’t have to import the texture again with the format you want. The available formats are dxt, pvrtc, atc, etc, etc2, and astc. Note that this is only supported on Android.

    ///
    [Pure] - public static T SetSilentCrashes(this T toolSettings, bool? silentCrashes) where T : UnityReturnLicenseSettings + public static T ResetDefaultPlatformTextureFormat(this T toolSettings) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.SilentCrashes = silentCrashes; + toolSettings.DefaultPlatformTextureFormat = null; return toolSettings; } + #endregion + #region DisableAssemblyUpdater /// - ///

    Resets

    - ///

    Don't display a crash dialog.

    + ///

    Sets to a new list

    + ///

    Specify a space-separated list of assembly names as parameters for Unity to ignore on automatic updates. The space-separated list of assembly names is optional: Pass the command line options without any assembly names to ignore all assemblies.

    ///
    [Pure] - public static T ResetSilentCrashes(this T toolSettings) where T : UnityReturnLicenseSettings + public static T SetDisableAssemblyUpdater(this T toolSettings, params string[] disableAssemblyUpdater) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.SilentCrashes = null; + toolSettings.DisableAssemblyUpdaterInternal = disableAssemblyUpdater.ToList(); return toolSettings; } /// - ///

    Enables

    - ///

    Don't display a crash dialog.

    + ///

    Sets to a new list

    + ///

    Specify a space-separated list of assembly names as parameters for Unity to ignore on automatic updates. The space-separated list of assembly names is optional: Pass the command line options without any assembly names to ignore all assemblies.

    ///
    [Pure] - public static T EnableSilentCrashes(this T toolSettings) where T : UnityReturnLicenseSettings + public static T SetDisableAssemblyUpdater(this T toolSettings, IEnumerable disableAssemblyUpdater) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.SilentCrashes = true; + toolSettings.DisableAssemblyUpdaterInternal = disableAssemblyUpdater.ToList(); return toolSettings; } /// - ///

    Disables

    - ///

    Don't display a crash dialog.

    + ///

    Adds values to

    + ///

    Specify a space-separated list of assembly names as parameters for Unity to ignore on automatic updates. The space-separated list of assembly names is optional: Pass the command line options without any assembly names to ignore all assemblies.

    ///
    [Pure] - public static T DisableSilentCrashes(this T toolSettings) where T : UnityReturnLicenseSettings + public static T AddDisableAssemblyUpdater(this T toolSettings, params string[] disableAssemblyUpdater) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.SilentCrashes = false; + toolSettings.DisableAssemblyUpdaterInternal.AddRange(disableAssemblyUpdater); return toolSettings; } /// - ///

    Toggles

    - ///

    Don't display a crash dialog.

    + ///

    Adds values to

    + ///

    Specify a space-separated list of assembly names as parameters for Unity to ignore on automatic updates. The space-separated list of assembly names is optional: Pass the command line options without any assembly names to ignore all assemblies.

    ///
    [Pure] - public static T ToggleSilentCrashes(this T toolSettings) where T : UnityReturnLicenseSettings + public static T AddDisableAssemblyUpdater(this T toolSettings, IEnumerable disableAssemblyUpdater) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.SilentCrashes = !toolSettings.SilentCrashes; + toolSettings.DisableAssemblyUpdaterInternal.AddRange(disableAssemblyUpdater); return toolSettings; } - #endregion - #region NoGraphics /// - ///

    Sets

    - ///

    When running in batch mode, do not initialize the graphics device at all. This makes it possible to run your automated workflows on machines that don't even have a GPU (automated workflows only work when you have a window in focus, otherwise you can't send simulated input commands). Please note that -nographics does not allow you to bake GI on OSX, since Enlighten requires GPU acceleration.

    + ///

    Clears

    + ///

    Specify a space-separated list of assembly names as parameters for Unity to ignore on automatic updates. The space-separated list of assembly names is optional: Pass the command line options without any assembly names to ignore all assemblies.

    ///
    [Pure] - public static T SetNoGraphics(this T toolSettings, bool? noGraphics) where T : UnityReturnLicenseSettings + public static T ClearDisableAssemblyUpdater(this T toolSettings) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.NoGraphics = noGraphics; + toolSettings.DisableAssemblyUpdaterInternal.Clear(); return toolSettings; } /// - ///

    Resets

    - ///

    When running in batch mode, do not initialize the graphics device at all. This makes it possible to run your automated workflows on machines that don't even have a GPU (automated workflows only work when you have a window in focus, otherwise you can't send simulated input commands). Please note that -nographics does not allow you to bake GI on OSX, since Enlighten requires GPU acceleration.

    + ///

    Removes values from

    + ///

    Specify a space-separated list of assembly names as parameters for Unity to ignore on automatic updates. The space-separated list of assembly names is optional: Pass the command line options without any assembly names to ignore all assemblies.

    ///
    [Pure] - public static T ResetNoGraphics(this T toolSettings) where T : UnityReturnLicenseSettings + public static T RemoveDisableAssemblyUpdater(this T toolSettings, params string[] disableAssemblyUpdater) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.NoGraphics = null; + var hashSet = new HashSet(disableAssemblyUpdater); + toolSettings.DisableAssemblyUpdaterInternal.RemoveAll(x => hashSet.Contains(x)); return toolSettings; } /// - ///

    Enables

    - ///

    When running in batch mode, do not initialize the graphics device at all. This makes it possible to run your automated workflows on machines that don't even have a GPU (automated workflows only work when you have a window in focus, otherwise you can't send simulated input commands). Please note that -nographics does not allow you to bake GI on OSX, since Enlighten requires GPU acceleration.

    + ///

    Removes values from

    + ///

    Specify a space-separated list of assembly names as parameters for Unity to ignore on automatic updates. The space-separated list of assembly names is optional: Pass the command line options without any assembly names to ignore all assemblies.

    ///
    [Pure] - public static T EnableNoGraphics(this T toolSettings) where T : UnityReturnLicenseSettings + public static T RemoveDisableAssemblyUpdater(this T toolSettings, IEnumerable disableAssemblyUpdater) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.NoGraphics = true; + var hashSet = new HashSet(disableAssemblyUpdater); + toolSettings.DisableAssemblyUpdaterInternal.RemoveAll(x => hashSet.Contains(x)); return toolSettings; } + #endregion + #region CacheServerIPAddress /// - ///

    Disables

    - ///

    When running in batch mode, do not initialize the graphics device at all. This makes it possible to run your automated workflows on machines that don't even have a GPU (automated workflows only work when you have a window in focus, otherwise you can't send simulated input commands). Please note that -nographics does not allow you to bake GI on OSX, since Enlighten requires GPU acceleration.

    + ///

    Sets

    + ///

    (2018.1+) Connect to the Cache Server given by IP:port on startup, overriding any configuration stored in the Editor Preferences. Use this to connect multiple instances of Unity to different Cache Servers.

    ///
    [Pure] - public static T DisableNoGraphics(this T toolSettings) where T : UnityReturnLicenseSettings + public static T SetCacheServerIPAddress(this T toolSettings, string cacheServerIPAddress) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.NoGraphics = false; + toolSettings.CacheServerIPAddress = cacheServerIPAddress; return toolSettings; } /// - ///

    Toggles

    - ///

    When running in batch mode, do not initialize the graphics device at all. This makes it possible to run your automated workflows on machines that don't even have a GPU (automated workflows only work when you have a window in focus, otherwise you can't send simulated input commands). Please note that -nographics does not allow you to bake GI on OSX, since Enlighten requires GPU acceleration.

    + ///

    Resets

    + ///

    (2018.1+) Connect to the Cache Server given by IP:port on startup, overriding any configuration stored in the Editor Preferences. Use this to connect multiple instances of Unity to different Cache Servers.

    ///
    [Pure] - public static T ToggleNoGraphics(this T toolSettings) where T : UnityReturnLicenseSettings + public static T ResetCacheServerIPAddress(this T toolSettings) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.NoGraphics = !toolSettings.NoGraphics; + toolSettings.CacheServerIPAddress = null; return toolSettings; } #endregion - #region Quit + #region NoUpm /// - ///

    Sets

    - ///

    Quit the Unity Editor after other commands have finished executing. Note that this can cause error messages to be hidden (however, they still appear in the Editor.log file).

    + ///

    Sets

    + ///

    (2018.1+) Disables the Unity Package Manager.

    ///
    [Pure] - public static T SetQuit(this T toolSettings, bool? quit) where T : UnityReturnLicenseSettings + public static T SetNoUpm(this T toolSettings, bool? noUpm) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.Quit = quit; + toolSettings.NoUpm = noUpm; return toolSettings; } /// - ///

    Resets

    - ///

    Quit the Unity Editor after other commands have finished executing. Note that this can cause error messages to be hidden (however, they still appear in the Editor.log file).

    + ///

    Resets

    + ///

    (2018.1+) Disables the Unity Package Manager.

    ///
    [Pure] - public static T ResetQuit(this T toolSettings) where T : UnityReturnLicenseSettings + public static T ResetNoUpm(this T toolSettings) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.Quit = null; + toolSettings.NoUpm = null; return toolSettings; } /// - ///

    Enables

    - ///

    Quit the Unity Editor after other commands have finished executing. Note that this can cause error messages to be hidden (however, they still appear in the Editor.log file).

    + ///

    Enables

    + ///

    (2018.1+) Disables the Unity Package Manager.

    ///
    [Pure] - public static T EnableQuit(this T toolSettings) where T : UnityReturnLicenseSettings + public static T EnableNoUpm(this T toolSettings) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.Quit = true; + toolSettings.NoUpm = true; return toolSettings; } /// - ///

    Disables

    - ///

    Quit the Unity Editor after other commands have finished executing. Note that this can cause error messages to be hidden (however, they still appear in the Editor.log file).

    + ///

    Disables

    + ///

    (2018.1+) Disables the Unity Package Manager.

    ///
    [Pure] - public static T DisableQuit(this T toolSettings) where T : UnityReturnLicenseSettings + public static T DisableNoUpm(this T toolSettings) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.Quit = false; + toolSettings.NoUpm = false; return toolSettings; } /// - ///

    Toggles

    - ///

    Quit the Unity Editor after other commands have finished executing. Note that this can cause error messages to be hidden (however, they still appear in the Editor.log file).

    + ///

    Toggles

    + ///

    (2018.1+) Disables the Unity Package Manager.

    ///
    [Pure] - public static T ToggleQuit(this T toolSettings) where T : UnityReturnLicenseSettings + public static T ToggleNoUpm(this T toolSettings) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.Quit = !toolSettings.Quit; + toolSettings.NoUpm = !toolSettings.NoUpm; return toolSettings; } #endregion -} -#endregion -#region UnityBaseSettingsExtensions -/// -/// Used within . -/// -[PublicAPI] -[ExcludeFromCodeCoverage] -public static partial class UnityBaseSettingsExtensions -{ - #region LogFile + #region AcceptApiUpdate /// - ///

    Sets

    - ///

    Specify where the Editor or Windows/Linux/OSX standalone log file are written.

    + ///

    Sets

    + ///

    (2017.2+) Use this command line option to specify that APIUpdater should run when Unity is launched in batch mode. Omitting this command line argument when launching Unity in batch mode results in APIUpdater not running which can lead to compiler errors. Note that in versions prior to 2017.2 there’s no way to not run APIUpdater when Unity is launched in batch mode.

    ///
    [Pure] - public static T SetLogFile(this T toolSettings, string logFile) where T : UnityBaseSettings + public static T SetAcceptApiUpdate(this T toolSettings, bool? acceptApiUpdate) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.LogFile = logFile; + toolSettings.AcceptApiUpdate = acceptApiUpdate; return toolSettings; } /// - ///

    Resets

    - ///

    Specify where the Editor or Windows/Linux/OSX standalone log file are written.

    + ///

    Resets

    + ///

    (2017.2+) Use this command line option to specify that APIUpdater should run when Unity is launched in batch mode. Omitting this command line argument when launching Unity in batch mode results in APIUpdater not running which can lead to compiler errors. Note that in versions prior to 2017.2 there’s no way to not run APIUpdater when Unity is launched in batch mode.

    ///
    [Pure] - public static T ResetLogFile(this T toolSettings) where T : UnityBaseSettings + public static T ResetAcceptApiUpdate(this T toolSettings) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.LogFile = null; + toolSettings.AcceptApiUpdate = null; return toolSettings; } - #endregion - #region MinimalOutput /// - ///

    Sets

    - ///

    (experimental) If set to true only warnings and errors will be printed to the output.

    + ///

    Enables

    + ///

    (2017.2+) Use this command line option to specify that APIUpdater should run when Unity is launched in batch mode. Omitting this command line argument when launching Unity in batch mode results in APIUpdater not running which can lead to compiler errors. Note that in versions prior to 2017.2 there’s no way to not run APIUpdater when Unity is launched in batch mode.

    ///
    [Pure] - public static T SetMinimalOutput(this T toolSettings, bool? minimalOutput) where T : UnityBaseSettings + public static T EnableAcceptApiUpdate(this T toolSettings) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.MinimalOutput = minimalOutput; + toolSettings.AcceptApiUpdate = true; return toolSettings; } /// - ///

    Resets

    - ///

    (experimental) If set to true only warnings and errors will be printed to the output.

    + ///

    Disables

    + ///

    (2017.2+) Use this command line option to specify that APIUpdater should run when Unity is launched in batch mode. Omitting this command line argument when launching Unity in batch mode results in APIUpdater not running which can lead to compiler errors. Note that in versions prior to 2017.2 there’s no way to not run APIUpdater when Unity is launched in batch mode.

    ///
    [Pure] - public static T ResetMinimalOutput(this T toolSettings) where T : UnityBaseSettings + public static T DisableAcceptApiUpdate(this T toolSettings) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.MinimalOutput = null; + toolSettings.AcceptApiUpdate = false; return toolSettings; } /// - ///

    Enables

    - ///

    (experimental) If set to true only warnings and errors will be printed to the output.

    + ///

    Toggles

    + ///

    (2017.2+) Use this command line option to specify that APIUpdater should run when Unity is launched in batch mode. Omitting this command line argument when launching Unity in batch mode results in APIUpdater not running which can lead to compiler errors. Note that in versions prior to 2017.2 there’s no way to not run APIUpdater when Unity is launched in batch mode.

    ///
    [Pure] - public static T EnableMinimalOutput(this T toolSettings) where T : UnityBaseSettings + public static T ToggleAcceptApiUpdate(this T toolSettings) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.MinimalOutput = true; + toolSettings.AcceptApiUpdate = !toolSettings.AcceptApiUpdate; return toolSettings; } + #endregion + #region CustomArguments /// - ///

    Disables

    - ///

    (experimental) If set to true only warnings and errors will be printed to the output.

    + ///

    Sets to a new list

    + ///

    Custom parameters. To pass parameters, add them to the command line and retrieve them inside the function using System.Environment.GetCommandLineArgs.

    ///
    [Pure] - public static T DisableMinimalOutput(this T toolSettings) where T : UnityBaseSettings + public static T SetCustomArguments(this T toolSettings, params string[] customArguments) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.MinimalOutput = false; + toolSettings.CustomArgumentsInternal = customArguments.ToList(); return toolSettings; } /// - ///

    Toggles

    - ///

    (experimental) If set to true only warnings and errors will be printed to the output.

    + ///

    Sets to a new list

    + ///

    Custom parameters. To pass parameters, add them to the command line and retrieve them inside the function using System.Environment.GetCommandLineArgs.

    ///
    [Pure] - public static T ToggleMinimalOutput(this T toolSettings) where T : UnityBaseSettings + public static T SetCustomArguments(this T toolSettings, IEnumerable customArguments) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.MinimalOutput = !toolSettings.MinimalOutput; + toolSettings.CustomArgumentsInternal = customArguments.ToList(); return toolSettings; } - #endregion - #region StableExitCodes /// - ///

    Sets to a new list

    - ///

    Define exit codes which will not fail the build.

    + ///

    Adds values to

    + ///

    Custom parameters. To pass parameters, add them to the command line and retrieve them inside the function using System.Environment.GetCommandLineArgs.

    ///
    [Pure] - public static T SetStableExitCodes(this T toolSettings, params int[] stableExitCodes) where T : UnityBaseSettings + public static T AddCustomArguments(this T toolSettings, params string[] customArguments) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.StableExitCodesInternal = stableExitCodes.ToList(); + toolSettings.CustomArgumentsInternal.AddRange(customArguments); return toolSettings; } /// - ///

    Sets to a new list

    - ///

    Define exit codes which will not fail the build.

    + ///

    Adds values to

    + ///

    Custom parameters. To pass parameters, add them to the command line and retrieve them inside the function using System.Environment.GetCommandLineArgs.

    ///
    [Pure] - public static T SetStableExitCodes(this T toolSettings, IEnumerable stableExitCodes) where T : UnityBaseSettings + public static T AddCustomArguments(this T toolSettings, IEnumerable customArguments) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.StableExitCodesInternal = stableExitCodes.ToList(); + toolSettings.CustomArgumentsInternal.AddRange(customArguments); return toolSettings; } /// - ///

    Adds values to

    - ///

    Define exit codes which will not fail the build.

    + ///

    Clears

    + ///

    Custom parameters. To pass parameters, add them to the command line and retrieve them inside the function using System.Environment.GetCommandLineArgs.

    ///
    [Pure] - public static T AddStableExitCodes(this T toolSettings, params int[] stableExitCodes) where T : UnityBaseSettings + public static T ClearCustomArguments(this T toolSettings) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.StableExitCodesInternal.AddRange(stableExitCodes); + toolSettings.CustomArgumentsInternal.Clear(); return toolSettings; } /// - ///

    Adds values to

    - ///

    Define exit codes which will not fail the build.

    + ///

    Removes values from

    + ///

    Custom parameters. To pass parameters, add them to the command line and retrieve them inside the function using System.Environment.GetCommandLineArgs.

    ///
    [Pure] - public static T AddStableExitCodes(this T toolSettings, IEnumerable stableExitCodes) where T : UnityBaseSettings + public static T RemoveCustomArguments(this T toolSettings, params string[] customArguments) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.StableExitCodesInternal.AddRange(stableExitCodes); + var hashSet = new HashSet(customArguments); + toolSettings.CustomArgumentsInternal.RemoveAll(x => hashSet.Contains(x)); return toolSettings; } /// - ///

    Clears

    - ///

    Define exit codes which will not fail the build.

    + ///

    Removes values from

    + ///

    Custom parameters. To pass parameters, add them to the command line and retrieve them inside the function using System.Environment.GetCommandLineArgs.

    ///
    [Pure] - public static T ClearStableExitCodes(this T toolSettings) where T : UnityBaseSettings + public static T RemoveCustomArguments(this T toolSettings, IEnumerable customArguments) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.StableExitCodesInternal.Clear(); + var hashSet = new HashSet(customArguments); + toolSettings.CustomArgumentsInternal.RemoveAll(x => hashSet.Contains(x)); return toolSettings; } + #endregion + #region StackTraceLogType /// - ///

    Removes values from

    - ///

    Define exit codes which will not fail the build.

    + ///

    Sets

    + ///

    Detailed debugging feature. StackTraceLogging allows you to allow detailed logging.

    ///
    [Pure] - public static T RemoveStableExitCodes(this T toolSettings, params int[] stableExitCodes) where T : UnityBaseSettings + public static T SetStackTraceLogType(this T toolSettings, UnityStackTraceLogType stackTraceLogType) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(stableExitCodes); - toolSettings.StableExitCodesInternal.RemoveAll(x => hashSet.Contains(x)); + toolSettings.StackTraceLogType = stackTraceLogType; return toolSettings; } /// - ///

    Removes values from

    - ///

    Define exit codes which will not fail the build.

    + ///

    Resets

    + ///

    Detailed debugging feature. StackTraceLogging allows you to allow detailed logging.

    ///
    [Pure] - public static T RemoveStableExitCodes(this T toolSettings, IEnumerable stableExitCodes) where T : UnityBaseSettings + public static T ResetStackTraceLogType(this T toolSettings) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(stableExitCodes); - toolSettings.StableExitCodesInternal.RemoveAll(x => hashSet.Contains(x)); + toolSettings.StackTraceLogType = null; return toolSettings; } #endregion - #region HubVersion + #region ProjectPath /// - ///

    Sets

    - ///

    Defines the Unity version to use. The version must be installed via Unity Hub.

    + ///

    Sets

    + ///

    Specify the path of the unity project.

    ///
    [Pure] - public static T SetHubVersion(this T toolSettings, string hubVersion) where T : UnityBaseSettings + public static T SetProjectPath(this T toolSettings, string projectPath) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.HubVersion = hubVersion; + toolSettings.ProjectPath = projectPath; return toolSettings; } /// - ///

    Resets

    - ///

    Defines the Unity version to use. The version must be installed via Unity Hub.

    + ///

    Resets

    + ///

    Specify the path of the unity project.

    ///
    [Pure] - public static T ResetHubVersion(this T toolSettings) where T : UnityBaseSettings + public static T ResetProjectPath(this T toolSettings) where T : UnityProjectSettings { toolSettings = toolSettings.NewInstance(); - toolSettings.HubVersion = null; + toolSettings.ProjectPath = null; return toolSettings; } #endregion @@ -3782,26 +4427,44 @@ public static T ResetHubVersion(this T toolSettings) where T : UnityBaseSetti [TypeConverter(typeof(TypeConverter))] public partial class UnityBuildTarget : Enumeration { - public static UnityBuildTarget standalone = (UnityBuildTarget) "standalone"; - public static UnityBuildTarget Win = (UnityBuildTarget) "Win"; - public static UnityBuildTarget Win64 = (UnityBuildTarget) "Win64"; - public static UnityBuildTarget OSXUniversal = (UnityBuildTarget) "OSXUniversal"; + public static UnityBuildTarget Android = (UnityBuildTarget) "Android"; + public static UnityBuildTarget Bratwurst = (UnityBuildTarget) "Bratwurst"; + public static UnityBuildTarget CloudRendering = (UnityBuildTarget) "CloudRendering"; + public static UnityBuildTarget iOS = (UnityBuildTarget) "iOS"; public static UnityBuildTarget Linux = (UnityBuildTarget) "Linux"; public static UnityBuildTarget Linux64 = (UnityBuildTarget) "Linux64"; + public static UnityBuildTarget LinuxHeadlessSimulation = (UnityBuildTarget) "LinuxHeadlessSimulation"; public static UnityBuildTarget LinuxUniversal = (UnityBuildTarget) "LinuxUniversal"; - public static UnityBuildTarget iOS = (UnityBuildTarget) "iOS"; - public static UnityBuildTarget Android = (UnityBuildTarget) "Android"; - public static UnityBuildTarget Web = (UnityBuildTarget) "Web"; - public static UnityBuildTarget WebStreamed = (UnityBuildTarget) "WebStreamed"; - public static UnityBuildTarget WebGL = (UnityBuildTarget) "WebGL"; - public static UnityBuildTarget XboxOne = (UnityBuildTarget) "XboxOne"; + public static UnityBuildTarget N3DS = (UnityBuildTarget) "N3DS"; + public static UnityBuildTarget OSXUniversal = (UnityBuildTarget) "OSXUniversal"; public static UnityBuildTarget PS4 = (UnityBuildTarget) "PS4"; + public static UnityBuildTarget PS5 = (UnityBuildTarget) "PS5"; + public static UnityBuildTarget PSM = (UnityBuildTarget) "PSM"; public static UnityBuildTarget PSP2 = (UnityBuildTarget) "PSP2"; - public static UnityBuildTarget WindowsStoreApps = (UnityBuildTarget) "WindowsStoreApps"; + public static UnityBuildTarget SamsungTV = (UnityBuildTarget) "SamsungTV"; + public static UnityBuildTarget Stadia = (UnityBuildTarget) "Stadia"; + public static UnityBuildTarget standalone = (UnityBuildTarget) "standalone"; + public static UnityBuildTarget StandaloneLinux = (UnityBuildTarget) "StandaloneLinux"; + public static UnityBuildTarget StandaloneLinux64 = (UnityBuildTarget) "StandaloneLinux64"; + public static UnityBuildTarget StandaloneLinuxUniversal = (UnityBuildTarget) "StandaloneLinuxUniversal"; + public static UnityBuildTarget StandaloneOSX = (UnityBuildTarget) "StandaloneOSX"; + public static UnityBuildTarget StandaloneOSXIntel = (UnityBuildTarget) "StandaloneOSXIntel"; + public static UnityBuildTarget StandaloneOSXIntel64 = (UnityBuildTarget) "StandaloneOSXIntel64"; + public static UnityBuildTarget StandaloneOSXUniversal = (UnityBuildTarget) "StandaloneOSXUniversal"; + public static UnityBuildTarget StandaloneWindows = (UnityBuildTarget) "StandaloneWindows"; + public static UnityBuildTarget StandaloneWindows64 = (UnityBuildTarget) "StandaloneWindows64"; public static UnityBuildTarget Switch = (UnityBuildTarget) "Switch"; - public static UnityBuildTarget N3DS = (UnityBuildTarget) "N3DS"; + public static UnityBuildTarget Tizen = (UnityBuildTarget) "Tizen"; public static UnityBuildTarget tvOS = (UnityBuildTarget) "tvOS"; - public static UnityBuildTarget PSM = (UnityBuildTarget) "PSM"; + public static UnityBuildTarget WSAPlayer = (UnityBuildTarget) "WSAPlayer"; + public static UnityBuildTarget Web = (UnityBuildTarget) "Web"; + public static UnityBuildTarget WebGL = (UnityBuildTarget) "WebGL"; + public static UnityBuildTarget WebStreamed = (UnityBuildTarget) "WebStreamed"; + public static UnityBuildTarget WiiU = (UnityBuildTarget) "WiiU"; + public static UnityBuildTarget Win = (UnityBuildTarget) "Win"; + public static UnityBuildTarget Win64 = (UnityBuildTarget) "Win64"; + public static UnityBuildTarget WindowsStoreApps = (UnityBuildTarget) "WindowsStoreApps"; + public static UnityBuildTarget XboxOne = (UnityBuildTarget) "XboxOne"; public static implicit operator UnityBuildTarget(string value) { return new UnityBuildTarget { Value = value }; @@ -3892,3 +4555,21 @@ public static implicit operator UnityPlatformTextureFormat(string value) } } #endregion +#region UnityTestPlatform +/// +/// Used within . +/// +[PublicAPI] +[Serializable] +[ExcludeFromCodeCoverage] +[TypeConverter(typeof(TypeConverter))] +public partial class UnityTestPlatform : Enumeration +{ + public static UnityTestPlatform EditMode = (UnityTestPlatform) "EditMode"; + public static UnityTestPlatform PlayMode = (UnityTestPlatform) "PlayMode"; + public static implicit operator UnityTestPlatform(string value) + { + return new UnityTestPlatform { Value = value }; + } +} +#endregion diff --git a/source/Nuke.Common/Tools/Unity/Unity.json b/source/Nuke.Common/Tools/Unity/Unity.json index adc882ba3..deff95cd0 100644 --- a/source/Nuke.Common/Tools/Unity/Unity.json +++ b/source/Nuke.Common/Tools/Unity/Unity.json @@ -43,14 +43,8 @@ "customStart": true, "customAssertion": true, "settingsClass": { - "baseClass": "UnityBaseSettings", + "baseClass": "UnityProjectSettings", "properties": [ - { - "name": "AssetServerUpdate", - "type": "string", - "format": "-assetServerUpdate {value}", - "help": "Force an update of the project in the Asset Server given by IP:port. The port is optional, and if not given it is assumed to be the standard one (10733). It is advisable to use this command in conjunction with the -projectPath argument to ensure you are working with the correct project. If no project name is given, then the last project opened by Unity is used. If no project exists at the path given by -projectPath, then one is created automatically." - }, { "name": "BuildLinux32Player", "type": "string", @@ -87,12 +81,6 @@ "format": "-buildOSXUniversalPlayer {value}", "help": "Build a combined 32-bit and 64-bit standalone Mac OSX player (for example, -buildOSXUniversalPlayer path/to/your/build.app)." }, - { - "name": "BuildTarget", - "type": "string", - "format": "-buildTarget {value}", - "help": "Allows the selection of an active build target before a project is loaded." - }, { "name": "BuildWindowsPlayer", "type": "string", @@ -117,97 +105,12 @@ "format": "-executeMethod {value}", "help": "Execute the static method as soon as Unity is started, the project is open and after the optional Asset server update has been performed. This can be used to do tasks such as continous integration, performing Unit Tests, making builds or preparing data. To return an error from the command line process, either throw an exception which causes Unity to exit with return code 1, or call EditorApplication.Exit with a non-zero return code.To use ExecuteMethod, you need to place the enclosing script in an Editor folder. The method to be executed must be defined as static." }, - { - "name": "ForceD3d11", - "type": "bool", - "format": "-force-d3d11", - "help": "(Windows only) Make the Editor use Direct3D 11 for rendering. Normally the graphics API depends on player settings (typically defaults to D3D11)." - }, - { - "name": "ForceDeviceIndex", - "type": "bool", - "format": "-force-device-index", - "help": "(macOS only) When using Metal, make the Editor use a particular GPU device by passing it the index of that GPU." - }, - { - "name": "ForceGfxMetal", - "type": "bool", - "format": "-force-gfx-metal", - "help": "(macOS only) Make the Editor use Metal as the default graphics API." - }, - { - "name": "ForceGLCore", - "type": "bool", - "format": "-force-glcore", - "help": "(Windows only) Make the Editor use OpenGL 3/4 core profile for rendering. The Editor tries to use the best OpenGL version available and all OpenGL extensions exposed by the OpenGL drivers. If the platform isn't supported, Direct3D is used." - }, - { - "name": "ForceGLCoreXY", - "type": "UnityGLCore", - "format": "-force-glcore{value}", - "help": "(Windows only) Similar to -force-glcore, but requests a specific OpenGL context version. Accepted values for XY: 32, 33, 40, 41, 42, 43, 44 or 45." - }, - { - "name": "ForceGLES", - "type": "bool", - "format": "-force-gles", - "help": "(Windows only) Make the Editor use OpenGL for Embedded Systems for rendering. The Editor tries to use the best OpenGL ES version available, and all OpenGL ES extensions exposed by the OpenGL drivers." - }, - { - "name": "ForceGLESXY", - "type": "UnityGLES", - "format": "-force-gles{value}", - "help": "(Windows only) Similar to -force-gles, but requests a specific OpenGL ES context version. Accepted values for XY: 30, 31 or 32." - }, - { - "name": "ForceClamped", - "type": "bool", - "format": "-force-clamped", - "help": "(2017.3+) (Windows only) Used with -force-glcoreXY to prevent checking for additional OpenGL extensions, allowing it to run between platforms with the same code paths." - }, - { - "name": "ForceLowPowerDevice", - "type": "bool", - "format": "-force-low-power-device", - "help": "(macOS only) When using Metal, make the Editor use a low power device." - }, { "name": "ImportPackage", "type": "string", "format": "-importPackage {value}", "help": "Import the given package. No import dialog is shown." }, - { - "name": "DefaultPlatformTextureFormat", - "type": "string", - "format": "-setDefaultPlatformTextureFormat {value}", - "help": "(2018.1+) Sets the default texture compression to the desired format before importing a texture or building the project. This is so you don’t have to import the texture again with the format you want. The available formats are dxt, pvrtc, atc, etc, etc2, and astc. Note that this is only supported on Android." - }, - { - "name": "DisableAssemblyUpdater", - "type": "List", - "format": "-disable-assembly-updater {value}", - "separator": " ", - "help": "Specify a space-separated list of assembly names as parameters for Unity to ignore on automatic updates. The space-separated list of assembly names is optional: Pass the command line options without any assembly names to ignore all assemblies." - }, - { - "name": "CacheServerIPAddress", - "type": "string", - "format": "-cacheServerIPAddress {value}", - "help": "(2018.1+) Connect to the Cache Server given by IP:port on startup, overriding any configuration stored in the Editor Preferences. Use this to connect multiple instances of Unity to different Cache Servers." - }, - { - "name": "NoUpm", - "type": "bool", - "format": "-noUpm", - "help": "(2018.1+) Disables the Unity Package Manager." - }, - { - "name": "AcceptApiUpdate", - "type": "bool", - "format": "-accept-apiupdate", - "help": "(2017.2+) Use this command line option to specify that APIUpdater should run when Unity is launched in batch mode. Omitting this command line argument when launching Unity in batch mode results in APIUpdater not running which can lead to compiler errors. Note that in versions prior to 2017.2 there’s no way to not run APIUpdater when Unity is launched in batch mode." - }, { "name": "RunEditorTests", "type": "bool", @@ -240,25 +143,6 @@ "format": "-exportPackage {value}", "separator": " ", "help": "Export a package, given a path (or set of given paths).-exportPackage <exportAssetPath> <exportFileName> In this example exportAssetPath is a folder (relative to to the Unity project root) to export from the Unity project, and exportFileName is the package name. Currently, this option only exports whole folders at a time. You normally need to use this command with the -projectPath argument." - }, - { - "name": "CustomArguments", - "type": "List", - "format": "{value}", - "separator": " ", - "help": "Custom parameters. To pass parameters, add them to the command line and retrieve them inside the function using System.Environment.GetCommandLineArgs. " - }, - { - "name": "StackTraceLogType", - "type": "UnityStackTraceLogType", - "format": "-stackTraceLogType {value}", - "help": "Detailed debugging feature. StackTraceLogging allows you to allow detailed logging." - }, - { - "name": "ProjectPath", - "type": "string", - "format": "-projectPath {value}", - "help": "Specify the path of the unity project." } ] } @@ -273,6 +157,47 @@ "settingsClass": { "baseClass": "UnityBaseSettings" } + }, + { + "help": "(2019.2+) Run tests in the project using Unity Test Framework. This argument requires the projectPath, and it's good practice to run it with batchmode argument. quit is not required, because the Editor automatically closes down after the run is finished.", + "postfix": "RunTests", + "preProcess": true, + "customStart": true, + "customAssertion": true, + "definiteArgument": "-runTests", + "settingsClass": { + "baseClass": "UnityBaseSettings", + "properties": [ + { + "name": "TestCategories", + "type": "List", + "format": "-testCategory {value}", + "separator": ";", + "quoteMultiple": true, + "help": "A list of test categories to include in the run, or a regular expression pattern to match category names. If using both TestFilters and TestCategories, then only tests that match both are run. This argument supports negation using '!'. If using '!MyCategory' then no tests with the 'MyCategory' category will be included in the run." + }, + { + "name": "TestFilters", + "type": "List", + "format": "-testFilter {value}", + "separator": ";", + "quoteMultiple": true, + "help": "A list of test names to run, or a regular expression pattern to match tests by their full name. This argument supports negation using '!'. If using the test filter '!MyNamespace.Something.MyTest', then all tests except that test will be run. It is also possible to run a specific variation of a parameterized test like so: 'ClassName.MethodName(Param1,Param2)'." + }, + { + "name": "TestResultFile", + "type": "string", + "format": "-testResults {value}", + "help": "Path where the result file should be placed. If the path is a folder, a default file name is used. If not specified, the results are placed in the project's root folder." + }, + { + "name": "TestPlatform", + "type": "string", + "format": "-testPlatform {value}", + "help": "The platform to run tests on." + } + ] + } } ], "commonTaskProperties": [ @@ -352,32 +277,173 @@ "help": "Defines the Unity version to use. The version must be installed via Unity Hub." } ] + }, + { + "name": "UnityProjectSettings", + "baseClass": "UnityBaseSettings", + "extensionMethods": true, + "properties": [ + { + "name": "AssetServerUpdate", + "type": "string", + "format": "-assetServerUpdate {value}", + "help": "Force an update of the project in the Asset Server given by IP:port. The port is optional, and if not given it is assumed to be the standard one (10733). It is advisable to use this command in conjunction with the -projectPath argument to ensure you are working with the correct project. If no project name is given, then the last project opened by Unity is used. If no project exists at the path given by -projectPath, then one is created automatically." + }, + { + "name": "BuildTarget", + "type": "string", + "format": "-buildTarget {value}", + "help": "Allows the selection of an active build target before a project is loaded." + }, + { + "name": "ForceD3d11", + "type": "bool", + "format": "-force-d3d11", + "help": "(Windows only) Make the Editor use Direct3D 11 for rendering. Normally the graphics API depends on player settings (typically defaults to D3D11)." + }, + { + "name": "ForceDeviceIndex", + "type": "bool", + "format": "-force-device-index", + "help": "(macOS only) When using Metal, make the Editor use a particular GPU device by passing it the index of that GPU." + }, + { + "name": "ForceGfxMetal", + "type": "bool", + "format": "-force-gfx-metal", + "help": "(macOS only) Make the Editor use Metal as the default graphics API." + }, + { + "name": "ForceGLCore", + "type": "bool", + "format": "-force-glcore", + "help": "(Windows only) Make the Editor use OpenGL 3/4 core profile for rendering. The Editor tries to use the best OpenGL version available and all OpenGL extensions exposed by the OpenGL drivers. If the platform isn't supported, Direct3D is used." + }, + { + "name": "ForceGLCoreXY", + "type": "UnityGLCore", + "format": "-force-glcore{value}", + "help": "(Windows only) Similar to -force-glcore, but requests a specific OpenGL context version. Accepted values for XY: 32, 33, 40, 41, 42, 43, 44 or 45." + }, + { + "name": "ForceGLES", + "type": "bool", + "format": "-force-gles", + "help": "(Windows only) Make the Editor use OpenGL for Embedded Systems for rendering. The Editor tries to use the best OpenGL ES version available, and all OpenGL ES extensions exposed by the OpenGL drivers." + }, + { + "name": "ForceGLESXY", + "type": "UnityGLES", + "format": "-force-gles{value}", + "help": "(Windows only) Similar to -force-gles, but requests a specific OpenGL ES context version. Accepted values for XY: 30, 31 or 32." + }, + { + "name": "ForceClamped", + "type": "bool", + "format": "-force-clamped", + "help": "(2017.3+) (Windows only) Used with -force-glcoreXY to prevent checking for additional OpenGL extensions, allowing it to run between platforms with the same code paths." + }, + { + "name": "ForceLowPowerDevice", + "type": "bool", + "format": "-force-low-power-device", + "help": "(macOS only) When using Metal, make the Editor use a low power device." + }, + { + "name": "DefaultPlatformTextureFormat", + "type": "string", + "format": "-setDefaultPlatformTextureFormat {value}", + "help": "(2018.1+) Sets the default texture compression to the desired format before importing a texture or building the project. This is so you don’t have to import the texture again with the format you want. The available formats are dxt, pvrtc, atc, etc, etc2, and astc. Note that this is only supported on Android." + }, + { + "name": "DisableAssemblyUpdater", + "type": "List", + "format": "-disable-assembly-updater {value}", + "separator": " ", + "help": "Specify a space-separated list of assembly names as parameters for Unity to ignore on automatic updates. The space-separated list of assembly names is optional: Pass the command line options without any assembly names to ignore all assemblies." + }, + { + "name": "CacheServerIPAddress", + "type": "string", + "format": "-cacheServerIPAddress {value}", + "help": "(2018.1+) Connect to the Cache Server given by IP:port on startup, overriding any configuration stored in the Editor Preferences. Use this to connect multiple instances of Unity to different Cache Servers." + }, + { + "name": "NoUpm", + "type": "bool", + "format": "-noUpm", + "help": "(2018.1+) Disables the Unity Package Manager." + }, + { + "name": "AcceptApiUpdate", + "type": "bool", + "format": "-accept-apiupdate", + "help": "(2017.2+) Use this command line option to specify that APIUpdater should run when Unity is launched in batch mode. Omitting this command line argument when launching Unity in batch mode results in APIUpdater not running which can lead to compiler errors. Note that in versions prior to 2017.2 there’s no way to not run APIUpdater when Unity is launched in batch mode." + }, + { + "name": "CustomArguments", + "type": "List", + "format": "{value}", + "separator": " ", + "help": "Custom parameters. To pass parameters, add them to the command line and retrieve them inside the function using System.Environment.GetCommandLineArgs. " + }, + { + "name": "StackTraceLogType", + "type": "UnityStackTraceLogType", + "format": "-stackTraceLogType {value}", + "help": "Detailed debugging feature. StackTraceLogging allows you to allow detailed logging." + }, + { + "name": "ProjectPath", + "type": "string", + "format": "-projectPath {value}", + "help": "Specify the path of the unity project." + } + ] } ], "enumerations": [ { "name": "UnityBuildTarget", "values": [ - "standalone", - "Win", - "Win64", - "OSXUniversal", + "Android", + "Bratwurst", + "CloudRendering", + "iOS", "Linux", "Linux64", + "LinuxHeadlessSimulation", "LinuxUniversal", - "iOS", - "Android", - "Web", - "WebStreamed", - "WebGL", - "XboxOne", + "N3DS", + "OSXUniversal", "PS4", + "PS5", + "PSM", "PSP2", - "WindowsStoreApps", + "SamsungTV", + "Stadia", + "standalone", + "StandaloneLinux", + "StandaloneLinux64", + "StandaloneLinuxUniversal", + "StandaloneOSX", + "StandaloneOSXIntel", + "StandaloneOSXIntel64", + "StandaloneOSXUniversal", + "StandaloneWindows", + "StandaloneWindows64", "Switch", - "N3DS", + "Tizen", "tvOS", - "PSM" + "WSAPlayer", + "Web", + "WebGL", + "WebStreamed", + "WiiU", + "Win", + "Win64", + "WindowsStoreApps", + "XboxOne" ] }, { @@ -419,6 +485,13 @@ "etc2", "astc" ] + }, + { + "name": "UnityTestPlatform", + "values": [ + "EditMode", + "PlayMode" + ] } ] } diff --git a/source/Nuke.Common/Tools/Unity/UnitySettingsExtensions.cs b/source/Nuke.Common/Tools/Unity/UnityProjectSettingsExtensions.cs similarity index 56% rename from source/Nuke.Common/Tools/Unity/UnitySettingsExtensions.cs rename to source/Nuke.Common/Tools/Unity/UnityProjectSettingsExtensions.cs index 526003565..dfa84db84 100644 --- a/source/Nuke.Common/Tools/Unity/UnitySettingsExtensions.cs +++ b/source/Nuke.Common/Tools/Unity/UnityProjectSettingsExtensions.cs @@ -9,13 +9,13 @@ namespace Nuke.Common.Tools.Unity; -public static partial class UnitySettingsExtensions +public static partial class UnityProjectSettingsExtensions { #region BuildTarget - ///

    Sets .

    Allows the selection of an active build target before a project is loaded.

    + ///

    Sets .

    Allows the selection of an active build target before a project is loaded.

    [Pure] - public static UnitySettings SetBuildTarget(this UnitySettings toolSettings, UnityBuildTarget buildTarget) + public static UnityProjectSettings SetBuildTarget(this UnityProjectSettings toolSettings, UnityBuildTarget buildTarget) { toolSettings = toolSettings.NewInstance(); toolSettings.BuildTarget = buildTarget.ToString(); diff --git a/source/Nuke.Common/Tools/Unity/UnityRunTestsSettingsExtensions.cs b/source/Nuke.Common/Tools/Unity/UnityRunTestsSettingsExtensions.cs new file mode 100644 index 000000000..e603ea4b7 --- /dev/null +++ b/source/Nuke.Common/Tools/Unity/UnityRunTestsSettingsExtensions.cs @@ -0,0 +1,41 @@ +// Copyright 2023 Maintainers of NUKE. +// Distributed under the MIT License. +// https://github.com/nuke-build/nuke/blob/master/LICENSE + +using System; +using System.Linq; +using JetBrains.Annotations; +using Nuke.Common.Tooling; + +namespace Nuke.Common.Tools.Unity; + +public static partial class UnityRunTestsSettingsExtensions +{ + #region TestPlatform + + /// + ///

    Sets

    + ///

    The platform to run tests on.

    + ///
    + [Pure] + public static UnityRunTestsSettings SetTestPlatform(this UnityRunTestsSettings toolSettings, UnityTestPlatform testPlatform) + { + toolSettings = toolSettings.NewInstance(); + toolSettings.TestPlatform = testPlatform.ToString(); + return toolSettings; + } + + /// + ///

    Sets

    + ///

    The platform to run tests on.

    + ///
    + [Pure] + public static UnityRunTestsSettings SetTestPlatform(this UnityRunTestsSettings toolSettings, UnityBuildTarget buildTarget) + { + toolSettings = toolSettings.NewInstance(); + toolSettings.TestPlatform = buildTarget.ToString(); + return toolSettings; + } + + #endregion +} diff --git a/source/Nuke.Common/Tools/Unity/UnityTasks.cs b/source/Nuke.Common/Tools/Unity/UnityTasks.cs index e7f9b933d..d6515312f 100644 --- a/source/Nuke.Common/Tools/Unity/UnityTasks.cs +++ b/source/Nuke.Common/Tools/Unity/UnityTasks.cs @@ -78,8 +78,8 @@ private static void DetectUnityVersion(ref UnitySettings unitySettings) return; var editorVersion = ReadUnityEditorVersion(unitySettings.ProjectPath); - var hubToolPath = GetToolPathViaHubVersion(editorVersion); - if (hubToolPath.Exists()) + var unityExecutable = GetToolPathViaHubVersion(editorVersion); + if (unityExecutable.Exists()) { unitySettings.HubVersion = editorVersion; return; diff --git a/source/Nuke.Components/ICreateGitHubRelease.cs b/source/Nuke.Components/ICreateGitHubRelease.cs index cb5911c6a..d9ceb75ae 100644 --- a/source/Nuke.Components/ICreateGitHubRelease.cs +++ b/source/Nuke.Components/ICreateGitHubRelease.cs @@ -33,6 +33,7 @@ public interface ICreateGitHubRelease : IHazGitRepository, IHazChangelog IEnumerable AssetFiles { get; } Target CreateGitHubRelease => _ => _ + .Requires(() => GitHubToken) .Executes(async () => { GitHubTasks.GitHubClient.Credentials ??= new Credentials(GitHubToken.NotNull()); diff --git a/source/Nuke.GlobalTool/templates/_build.csproj b/source/Nuke.GlobalTool/templates/_build.csproj index 0778260cb..23c2cc858 100644 --- a/source/Nuke.GlobalTool/templates/_build.csproj +++ b/source/Nuke.GlobalTool/templates/_build.csproj @@ -4,10 +4,11 @@ Exe _TARGET_FRAMEWORK_ - CS0649;CS0169 + CS0649;CS0169;CA1050;CA1822;CA2211;IDE1006 _ROOT_DIRECTORY_ _SCRIPT_DIRECTORY_ _TELEMETRY_VERSION_ + false diff --git a/source/Nuke.GlobalTool/templates/build.sh b/source/Nuke.GlobalTool/templates/build.sh index 199863258..9f459d316 100644 --- a/source/Nuke.GlobalTool/templates/build.sh +++ b/source/Nuke.GlobalTool/templates/build.sh @@ -58,7 +58,7 @@ fi echo "Microsoft (R) .NET SDK version $("$DOTNET_EXE" --version)" -if [[ ! -z ${NUKE_ENTERPRISE_TOKEN+x} && "NUKE_ENTERPRISE_TOKEN" != "" ]]; then +if [[ ! -z ${NUKE_ENTERPRISE_TOKEN+x} && "$NUKE_ENTERPRISE_TOKEN" != "" ]]; then "$DOTNET_EXE" nuget remove source "nuke-enterprise" &>/dev/null || true "$DOTNET_EXE" nuget add source "https://f.feedz.io/nuke/enterprise/nuget" --name "nuke-enterprise" --username "PAT" --password "$NUKE_ENTERPRISE_TOKEN" --store-password-in-clear-text &>/dev/null || true fi diff --git a/source/Nuke.SolutionModel/Project.cs b/source/Nuke.SolutionModel/Project.cs index dd37fff4f..2082b72ff 100644 --- a/source/Nuke.SolutionModel/Project.cs +++ b/source/Nuke.SolutionModel/Project.cs @@ -14,7 +14,7 @@ namespace Nuke.Common.ProjectModel; /// Represents a project. ///
    [PublicAPI] -public class Project : PrimitiveProject +public class Project : PrimitiveProject, IAbsolutePathHolder { private readonly Func _pathProvider; diff --git a/source/Nuke.SolutionModel/Solution.cs b/source/Nuke.SolutionModel/Solution.cs index ed1090cbc..20fb06873 100644 --- a/source/Nuke.SolutionModel/Solution.cs +++ b/source/Nuke.SolutionModel/Solution.cs @@ -17,7 +17,7 @@ namespace Nuke.Common.ProjectModel; /// Represents a solution file (*.sln). ///
    [PublicAPI] -public class Solution +public class Solution : IAbsolutePathHolder { internal List PrimitiveProjects { get; } = new(); internal Dictionary PrimitiveProjectParents { get; } = new(); diff --git a/source/Nuke.SourceGenerators/StronglyTypedSolutionGenerator.cs b/source/Nuke.SourceGenerators/StronglyTypedSolutionGenerator.cs index 922e5823e..25a8fba70 100644 --- a/source/Nuke.SourceGenerators/StronglyTypedSolutionGenerator.cs +++ b/source/Nuke.SourceGenerators/StronglyTypedSolutionGenerator.cs @@ -28,23 +28,49 @@ public void Initialize(GeneratorInitializationContext context) public void Execute(GeneratorExecutionContext context) { - var compilation = context.Compilation; + try + { + if (GenerateSolutionSource(context.Compilation) is { Length: > 0 } generatedSource) + { + context.AddSource(nameof(StronglyTypedSolutionGenerator), generatedSource); + } + } + catch (Exception exception) + { + var diagnostic = Diagnostic.Create( + "NUKE001", + nameof(StronglyTypedSolutionGenerator), + exception.Message, + DiagnosticSeverity.Error, + DiagnosticSeverity.Error, + isEnabledByDefault: true, + warningLevel: 0); + context.ReportDiagnostic(diagnostic); + } + } + + private string GenerateSolutionSource(Compilation compilation) + { var allTypes = compilation.Assembly.GlobalNamespace.GetAllTypes(); var members = allTypes.SelectMany(x => x.GetMembers()) - .Where(x => x is IPropertySymbol || x is IFieldSymbol) + .Where(x => x is IPropertySymbol or IFieldSymbol) .Select(x => (Member: x, AttributeData: x.GetAttributeData("global::Nuke.Common.ProjectModel.SolutionAttribute"))) .Where(x => x.AttributeData?.NamedArguments.SingleOrDefault(x => x.Key == "GenerateProjects").Value.Value as bool? ?? false) - .Select(x => x.Member).ToList(); + .ToList(); + if (members.Count == 0) - return; + return null; var rootDirectory = GetRootDirectoryFrom(compilation); var compilationUnit = CompilationUnit() .AddUsings(UsingDirective(IdentifierName("Nuke.Common.ProjectModel"))); - foreach (var member in members) + foreach (var (member, attributeData) in members) { - var solutionFile = GetSolutionFileFromParametersFile(rootDirectory, member.Name); + var solutionFile = attributeData.ConstructorArguments.FirstOrDefault().Value is string { Length: > 0 } relativeSlnPath + ? rootDirectory / relativeSlnPath + : GetSolutionFileFromParametersFile(rootDirectory, member.Name); + var solution = SolutionSerializer.DeserializeFromFile(solutionFile); var classDeclaration = GetSolutionFolderDeclaration(member.Name, solution.SolutionFolders, solution.Projects, isSolution: true); @@ -55,11 +81,10 @@ public void Execute(GeneratorExecutionContext context) : classDeclaration); } - var source = compilationUnit + return compilationUnit .WithLeadingTrivia(ParseLeadingTrivia($"/// {Environment.NewLine}")) .NormalizeWhitespace() .ToFullString(); - context.AddSource(nameof(StronglyTypedSolutionGenerator), source); } [CanBeNull] @@ -104,13 +129,13 @@ MemberDeclarationSyntax GetSolutionFolderProperty(string name) .ToArray()); } - private static string GetSolutionFileFromParametersFile(AbsolutePath rootDirectory, string memberName) + private static AbsolutePath GetSolutionFileFromParametersFile(AbsolutePath rootDirectory, string memberName) { var parametersFile = Constants.GetDefaultParametersFile(rootDirectory); Assert.FileExists(parametersFile); var jobject = JObject.Parse(File.ReadAllText(parametersFile)); var solutionRelativePath = jobject[memberName].NotNull($"Property '{memberName}' does not exist in '{parametersFile}'.").Value(); - return Path.Combine(rootDirectory, solutionRelativePath.NotNull()); + return rootDirectory / solutionRelativePath.NotNull(); } private static AbsolutePath GetRootDirectoryFrom(Compilation compilation) diff --git a/source/Nuke.Tooling.Tests/ArgumentStringHandlerTest.cs b/source/Nuke.Tooling.Tests/ArgumentStringHandlerTest.cs index f30a9ee54..5c805299a 100644 --- a/source/Nuke.Tooling.Tests/ArgumentStringHandlerTest.cs +++ b/source/Nuke.Tooling.Tests/ArgumentStringHandlerTest.cs @@ -45,6 +45,18 @@ public void TestAbsolutePath(string path, string expected) ArgsToString($"start {(AbsolutePath)path} end").Should().Be(expected); } + [Fact] + public void TestAbsolutePathCollection() + { + var paths = new AbsolutePath[] + { + "C:\\foo\\bar", + "/foo bar/foo" + }; + ArgsToString($"start {paths} end").Should().Be("start C:\\foo\\bar \"/foo bar/foo\" end"); + ArgsToString($"start {paths:sn} end").Should().Be("start C:\\foo\\bar '/foo bar/foo' end"); + } + [Fact] public void TestFormat() { diff --git a/source/Nuke.Tooling/ArgumentStringHandler.cs b/source/Nuke.Tooling/ArgumentStringHandler.cs index be76b5a07..c85f86fc0 100644 --- a/source/Nuke.Tooling/ArgumentStringHandler.cs +++ b/source/Nuke.Tooling/ArgumentStringHandler.cs @@ -43,22 +43,39 @@ public void AppendLiteral(string value) public void AppendFormatted(object obj, int alignment = 0, string format = null) { - AppendFormatted(obj.ToString(), alignment, format); + if (obj is string value) + { + if (format == "r") + _secretValues.Add(value); + else if (!(value.IsDoubleQuoted() || value.IsSingleQuoted() || format == "nq")) + (value, format) = (value.DoubleQuoteIfNeeded(), null); + AppendFormatted(value, alignment, format); + } + else if (obj is IAbsolutePathHolder holder) + AppendFormatted(holder, alignment, format); + else + AppendFormatted(obj.ToString(), alignment, format); } - public void AppendFormatted(string value, int alignment = 0, string format = null) + private void AppendFormatted(string value, int alignment, string format) { - if (format == "r") - _secretValues.Add(value); - else if (!(value.IsDoubleQuoted() || value.IsSingleQuoted() || format == "nq")) - (value, format) = (value.DoubleQuoteIfNeeded(), null); - _builder.AppendFormatted(value, alignment, format); } - public void AppendFormatted(AbsolutePath path, int alignment = 0, string format = null) + private void AppendFormatted(IAbsolutePathHolder holder, int alignment, string format) + { + _builder.AppendFormatted(holder.Path, alignment, format ?? AbsolutePath.DoubleQuoteIfNeeded); + } + + public void AppendFormatted(IEnumerable paths, int alignment = 0, string format = null) { - _builder.AppendFormatted(path, alignment, format ?? "dn"); + var list = paths.ToList(); + for (var i = 0; i < list.Count; i++) + { + _builder.AppendFormatted(list[i], alignment, format ?? AbsolutePath.DoubleQuoteIfNeeded); + if (i + 1 < list.Count) + _builder.AppendLiteral(" "); + } } public string ToStringAndClear() diff --git a/source/Nuke.Tooling/ProcessTasks.cs b/source/Nuke.Tooling/ProcessTasks.cs index 2b98b52b5..56ee56122 100644 --- a/source/Nuke.Tooling/ProcessTasks.cs +++ b/source/Nuke.Tooling/ProcessTasks.cs @@ -13,6 +13,7 @@ using Nuke.Common.Utilities; using Nuke.Common.Utilities.Collections; using Serilog; +using Serilog.Events; namespace Nuke.Common.Tooling; @@ -22,8 +23,10 @@ public static class ProcessTasks public static bool DefaultLogOutput = true; public static bool DefaultLogInvocation = true; public static bool LogWorkingDirectory = true; + public static string DefaultWorkingDirectory = EnvironmentInfo.WorkingDirectory; private static readonly char[] s_pathSeparators = { EnvironmentInfo.IsWin ? ';' : ':' }; + private static readonly object s_lock = new(); public static IProcess StartShell( string command, @@ -112,25 +115,17 @@ public static IProcess StartProcess( toolPath = toolPathOverride; } - outputFilter ??= x => x; - Assert.FileExists(toolPath); - if (logInvocation ?? DefaultLogInvocation) - { - // TODO: logging additional - Log.Information("> {ToolPath} {Arguments}", Path.GetFullPath(toolPath).DoubleQuoteIfNeeded(), outputFilter(arguments)); - if (LogWorkingDirectory && workingDirectory != null) - Log.Information("@ {WorkingDirectory}", workingDirectory); - } - - return StartProcessInternal(toolPath, - arguments, - workingDirectory, + return StartProcessInternal( + toolPath, + arguments ?? string.Empty, + workingDirectory ?? DefaultWorkingDirectory, environmentVariables, timeout, + logInvocation ?? DefaultLogInvocation, logOutput ?? DefaultLogOutput ? logger ?? DefaultLogger : null, - outputFilter); + outputFilter ?? (x => x)); } [CanBeNull] @@ -154,20 +149,22 @@ private static string GetToolPathOverride(string toolPath) [CanBeNull] private static IProcess StartProcessInternal( string toolPath, - [CanBeNull] string arguments, - [CanBeNull] string workingDirectory, + string arguments, + string workingDirectory, [CanBeNull] IReadOnlyDictionary environmentVariables, int? timeout, + bool logInvocation, [CanBeNull] Action logger, Func outputFilter) { - Assert.True(workingDirectory == null || Directory.Exists(workingDirectory), $"WorkingDirectory '{workingDirectory}' does not exist"); + Assert.FileExists(toolPath); + Assert.DirectoryExists(workingDirectory); var startInfo = new ProcessStartInfo { FileName = toolPath, - Arguments = arguments ?? string.Empty, - WorkingDirectory = workingDirectory ?? EnvironmentInfo.WorkingDirectory, + Arguments = arguments , + WorkingDirectory = workingDirectory, RedirectStandardOutput = true, RedirectStandardError = true, UseShellExecute = false, @@ -175,8 +172,15 @@ private static IProcess StartProcessInternal( StandardOutputEncoding = Encoding.UTF8 }; - ApplyEnvironmentVariables(environmentVariables, startInfo); - // PrintEnvironmentVariables(startInfo); + if (environmentVariables != null) + { + startInfo.Environment.Clear(); + foreach (var (key, value) in environmentVariables) + startInfo.Environment[key] = value; + } + + if (logInvocation) + LogInvocation(startInfo, outputFilter, environmentVariables != null); var process = Process.Start(startInfo); if (process == null) @@ -186,17 +190,26 @@ private static IProcess StartProcessInternal( return new Process2(process, outputFilter, timeout, output); } - private static void ApplyEnvironmentVariables( - [CanBeNull] IReadOnlyDictionary environmentVariables, - ProcessStartInfo startInfo) + private static void LogInvocation(ProcessStartInfo startInfo, Func outputFilter, bool hasEnvironmentVariables) { - if (environmentVariables == null) - return; + lock (s_lock) + { + // TODO: logging additional + Log.Information("> {ToolPath} {Arguments}", startInfo.FileName.DoubleQuoteIfNeeded(), outputFilter(startInfo.Arguments)); - startInfo.Environment.Clear(); + if (LogWorkingDirectory) + { + Log.Write( + startInfo.WorkingDirectory != DefaultWorkingDirectory + ? LogEventLevel.Information + : LogEventLevel.Verbose, + "@ {WorkingDirectory}", + startInfo.WorkingDirectory); + } - foreach (var (key, value) in environmentVariables) - startInfo.Environment[key] = value; + // if (hasEnvironmentVariables) + // PrintEnvironmentVariables(startInfo.Environment); + } } private static BlockingCollection GetOutputCollection( @@ -211,9 +224,8 @@ private static BlockingCollection GetOutputCollection( if (e.Data == null) return; - output.Add(new Output { Text = e.Data, Type = OutputType.Std }); - var filteredOutput = outputFilter(e.Data); + output.Add(new Output { Text = filteredOutput, Type = OutputType.Std }); logger?.Invoke(OutputType.Std, filteredOutput); }; process.ErrorDataReceived += (_, e) => @@ -221,9 +233,8 @@ private static BlockingCollection GetOutputCollection( if (e.Data == null) return; - output.Add(new Output { Text = e.Data, Type = OutputType.Err }); - var filteredOutput = outputFilter(e.Data); + output.Add(new Output { Text = filteredOutput, Type = OutputType.Err }); logger?.Invoke(OutputType.Err, filteredOutput); }; @@ -246,28 +257,28 @@ public static void DefaultExitHandler(ToolSettings toolSettings, IProcess proces process.AssertZeroExitCode(); } - private static void PrintEnvironmentVariables(ProcessStartInfo startInfo) + public static void PrintEnvironmentVariables() { - static void TraceItem(string key, string value) => Log.Verbose($" - {key} = {value}"); - - // TODO: logging additional - Log.Verbose("Environment variables:"); + PrintEnvironmentVariables(EnvironmentInfo.Variables.ToDictionary(x => x.Key, x => x.Value)); + } - foreach (var (key, value) in startInfo.Environment.OrderBy(x => x.Key, StringComparer.OrdinalIgnoreCase)) + private static void PrintEnvironmentVariables(IDictionary environmentVariables) + { + static IEnumerable<(string Key, string Value)> Split(KeyValuePair pair) { - if (key.EqualsOrdinalIgnoreCase("path")) - { - var paths = value.Split(s_pathSeparators); - var padding = paths.Length.ToString().Length; + var values = pair.Value.Split(s_pathSeparators, StringSplitOptions.RemoveEmptyEntries); + var padding = values.Length.ToString().Length; - for (var i = 0; i < paths.Length; i++) - TraceItem($"{key}[{i.ToString().PadLeft(padding, paddingChar: '0')}]", paths[i]); - } - else - { - TraceItem(key, value); - } + return values.Length == 1 + ? new[] { (pair.Key, values.Single()) } + : values.Select((x, i) => ($"{pair.Key}[{i.ToString().PadLeft(padding, paddingChar: '0')}]", x)); } + + // TODO: logging additional + environmentVariables + .SelectMany(Split) + .OrderBy(x => x.Key, StringComparer.OrdinalIgnoreCase) + .ForEach(x => Log.Verbose("$ {Key} = {Value}", x.Key, x.Value)); } public static void CheckPathEnvironmentVariable() diff --git a/source/Nuke.Utilities/IO/AbsolutePath.cs b/source/Nuke.Utilities/IO/AbsolutePath.cs index 2b35837ed..f0c5aa4bc 100644 --- a/source/Nuke.Utilities/IO/AbsolutePath.cs +++ b/source/Nuke.Utilities/IO/AbsolutePath.cs @@ -22,7 +22,7 @@ namespace Nuke.Common.IO; [Serializable] [TypeConverter(typeof(TypeConverter))] [DebuggerDisplay("{" + nameof(_path) + "}")] -public class AbsolutePath : IFormattable +public class AbsolutePath : IAbsolutePathHolder, IFormattable { public const string DoubleQuote = "d"; public const string DoubleQuoteIfNeeded = "dn"; @@ -65,6 +65,8 @@ private AbsolutePath(string path) _path = NormalizePath(path); } + AbsolutePath IAbsolutePathHolder.Path => this; + [ContractAnnotation("null => null")] public static implicit operator AbsolutePath([CanBeNull] string path) { diff --git a/source/Nuke.Utilities/IO/IAbsolutePathHolder.cs b/source/Nuke.Utilities/IO/IAbsolutePathHolder.cs new file mode 100644 index 000000000..2da9b97a4 --- /dev/null +++ b/source/Nuke.Utilities/IO/IAbsolutePathHolder.cs @@ -0,0 +1,13 @@ +// Copyright 2023 Maintainers of NUKE. +// Distributed under the MIT License. +// https://github.com/nuke-build/nuke/blob/master/LICENSE + +using System; +using System.Linq; + +namespace Nuke.Common.IO; + +public interface IAbsolutePathHolder +{ + AbsolutePath Path { get; } +}