[xharness] Don't depend on the Harness.Mac value except to determine what to configure.
Currently we execute most of the same logic both during the configure phase and when running tests, and the Harness.Mac value is only set in the configure phase. While it doesn't matter right now, this makes sure there aren't any future surprises in this area, since otherwise we could end up with different behavior between the configure phase and when running tests.
This commit is contained in:
Родитель
4893a4a1f5
Коммит
4c990affe7
|
@ -186,5 +186,13 @@ namespace xharness
|
|||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void PostProcessExecutableProject ()
|
||||
{
|
||||
base.PostProcessExecutableProject ();
|
||||
|
||||
ProjectGuid = "{" + Harness.NewStableGuid ().ToString ().ToUpper () + "}";
|
||||
inputProject.SetProjectGuid (ProjectGuid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -120,27 +120,18 @@ namespace xharness
|
|||
protected void CreateExecutableProject ()
|
||||
{
|
||||
ProcessProject ();
|
||||
if (Harness.Mac) {
|
||||
ProjectGuid = "{" + Harness.NewStableGuid ().ToString ().ToUpper () + "}";
|
||||
inputProject.SetProjectGuid (ProjectGuid);
|
||||
} else {
|
||||
inputProject.FixArchitectures (SimulatorArchitectures, DeviceArchitectures);
|
||||
inputProject.FixInfoPListInclude (Suffix);
|
||||
inputProject.SetExtraLinkerDefs ("extra-linker-defs" + ExtraLinkerDefsSuffix + ".xml");
|
||||
}
|
||||
PostProcessExecutableProject ();
|
||||
Harness.Save (inputProject, ProjectPath);
|
||||
|
||||
if (!Harness.Mac) {
|
||||
ProjectGuid = inputProject.GetProjectGuid ();
|
||||
UpdateInfoPList ();
|
||||
}
|
||||
|
||||
XmlDocument info_plist = new XmlDocument ();
|
||||
var target_info_plist = Path.Combine (TargetDirectory, "Info" + Suffix + ".plist");
|
||||
info_plist.LoadWithoutNetworkAccess (Path.Combine (TargetDirectory, "Info.plist"));
|
||||
BundleIdentifier = info_plist.GetCFBundleIdentifier ();
|
||||
info_plist.SetMinimumOSVersion (GetMinimumOSVersion (info_plist.GetMinimumOSVersion ()));
|
||||
info_plist.SetUIDeviceFamily (UIDeviceFamily);
|
||||
Harness.Save (info_plist, target_info_plist);
|
||||
}
|
||||
protected virtual void PostProcessExecutableProject ()
|
||||
{
|
||||
}
|
||||
|
||||
protected virtual void UpdateInfoPList ()
|
||||
{
|
||||
}
|
||||
|
||||
protected void CreateLibraryProject ()
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Xml;
|
||||
|
||||
using Xamarin;
|
||||
|
||||
namespace xharness
|
||||
{
|
||||
|
@ -8,5 +11,28 @@ namespace xharness
|
|||
public iOSTestProject TestProject;
|
||||
|
||||
public MonoNativeInfo MonoNativeInfo => TestProject.MonoNativeInfo;
|
||||
|
||||
protected override void PostProcessExecutableProject ()
|
||||
{
|
||||
base.PostProcessExecutableProject ();
|
||||
|
||||
inputProject.FixArchitectures (SimulatorArchitectures, DeviceArchitectures);
|
||||
inputProject.FixInfoPListInclude (Suffix);
|
||||
inputProject.SetExtraLinkerDefs ("extra-linker-defs" + ExtraLinkerDefsSuffix + ".xml");
|
||||
|
||||
ProjectGuid = inputProject.GetProjectGuid ();
|
||||
}
|
||||
|
||||
protected override void UpdateInfoPList ()
|
||||
{
|
||||
XmlDocument info_plist = new XmlDocument ();
|
||||
var target_info_plist = Path.Combine (TargetDirectory, "Info" + Suffix + ".plist");
|
||||
info_plist.LoadWithoutNetworkAccess (Path.Combine (TargetDirectory, "Info.plist"));
|
||||
BundleIdentifier = info_plist.GetCFBundleIdentifier ();
|
||||
info_plist.SetMinimumOSVersion (GetMinimumOSVersion (info_plist.GetMinimumOSVersion ()));
|
||||
info_plist.SetUIDeviceFamily (UIDeviceFamily);
|
||||
Harness.Save (info_plist, target_info_plist);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче