Skip to content

Commit

Permalink
com.utilities.buildpipeline 1.5.0 (#37)
Browse files Browse the repository at this point in the history
- added WSAPlayerBuildInfo
- added Universal Windows Platform command line args
  • Loading branch information
StephenHodgson authored Sep 7, 2024
1 parent 844bc1a commit c3b02dc
Show file tree
Hide file tree
Showing 7 changed files with 142 additions and 29 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,3 +185,14 @@ Works for any Apple Platform Target: MacOS, iOS, tvOS, and visionOS.
| Argument | Description |
| -------- | ----------- |
| `-arch` | Sets the build architecture. Can be: `x64`, `arm64`, or `x64arm64`. |

##### Windows Universal Platform Command Line Arguments

| Argument | Description |
| -------- | ----------- |
| `-arch` | Sets the build architecture. Can be: `x64`, `x86`, `ARM`, or `ARM64`. |
| `-wsaUWPBuildType` | Sets the output build type when building to Universal Windows Platform. Can be: `XAML`, `D3D`, or `ExecutableOnly`. |
| `-wsaSetDeviceFamily` | Sets the device family. Can be: `Desktop`, `Mobile`, `Xbox`, `Holographic`, `Team`, `IOT`, or `IoTHeadless`. |
| `-wsaUWPSDK` | Sets the UWP SDK Version to build for. |
| `-wsaMinUWPSDK` | Sets the min UWP SDK to build for. |
| `-wsaCertificate` | Sets the signing certificate. Must pass the path and password together. `-wsaCertificate "path/to/cert.pfx" myP@55w0rd` |
Original file line number Diff line number Diff line change
Expand Up @@ -185,3 +185,14 @@ Works for any Apple Platform Target: MacOS, iOS, tvOS, and visionOS.
| Argument | Description |
| -------- | ----------- |
| `-arch` | Sets the build architecture. Can be: `x64`, `arm64`, or `x64arm64`. |

##### Windows Universal Platform Command Line Arguments

| Argument | Description |
| -------- | ----------- |
| `-arch` | Sets the build architecture. Can be: `x64`, `x86`, `ARM`, or `ARM64`. |
| `-wsaUWPBuildType` | Sets the output build type when building to Universal Windows Platform. Can be: `XAML`, `D3D`, or `ExecutableOnly`. |
| `-wsaSetDeviceFamily` | Sets the device family. Can be: `Desktop`, `Mobile`, `Xbox`, `Holographic`, `Team`, `IOT`, or `IoTHeadless`. |
| `-wsaUWPSDK` | Sets the UWP SDK Version to build for. |
| `-wsaMinUWPSDK` | Sets the min UWP SDK to build for. |
| `-wsaCertificate` | Sets the signing certificate. Must pass the path and password together. `-wsaCertificate "path/to/cert.pfx" myP@55w0rd` |
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;
}
}
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -52,34 +52,10 @@ public static IBuildInfo BuildInfo
case BuildTarget.iOS:
buildInfoInstance = new IOSBuildInfo();
break;
case BuildTarget.WSAPlayer:
buildInfoInstance = new WSAPlayerBuildInfo();
break;
// TODO: Add additional platform specific build info classes as needed
//case BuildTarget.StandaloneWindows:
//case BuildTarget.StandaloneWindows64:
// break;
//case BuildTarget.WebGL:
// break;
//case BuildTarget.WSAPlayer:
// break;
//case BuildTarget.StandaloneLinux64:
// break;
//case BuildTarget.PS4:
// break;
//case BuildTarget.XboxOne:
// break;
//case BuildTarget.tvOS:
// break;
//case BuildTarget.Switch:
// break;
//case BuildTarget.Lumin:
// break;
//case BuildTarget.Stadia:
// break;
//case BuildTarget.GameCoreXboxOne:
// break;
//case BuildTarget.PS5:
// break;
//case BuildTarget.EmbeddedLinux:
// break;
default:
buildInfoInstance = new BuildInfo();
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "Utilities.BuildPipeline",
"description": "The Build Pipeline Utilities aims to give developers more tools and options when making builds with the command line or with continuous integration.",
"keywords": [],
"version": "1.4.7",
"version": "1.5.0",
"unity": "2019.4",
"documentationUrl": "https://github.com/RageAgainstThePixel/com.utilities.buildpipeine#documentation",
"changelogUrl": "https://github.com/RageAgainstThePixel/com.utilities.buildpipeine/releases",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ PlayerSettings:
Android: com.utilities.buildpipeline
Lumin: com.utilities.BuildPipeline
Standalone: com.utilities.buildpipeline
Windows Store Apps: com.utilities.buildpipeline
iPhone: com.utilities.buildpipeline
buildNumber:
Standalone: 0
Expand Down Expand Up @@ -792,7 +793,7 @@ PlayerSettings:
Windows Store Apps: 6
m_RenderingPath: 1
m_MobileRenderingPath: 1
metroPackageName: com.utilties.dummy
metroPackageName: com.utilities.buildpipeline
metroPackageVersion: 1.0.0.0
metroCertificatePath:
metroCertificatePassword:
Expand Down

0 comments on commit c3b02dc

Please sign in to comment.