generated from RageAgainstThePixel/upm-template
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
com.utilities.buildpipeline 1.5.0 (#37)
- added WSAPlayerBuildInfo - added Universal Windows Platform command line args
- Loading branch information
1 parent
844bc1a
commit c3b02dc
Showing
7 changed files
with
142 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
103 changes: 103 additions & 0 deletions
103
...BuildPipeline/Packages/com.utilities.buildpipeline/Editor/Platforms/WSAPlayerBuildInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
// Licensed under the MIT License. See LICENSE in the project root for license information. | ||
|
||
using System; | ||
using UnityEditor; | ||
using UnityEngine; | ||
|
||
namespace Utilities.Editor.BuildPipeline | ||
{ | ||
public class WSAPlayerBuildInfo : BuildInfo | ||
{ | ||
/// <inheritdoc /> | ||
public override BuildTarget BuildTarget => BuildTarget.WSAPlayer; | ||
|
||
/// <inheritdoc /> | ||
public override BuildTargetGroup BuildTargetGroup => BuildTargetGroup.WSA; | ||
|
||
/// <inheritdoc /> | ||
public override string FullOutputPath => OutputDirectory; | ||
|
||
/// <inheritdoc /> | ||
public override void ParseCommandLineArgs() | ||
{ | ||
base.ParseCommandLineArgs(); | ||
var arguments = Environment.GetCommandLineArgs(); | ||
|
||
for (int i = 0; i < arguments.Length; ++i) | ||
{ | ||
switch (arguments[i]) | ||
{ | ||
case "-arch": | ||
var arch = arguments[++i]; | ||
|
||
if (!string.IsNullOrWhiteSpace(arch)) | ||
{ | ||
EditorUserBuildSettings.wsaArchitecture = arch; | ||
} | ||
else | ||
{ | ||
Debug.LogError($"Failed to parse -arch \"{arguments[i]}\""); | ||
} | ||
break; | ||
#if !UNITY_2021_1_OR_NEWER | ||
case "-wsaSubtarget": | ||
if (Enum.TryParse<WSASubtarget>(arguments[++i], out var subTarget)) | ||
{ | ||
EditorUserBuildSettings.wsaSubtarget = subTarget; | ||
} | ||
else | ||
{ | ||
Debug.LogError($"Failed to parse -wsaSubtarget \"{arguments[i]}\""); | ||
} | ||
break; | ||
#endif | ||
case "-wsaUWPBuildType": | ||
if (Enum.TryParse<WSAUWPBuildType>(arguments[++i], out var buildType)) | ||
{ | ||
EditorUserBuildSettings.wsaUWPBuildType = buildType; | ||
} | ||
else | ||
{ | ||
Debug.LogError($"Failed to parse -wsaUWPBuildType \"{arguments[i]}\""); | ||
} | ||
break; | ||
case "-wsaSetDeviceFamily": | ||
if (Enum.TryParse<PlayerSettings.WSATargetFamily>(arguments[++i], out var family)) | ||
{ | ||
PlayerSettings.WSA.SetTargetDeviceFamily(family, true); | ||
} | ||
else | ||
{ | ||
Debug.LogError($"Failed to parse -wsaSetDeviceFamily \"{arguments[i]}\""); | ||
} | ||
break; | ||
case "-wsaUWPSDK": | ||
EditorUserBuildSettings.wsaUWPSDK = arguments[++i]; | ||
break; | ||
case "-wsaMinUWPSDK": | ||
EditorUserBuildSettings.wsaMinUWPSDK = arguments[++i]; | ||
break; | ||
case "-wsaCertificate": | ||
var path = arguments[++i]; | ||
|
||
if (string.IsNullOrWhiteSpace(path)) | ||
{ | ||
Debug.LogError("Failed to parse -wsaCertificate. Missing path!"); | ||
break; | ||
} | ||
|
||
var password = arguments[++i]; | ||
|
||
if (string.IsNullOrWhiteSpace(password)) | ||
{ | ||
Debug.LogError("Failed to parse -wsaCertificate. Missing password!"); | ||
break; | ||
} | ||
|
||
PlayerSettings.WSA.SetCertificate(path, password); | ||
break; | ||
} | ||
} | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
...Pipeline/Packages/com.utilities.buildpipeline/Editor/Platforms/WSAPlayerBuildInfo.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters