Skip to content

Commit

Permalink
Merge pull request #343 from immutable/test/ios-builder-host
Browse files Browse the repository at this point in the history
[DX-3432] test: ability to specify host for mobile builder
  • Loading branch information
nattb8 authored Nov 5, 2024
2 parents e5ec4ad + a9e1371 commit c2a7363
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 8 deletions.
15 changes: 14 additions & 1 deletion sample/Assets/Editor/MobileBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,19 @@ private static BuildTarget GetPlatformFromArgs()
return BuildTarget.Android; // Default to Android if no platform is specified
}

private static string GetAltTesterHostFromArgs()
{
string[] args = Environment.GetCommandLineArgs();
for (int i = 0; i < args.Length; i++)
{
if (args[i] == "--host" && i + 1 < args.Length)
{
return args[i + 1];
}
}
return null;
}

private static BuildPlayerOptions CreateBuildPlayerOptions(string buildPath, BuildOptions buildOptions, BuildTarget platform)
{
return new BuildPlayerOptions
Expand Down Expand Up @@ -106,7 +119,7 @@ private static void SetupAltTester(BuildPlayerOptions buildPlayerOptions, BuildT
AltBuilder.CreateJsonFileForInputMappingOfAxis();

var instrumentationSettings = new AltInstrumentationSettings();
var host = System.Environment.GetEnvironmentVariable("ALTSERVER_HOST");
var host = System.Environment.GetEnvironmentVariable("ALTSERVER_HOST") ?? GetAltTesterHostFromArgs();
if (!string.IsNullOrEmpty(host))
{
instrumentationSettings.AltServerHost = host;
Expand Down
12 changes: 6 additions & 6 deletions sample/Assets/Scenes/SelectAuthMethod.unity
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ MonoBehaviour:
m_TargetGraphic: {fileID: 416242725}
m_HandleRect: {fileID: 416242724}
m_Direction: 0
m_Value: 0
m_Value: 1
m_Size: 0.9999999
m_NumberOfSteps: 0
m_OnValueChanged:
Expand Down Expand Up @@ -1323,7 +1323,7 @@ MonoBehaviour:
m_TargetGraphic: {fileID: 167431872}
m_HandleRect: {fileID: 167431871}
m_Direction: 2
m_Value: 0
m_Value: 1
m_Size: 1
m_NumberOfSteps: 0
m_OnValueChanged:
Expand Down Expand Up @@ -1673,8 +1673,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 1259.3727, y: 0}
m_SizeDelta: {x: 2478.7454, y: 0}
m_AnchoredPosition: {x: 1161.847, y: 0}
m_SizeDelta: {x: 2283.694, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1661390145
MonoBehaviour:
Expand Down Expand Up @@ -1768,8 +1768,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 1259.3727, y: 0}
m_SizeDelta: {x: 2478.7454, y: 0}
m_AnchoredPosition: {x: 1161.847, y: 0}
m_SizeDelta: {x: 2283.694, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1688502349
MonoBehaviour:
Expand Down
2 changes: 1 addition & 1 deletion sample/ProjectSettings/ProjectSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,7 @@ PlayerSettings:
WebGL: 1
Windows Store Apps: 1
XboxOne: 1
iPhone: 3
iPhone: 4
tvOS: 1
incrementalIl2cppBuild: {}
suppressCommonWarnings: 1
Expand Down

0 comments on commit c2a7363

Please sign in to comment.