2016-05-26 16:06:52 +03:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
namespace xharness
|
|
|
|
|
{
|
|
|
|
|
public static class MakefileGenerator
|
|
|
|
|
{
|
|
|
|
|
static void WriteTarget (this StreamWriter writer, string target, string dependencies, params string [] arguments)
|
|
|
|
|
{
|
|
|
|
|
var t = string.Format (target, arguments);
|
|
|
|
|
if (t.Contains ("\\ ")) {
|
|
|
|
|
writer.Write (t.Replace ("\\ ", ""), arguments);
|
|
|
|
|
writer.Write (" ");
|
|
|
|
|
}
|
|
|
|
|
writer.Write (t);
|
|
|
|
|
if (!string.IsNullOrEmpty (dependencies)) {
|
|
|
|
|
writer.Write (": ");
|
|
|
|
|
writer.WriteLine (dependencies, arguments);
|
|
|
|
|
} else {
|
|
|
|
|
writer.WriteLine (":");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
enum MacTargetNameType { Build, Clean, Exec, Run }
|
|
|
|
|
|
|
|
|
|
static string MakeMacUnifiedTargetName (MacTarget target, MacTargetNameType type)
|
|
|
|
|
{
|
2019-06-24 17:08:13 +03:00
|
|
|
|
var make_escaped_suffix = target.Platform.Replace (" ", "\\ ");
|
2016-05-26 16:06:52 +03:00
|
|
|
|
var make_escaped_name = target.SimplifiedName.Replace (" ", "\\ ");
|
|
|
|
|
|
2019-06-24 17:08:13 +03:00
|
|
|
|
var sb = new StringBuilder ();
|
|
|
|
|
sb.Append (type.ToString ().ToLowerInvariant ());
|
|
|
|
|
sb.Append ('-');
|
|
|
|
|
sb.Append (make_escaped_suffix);
|
|
|
|
|
sb.Append ('-');
|
|
|
|
|
if (!string.IsNullOrEmpty (target.MakefileWhereSuffix)) {
|
|
|
|
|
sb.Append (target.MakefileWhereSuffix);
|
|
|
|
|
sb.Append ('-');
|
2016-05-26 16:06:52 +03:00
|
|
|
|
}
|
2019-06-24 17:08:13 +03:00
|
|
|
|
sb.Append (make_escaped_name);
|
|
|
|
|
return sb.ToString ();
|
2016-05-26 16:06:52 +03:00
|
|
|
|
}
|
|
|
|
|
|
2016-06-09 18:36:32 +03:00
|
|
|
|
static string CreateRelativePath (string path, string relative_to)
|
|
|
|
|
{
|
|
|
|
|
if (path.StartsWith (relative_to, StringComparison.Ordinal)) {
|
|
|
|
|
var rv = path.Substring (relative_to.Length);
|
|
|
|
|
if (relative_to [relative_to.Length - 1] != Path.PathSeparator)
|
|
|
|
|
rv = rv.Substring (1);
|
|
|
|
|
return rv;
|
|
|
|
|
}
|
|
|
|
|
return path;
|
|
|
|
|
}
|
|
|
|
|
|
2016-05-26 16:06:52 +03:00
|
|
|
|
public static void CreateMacMakefile (Harness harness, IEnumerable<MacTarget> targets)
|
|
|
|
|
{
|
2019-05-28 17:04:42 +03:00
|
|
|
|
var makefile = Path.Combine (Harness.RootDirectory, "Makefile-mac.inc");
|
2016-05-26 16:06:52 +03:00
|
|
|
|
using (var writer = new StreamWriter (makefile, false, new UTF8Encoding (false))) {
|
|
|
|
|
writer.WriteLine (".stamp-configure-projects-mac: Makefile xharness/xharness.exe");
|
2018-11-16 22:24:35 +03:00
|
|
|
|
writer.WriteLine ("\t$(Q) $(SYSTEM_MONO) --debug $(XIBUILD_EXE_PATH) -t -- $(CURDIR)/xharness/xharness.exe $(XHARNESS_VERBOSITY) --configure --autoconf --rootdir $(CURDIR)");
|
2016-05-26 16:06:52 +03:00
|
|
|
|
writer.WriteLine ("\t$(Q) touch $@");
|
|
|
|
|
writer.WriteLine ();
|
2018-11-08 17:36:56 +03:00
|
|
|
|
var nuget_restore_dependency = ".stamp-nuget-restore-mac";
|
|
|
|
|
writer.WriteLine ("PACKAGES_CONFIG:=$(shell find . -name packages.config)");
|
|
|
|
|
writer.WriteLine ($"{nuget_restore_dependency}: tests-mac.sln $(PACKAGES_CONFIG)");
|
Bump VSMac to 8.1.0.2742 to fix msbuild issues (#6279)
* Bump VSMac to 8.1.0.2742 to fix msbuild issues
This is required to get the support for the msbuild `ToolsVersion`
change from `15.0` to `Current`.
* [tests][msbuild] Fix Binding resources test with updated msbuild
Test failure with updated msbuild and vsmac 8.1:
```
Xamarin.iOS.Tasks.NativeReferencesNoEmbedding("iPhone").ShouldNotUnnecessarilyRebuildBindingProject(True)
Binding project build did not create package?
Expected: True
But was: False
at Xamarin.iOS.Tasks.NativeReferencesNoEmbedding.ShouldNotUnnecessarilyRebuildBindingProject (System.Boolean framework) [0x000a0] in <74b8f7d8a53e40109916d305bb4d7403>:0
at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&)
at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo cul
ture) [0x0006a] in <0519fa732e8845b6a809ce9180f541db>:0
```
The test builds the project multiple times. Before the 3rd build, the project
file's timestamp is updated and expects that the binding package will be
rebuilt. But it is not, because the target `_CreateBindingResourcePackage`
doesn't depend on that project file. So, add that to the target inputs.
* [nuget] Use xibuild to run nuget
Fix errors seen during `nuget restore` for tests:
```
Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/xammac_tests/xammac_tests.csproj(213,3): error MSB4024: The imported project file "/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Mac/Xamarin.Mac.CSharp.targets" could not be loaded. Could not find file "/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Mac/Xamarin.Mac.CSharp.targets"
```
2019-06-19 08:07:27 +03:00
|
|
|
|
writer.WriteLine ("\t$(Q_XBUILD) $(SYSTEM_XIBUILD) -t -- /Library/Frameworks/Mono.framework/Versions/Current/lib/mono/nuget/NuGet.exe restore tests-mac.sln");
|
2018-11-08 17:36:56 +03:00
|
|
|
|
writer.WriteLine ("\t$(Q) touch $@");
|
2016-05-26 16:06:52 +03:00
|
|
|
|
|
|
|
|
|
var allTargets = new List<MacTarget> ();
|
|
|
|
|
allTargets.AddRange (targets);
|
|
|
|
|
|
|
|
|
|
List<string> allTargetNames = new List<string> (allTargets.Count);
|
|
|
|
|
List<string> allTargetCleanNames = new List<string> (allTargets.Count);
|
|
|
|
|
|
|
|
|
|
// build/[install/]run targets for specific test projects.
|
|
|
|
|
foreach (var target in allTargets) {
|
2019-05-31 14:05:22 +03:00
|
|
|
|
if (target.Name.IndexOf ("bcl-test", StringComparison.Ordinal) != -1) // special case for those targets that are auto generated from the mono assemblies
|
2018-12-12 12:38:48 +03:00
|
|
|
|
continue;
|
2016-05-26 16:06:52 +03:00
|
|
|
|
var make_escaped_simplified_name = target.SimplifiedName.Replace (" ", "\\ ");
|
|
|
|
|
var make_escaped_name = target.Name.Replace (" ", "\\ ");
|
|
|
|
|
|
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
if (target.ProjectPath != target.TemplateProjectPath) {
|
|
|
|
|
writer.WriteLine ("# {0} for {1}", make_escaped_simplified_name, target.Suffix.Replace ("-", ""));
|
|
|
|
|
writer.WriteLine (".stamp-configure-projects-mac: {0}", target.TemplateProjectPath.Replace (" ", "\\ "));
|
|
|
|
|
writer.WriteLine ("{0}: .stamp-configure-projects-mac", target.ProjectPath.Replace (" ", "\\ "));
|
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
}
|
|
|
|
|
|
2019-06-17 09:03:58 +03:00
|
|
|
|
allTargetNames.Add (MakeMacUnifiedTargetName (target, MacTargetNameType.Build));
|
|
|
|
|
allTargetCleanNames.Add (MakeMacUnifiedTargetName (target, MacTargetNameType.Clean));
|
2016-05-26 16:06:52 +03:00
|
|
|
|
|
2019-06-19 19:23:06 +03:00
|
|
|
|
string guiUnitDependency = target.Modern ? "$(GUI_UNIT_PATH)/bin/xammac_mobile/GuiUnit.exe" : "$(GUI_UNIT_PATH)/bin/net_4_5/GuiUnit.exe";
|
2016-05-26 16:06:52 +03:00
|
|
|
|
|
2019-06-17 09:03:58 +03:00
|
|
|
|
writer.WriteTarget (MakeMacUnifiedTargetName (target, MacTargetNameType.Build), "{0}", target.ProjectPath.Replace (" ", "\\ ") + " " + guiUnitDependency + " " + nuget_restore_dependency);
|
|
|
|
|
writer.WriteLine ("\t$(Q_XBUILD) $(SYSTEM_XIBUILD) -- \"/property:Configuration=$(CONFIG)\" /t:Build $(XBUILD_VERBOSITY) \"{0}\"", target.ProjectPath);
|
|
|
|
|
writer.WriteLine ();
|
2016-05-26 16:06:52 +03:00
|
|
|
|
|
2019-06-17 09:03:58 +03:00
|
|
|
|
writer.WriteTarget (MakeMacUnifiedTargetName (target, MacTargetNameType.Clean), "");
|
|
|
|
|
writer.WriteLine ("\t$(Q_XBUILD) $(SYSTEM_XIBUILD) -- \"/property:Configuration=$(CONFIG)\" /t:Clean $(XBUILD_VERBOSITY) \"{0}\"", target.ProjectPath);
|
|
|
|
|
writer.WriteLine ();
|
2016-05-26 16:06:52 +03:00
|
|
|
|
|
2019-07-12 17:05:57 +03:00
|
|
|
|
if (!harness.GetIncludeSystemPermissionTests (TestPlatform.Mac, false))
|
|
|
|
|
writer.WriteTarget (MakeMacUnifiedTargetName (target, MacTargetNameType.Exec), "export DISABLE_SYSTEM_PERMISSION_TESTS=1");
|
2019-06-17 09:03:58 +03:00
|
|
|
|
writer.WriteTarget (MakeMacUnifiedTargetName (target, MacTargetNameType.Exec), "");
|
|
|
|
|
if (target.IsNUnitProject) {
|
|
|
|
|
writer.WriteLine ("\t$(Q)rm -f $(CURDIR)/.{0}-failed.stamp", make_escaped_name);
|
|
|
|
|
writer.WriteLine ("\t$(SYSTEM_MONO) --debug $(XIBUILD_EXE_PATH) -t -- $(TOP)/packages/NUnit.ConsoleRunner.3.9.0/tools/nunit3-console.exe \"{1}/bin/$(CONFIG)/mmptest.dll\" \"--result=$(abspath $(CURDIR)/{0}-TestResult.xml);format=nunit2\" $(TEST_FIXTURE) --labels=All || touch $(CURDIR)/.{0}-failed.stamp", make_escaped_name, Path.GetDirectoryName (target.ProjectPath));
|
|
|
|
|
writer.WriteLine ("\t$(Q)[[ -z \"$$BUILD_REPOSITORY\" ]] || ( xsltproc $(TOP)/tests/HtmlTransform.xslt {0}-TestResult.xml > {0}-index.html && echo \"@MonkeyWrench: AddFile: $$PWD/{0}-index.html\")", make_escaped_name);
|
|
|
|
|
writer.WriteLine ("\t$(Q)[[ ! -e .{0}-failed.stamp ]]", make_escaped_name);
|
|
|
|
|
} else if (target.IsBCLProject)
|
|
|
|
|
writer.WriteLine ("\t$(Q) {2}/bin/$(CONFIG){1}/{0}Tests.app/Contents/MacOS/{0}Tests", make_escaped_name, target.Suffix, CreateRelativePath (Path.GetDirectoryName (target.ProjectPath).Replace (" ", "\\ "), Path.GetDirectoryName (makefile)));
|
|
|
|
|
else
|
|
|
|
|
writer.WriteLine ("\t$(Q) {2}/bin/x86/$(CONFIG){1}/{0}.app/Contents/MacOS/{0}", make_escaped_name, target.Suffix, CreateRelativePath (Path.GetDirectoryName (target.ProjectPath).Replace (" ", "\\ "), Path.GetDirectoryName (makefile)));
|
|
|
|
|
writer.WriteLine ();
|
2016-05-26 16:06:52 +03:00
|
|
|
|
|
2019-06-17 09:03:58 +03:00
|
|
|
|
writer.WriteTarget (MakeMacUnifiedTargetName (target, MacTargetNameType.Run), "");
|
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) {0}", MakeMacUnifiedTargetName (target, MacTargetNameType.Build));
|
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) {0}", MakeMacUnifiedTargetName (target, MacTargetNameType.Exec));
|
|
|
|
|
writer.WriteLine ();
|
2016-05-26 16:06:52 +03:00
|
|
|
|
|
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
}
|
|
|
|
|
writer.WriteLine ("# Env Variables to use local not system XM");
|
|
|
|
|
writer.WriteLine ();
|
2018-02-02 19:17:59 +03:00
|
|
|
|
writer.WriteLine ("MD_APPLE_SDK_ROOT_EVALUATED:=$(shell dirname `dirname $(XCODE_DEVELOPER_ROOT)`)");
|
2016-05-26 16:06:52 +03:00
|
|
|
|
|
2018-11-06 17:06:58 +03:00
|
|
|
|
var enviromentalVariables = new Dictionary<string,string> () {
|
|
|
|
|
{ "TargetFrameworkFallbackSearchPaths", "$(MAC_DESTDIR)/Library/Frameworks/Mono.framework/External/xbuild-frameworks"},
|
|
|
|
|
{ "MSBuildExtensionsPathFallbackPathsOverride", "$(MAC_DESTDIR)/Library/Frameworks/Mono.framework/External/xbuild" },
|
|
|
|
|
{ "MD_APPLE_SDK_ROOT", "$(MD_APPLE_SDK_ROOT_EVALUATED)"},
|
2016-05-26 16:06:52 +03:00
|
|
|
|
};
|
|
|
|
|
|
2018-11-07 11:34:16 +03:00
|
|
|
|
// For targets with spaces, also add the non-space variation to the list.
|
|
|
|
|
allTargetNames.AddRange (allTargetNames.Where ((v) => v.IndexOf (' ') >= 0).Select ((v) => v.Replace ("\\ ", "")));
|
|
|
|
|
allTargetCleanNames.AddRange (allTargetCleanNames.Where ((v) => v.IndexOf (' ') >= 0).Select ((v) => v.Replace ("\\ ", "")));
|
|
|
|
|
|
2016-05-26 16:06:52 +03:00
|
|
|
|
foreach (var key in enviromentalVariables) {
|
|
|
|
|
writer.WriteLine ("{0}: export {1}:={2}", string.Join (" ", allTargetNames.ToArray ()), key.Key, key.Value);
|
|
|
|
|
writer.WriteLine ("{0}: export {1}:={2}", string.Join (" ", allTargetCleanNames.ToArray ()), key.Key, key.Value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
writer.WriteLine ("# Container targets that run multiple test projects");
|
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
|
2018-06-13 19:53:57 +03:00
|
|
|
|
IEnumerable<MacTarget> groupableTargets = allTargets;
|
|
|
|
|
|
|
|
|
|
var grouped = groupableTargets.GroupBy ((target) => target.SimplifiedName);
|
2016-05-26 16:06:52 +03:00
|
|
|
|
foreach (MacTargetNameType action in Enum.GetValues (typeof (MacTargetNameType))) {
|
|
|
|
|
var actionName = action.ToString ().ToLowerInvariant ();
|
|
|
|
|
foreach (var group in grouped) {
|
2018-01-16 21:15:59 +03:00
|
|
|
|
var targetName = group.Key.Replace (" ", "\\ ");
|
2018-11-08 17:36:56 +03:00
|
|
|
|
writer.WriteTarget ("{0}-mac-{1}", actionName == "build" ? nuget_restore_dependency : string.Empty, actionName, targetName);
|
2016-05-26 16:06:52 +03:00
|
|
|
|
writer.WriteLine ("\t$(Q) rm -f \".$@-failure.stamp\"");
|
|
|
|
|
foreach (var entry in group)
|
2019-06-17 09:03:58 +03:00
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) {0} || echo \"{0} failed\" >> \".$@-failure.stamp\"", MakeMacUnifiedTargetName (entry, action));
|
2016-05-26 16:06:52 +03:00
|
|
|
|
writer.WriteLine ("\t$(Q) if test -e \".$@-failure.stamp\"; then cat \".$@-failure.stamp\"; rm \".$@-failure.stamp\"; exit 1; fi");
|
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
writer.WriteLine ("mac-run run-mac:");
|
|
|
|
|
writer.WriteLine ("\t$(Q) rm -rf \".$@-failure.stamp\"");
|
2018-06-13 19:53:57 +03:00
|
|
|
|
foreach (var target in groupableTargets) {
|
2019-06-17 09:03:58 +03:00
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) {0} || echo \"{0} failed\" >> \".$@-failure.stamp\"", MakeMacUnifiedTargetName (target, MacTargetNameType.Run));
|
2016-05-26 16:06:52 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
writer.WriteLine ("\t$(Q) if test -e \".$@-failure.stamp\"; then cat \".$@-failure.stamp\"; rm \".$@-failure.stamp\"; exit 1; fi");
|
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
|
2018-11-08 17:36:56 +03:00
|
|
|
|
writer.WriteLine ($"mac-build mac-build-all build-mac: {nuget_restore_dependency}"); // build everything
|
2016-05-26 16:06:52 +03:00
|
|
|
|
writer.WriteLine ("\t$(Q) rm -rf \".$@-failure.stamp\"");
|
2018-06-13 19:53:57 +03:00
|
|
|
|
foreach (var target in groupableTargets) {
|
2019-06-17 09:03:58 +03:00
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) {0} || echo \"{0} failed\" >> \".$@-failure.stamp\"", MakeMacUnifiedTargetName (target, MacTargetNameType.Build));
|
2016-05-26 16:06:52 +03:00
|
|
|
|
}
|
|
|
|
|
writer.WriteLine ("\t$(Q) if test -e \".$@-failure.stamp\"; then cat \".$@-failure.stamp\"; rm \".$@-failure.stamp\"; exit 1; fi");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void WriteCollectionTarget (StreamWriter writer, string target, IEnumerable<Target> targets, string mode)
|
|
|
|
|
{
|
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
writer.Write (target);
|
|
|
|
|
writer.WriteLine (":");
|
|
|
|
|
foreach (var t in targets.Where ((v) => v.IsExe)) {
|
2016-09-21 23:55:10 +03:00
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) \"run{0}-{2}-{1}\" || echo \"run{0}-{2}-{1} failed\" >> \".$@-failure.stamp\"", t.Suffix, t.Name, mode);
|
2016-05-26 16:06:52 +03:00
|
|
|
|
}
|
|
|
|
|
writer.WriteLine ("\t$(Q) if test -e \".$@-failure.stamp\"; then cat \".$@-failure.stamp\"; rm \".$@-failure.stamp\"; exit 1; fi");
|
|
|
|
|
}
|
|
|
|
|
|
2017-01-04 21:45:26 +03:00
|
|
|
|
static string GetMakeSuffix (this Target target, bool escape = true)
|
|
|
|
|
{
|
|
|
|
|
var rv = "-" + target.Platform;
|
|
|
|
|
if (escape)
|
|
|
|
|
rv = rv.Replace (" ", "\\ ");
|
|
|
|
|
return rv;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static string GetMakeName (this Target target, bool escape = true)
|
|
|
|
|
{
|
|
|
|
|
var rv = target.Name;
|
|
|
|
|
if (escape)
|
|
|
|
|
rv = rv.Replace (" ", "\\ ");
|
|
|
|
|
if (target is TodayExtensionTarget)
|
|
|
|
|
rv = rv + "-today";
|
|
|
|
|
return rv;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void CreateMakefile (Harness harness, IEnumerable<UnifiedTarget> unified_targets, IEnumerable<TVOSTarget> tvos_targets, IEnumerable<WatchOSTarget> watchos_targets, IEnumerable<TodayExtensionTarget> today_targets)
|
2016-05-26 16:06:52 +03:00
|
|
|
|
{
|
2017-06-11 04:42:42 +03:00
|
|
|
|
var executeSim32 = !harness.InWrench; // Waiting for iOS 10.3 simulator to be installed on wrench
|
2019-05-28 17:04:42 +03:00
|
|
|
|
var makefile = Path.Combine (Harness.RootDirectory, "Makefile.inc");
|
2016-05-26 16:06:52 +03:00
|
|
|
|
using (var writer = new StreamWriter (makefile, false, new UTF8Encoding (false))) {
|
|
|
|
|
writer.WriteLine (".stamp-configure-projects: Makefile xharness/xharness.exe");
|
2018-11-16 22:24:35 +03:00
|
|
|
|
writer.WriteLine ("\t$(Q) $(SYSTEM_MONO) --debug $(XIBUILD_EXE_PATH) -t -- $(CURDIR)/xharness/xharness.exe $(XHARNESS_VERBOSITY) --configure --autoconf --rootdir $(CURDIR)");
|
2016-05-26 16:06:52 +03:00
|
|
|
|
writer.WriteLine ("\t$(Q) touch $@");
|
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
|
2017-09-22 19:04:32 +03:00
|
|
|
|
var allTargets = new List<iOSTarget> ();
|
2016-05-26 16:06:52 +03:00
|
|
|
|
allTargets.AddRange (unified_targets);
|
|
|
|
|
allTargets.AddRange (tvos_targets);
|
|
|
|
|
allTargets.AddRange (watchos_targets);
|
2017-01-04 21:45:26 +03:00
|
|
|
|
allTargets.AddRange (today_targets);
|
2016-05-26 16:06:52 +03:00
|
|
|
|
|
|
|
|
|
// build/[install/]run targets for specific test projects.
|
|
|
|
|
foreach (var target in allTargets) {
|
2019-05-31 14:05:22 +03:00
|
|
|
|
if (!target.IsExe || target.Name.IndexOf ("bcl-test", 0, StringComparison.Ordinal) != -1)
|
2016-07-25 22:01:34 +03:00
|
|
|
|
continue;
|
2017-01-04 21:45:26 +03:00
|
|
|
|
|
|
|
|
|
var make_escaped_suffix = target.GetMakeSuffix ();
|
|
|
|
|
var make_escaped_name = target.GetMakeName ();
|
|
|
|
|
|
|
|
|
|
if (target is TodayExtensionTarget)
|
|
|
|
|
make_escaped_name += "-today";
|
2016-05-26 16:06:52 +03:00
|
|
|
|
|
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
if (target.ProjectPath != target.TemplateProjectPath) {
|
|
|
|
|
writer.WriteLine ("# {0} for {1}", target.Name, target.Suffix.Replace ("-", ""));
|
|
|
|
|
writer.WriteLine (".stamp-configure-projects: {0}", target.TemplateProjectPath.Replace (" ", "\\ "));
|
|
|
|
|
writer.WriteLine ("{0}: .stamp-configure-projects", target.ProjectPath.Replace (" ", "\\ "), target.TemplateProjectPath.Replace (" ", "\\ "));
|
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// build sim project target
|
|
|
|
|
if (target.IsBCLProject) {
|
|
|
|
|
writer.WriteTarget ("build{0}-bcl-sim{2}-{1}", "build{0}-sim{2}-{1}", make_escaped_suffix, make_escaped_name, target.MakefileWhereSuffix);
|
|
|
|
|
writer.WriteLine ("\t$(Q) echo Build succeeded"); // This is important, otherwise we'll end up executing the catch-all build-% target
|
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
}
|
|
|
|
|
writer.WriteTarget ("build{0}-sim{3}-{1}", "{2}", make_escaped_suffix, make_escaped_name, target.ProjectPath.Replace (" ", "\\ "), target.MakefileWhereSuffix);
|
2018-11-16 22:24:35 +03:00
|
|
|
|
writer.WriteLine ("\t$(Q_XBUILD) $(SYSTEM_XIBUILD) -- \"/property:Configuration=$(CONFIG)\" \"/property:Platform=iPhoneSimulator\" /t:Build $(XBUILD_VERBOSITY) \"{0}\"", target.ProjectPath);
|
2016-05-26 16:06:52 +03:00
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
|
|
|
|
|
// clean sim project target
|
|
|
|
|
if (target.IsBCLProject) {
|
|
|
|
|
writer.WriteTarget ("clean{0}-bcl-sim{2}-{1}", "clean{0}-sim-{1}", make_escaped_suffix, make_escaped_name, target.MakefileWhereSuffix);
|
|
|
|
|
writer.WriteLine ("\t$(Q) echo Clean succeeded"); // This is important, otherwise we'll end up executing the catch-all clean-% target
|
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
}
|
|
|
|
|
writer.WriteTarget ("clean{0}-sim{2}-{1}", string.Empty, make_escaped_suffix, make_escaped_name, target.ProjectPath.Replace (" ", "\\ "), target.MakefileWhereSuffix);
|
2018-11-16 22:24:35 +03:00
|
|
|
|
writer.WriteLine ("\t$(Q_XBUILD) $(SYSTEM_XIBUILD) -- \"/property:Configuration=$(CONFIG)\" \"/property:Platform=iPhoneSimulator\" /t:Clean $(XBUILD_VERBOSITY) \"{0}\"", target.ProjectPath);
|
2016-05-26 16:06:52 +03:00
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
|
2016-07-25 22:01:34 +03:00
|
|
|
|
// run sim project target
|
|
|
|
|
if (target.IsMultiArchitecture) {
|
|
|
|
|
writer.WriteTarget ("run{0}-sim{2}-{1}", string.Empty, make_escaped_suffix, make_escaped_name, target.MakefileWhereSuffix);
|
|
|
|
|
writer.WriteLine ("\t$(Q) rm -f \".$@-failure.stamp\"");
|
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) build{0}-sim{2}-{1}", make_escaped_suffix, make_escaped_name, target.MakefileWhereSuffix);
|
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) exec{0}-sim32-{1} || echo \"exec{0}-sim32-{1} failed\" >> \".$@-failure.stamp\"", make_escaped_suffix, make_escaped_name);
|
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) exec{0}-sim64-{1} || echo \"exec{0}-sim64-{1} failed\" >> \".$@-failure.stamp\"", make_escaped_suffix, make_escaped_name);
|
|
|
|
|
writer.WriteLine ("\t$(Q) if test -e \".$@-failure.stamp\"; then cat \".$@-failure.stamp\"; rm \".$@-failure.stamp\"; exit 1; fi");
|
|
|
|
|
writer.WriteLine ();
|
2016-05-26 16:06:52 +03:00
|
|
|
|
|
2016-07-25 22:01:34 +03:00
|
|
|
|
writer.WriteTarget ("run{0}-sim32-{1}", string.Empty, make_escaped_suffix, make_escaped_name);
|
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) build{0}-sim{2}-{1}", make_escaped_suffix, make_escaped_name, target.MakefileWhereSuffix);
|
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) exec{0}-sim32-{1}", make_escaped_suffix, make_escaped_name);
|
|
|
|
|
writer.WriteLine ();
|
2016-05-26 16:06:52 +03:00
|
|
|
|
|
2016-07-25 22:01:34 +03:00
|
|
|
|
writer.WriteTarget ("run{0}-sim64-{1}", string.Empty, make_escaped_suffix, make_escaped_name);
|
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) build{0}-sim{2}-{1}", make_escaped_suffix, make_escaped_name, target.MakefileWhereSuffix);
|
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) exec{0}-sim64-{1}", make_escaped_suffix, make_escaped_name);
|
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
} else {
|
|
|
|
|
writer.WriteTarget ("run{0}-sim{2}-{1}", string.Empty, make_escaped_suffix, make_escaped_name, target.MakefileWhereSuffix);
|
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) build{0}-sim{2}-{1}", make_escaped_suffix, make_escaped_name, target.MakefileWhereSuffix);
|
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) exec{0}-sim{2}-{1}", make_escaped_suffix, make_escaped_name, target.MakefileWhereSuffix);
|
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (target.IsBCLProject && target.IsExe) {
|
|
|
|
|
writer.WriteTarget ("run{0}-bcl-sim{2}-{1}", "run{0}-sim{2}-{1}", make_escaped_suffix, make_escaped_name, target.MakefileWhereSuffix);
|
|
|
|
|
writer.WriteLine ("\t$(Q) echo Run succeeded"); // This is important, otherwise we'll end up executing the catch-all run-% target
|
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
|
|
|
|
|
if (target.IsMultiArchitecture) {
|
|
|
|
|
writer.WriteTarget ("run{0}-bcl-sim32-{1}", "run{0}-sim32-{1}", make_escaped_suffix, make_escaped_name);
|
|
|
|
|
writer.WriteLine ("\t$(Q) echo Run succeeded"); // This is important, otherwise we'll end up executing the catch-all run-% target
|
2016-05-26 16:06:52 +03:00
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
|
2016-07-25 22:01:34 +03:00
|
|
|
|
writer.WriteTarget ("run{0}-bcl-sim64-{1}", "run{0}-sim64-{1}", make_escaped_suffix, make_escaped_name);
|
2016-05-26 16:06:52 +03:00
|
|
|
|
writer.WriteLine ("\t$(Q) echo Run succeeded"); // This is important, otherwise we'll end up executing the catch-all run-% target
|
|
|
|
|
writer.WriteLine ();
|
2016-07-25 22:01:34 +03:00
|
|
|
|
}
|
|
|
|
|
}
|
2016-05-26 16:06:52 +03:00
|
|
|
|
|
2016-07-25 22:01:34 +03:00
|
|
|
|
// exec sim project target
|
|
|
|
|
if (target.IsMultiArchitecture) {
|
|
|
|
|
writer.WriteTarget ("exec{0}-sim64-{1}", "$(UNIT_SERVER)", make_escaped_suffix, make_escaped_name);
|
2018-11-16 22:24:35 +03:00
|
|
|
|
writer.WriteLine ("\t$(Q) $(SYSTEM_MONO) --debug $(XIBUILD_EXE_PATH) -t -- $(CURDIR)/xharness/xharness.exe $(XHARNESS_VERBOSITY) --run \"{0}\" --target {1}-simulator-64 --sdkroot $(XCODE_DEVELOPER_ROOT) --logdirectory \"$(abspath $(CURDIR))/logs/$@\" --configuration $(CONFIG)", target.ProjectPath, target.Platform);
|
2016-07-25 22:01:34 +03:00
|
|
|
|
writer.WriteLine ();
|
2016-05-26 16:06:52 +03:00
|
|
|
|
|
2016-07-25 22:01:34 +03:00
|
|
|
|
writer.WriteTarget ("exec{0}-sim32-{1}", "$(UNIT_SERVER)", make_escaped_suffix, make_escaped_name);
|
2017-06-11 04:42:42 +03:00
|
|
|
|
if (executeSim32) {
|
2018-11-16 22:24:35 +03:00
|
|
|
|
writer.WriteLine ("\t$(Q) $(SYSTEM_MONO) --debug $(XIBUILD_EXE_PATH) -t -- $(CURDIR)/xharness/xharness.exe $(XHARNESS_VERBOSITY) --run \"{0}\" --target {1}-simulator-32 --sdkroot $(XCODE_DEVELOPER_ROOT) --logdirectory \"$(abspath $(CURDIR))/logs/$@\" --configuration $(CONFIG)", target.ProjectPath, target.Platform);
|
2017-06-11 04:42:42 +03:00
|
|
|
|
} else {
|
|
|
|
|
writer.WriteLine ("\t$(Q) echo 'Execution of sim32 has been disabled.'");
|
|
|
|
|
}
|
2016-07-25 22:01:34 +03:00
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
} else {
|
|
|
|
|
writer.WriteTarget ("exec{0}-sim{2}-{1}", "$(UNIT_SERVER)", make_escaped_suffix, make_escaped_name, target.MakefileWhereSuffix);
|
2018-11-16 22:24:35 +03:00
|
|
|
|
writer.WriteLine ("\t$(Q) $(SYSTEM_MONO) --debug $(XIBUILD_EXE_PATH) -t -- $(CURDIR)/xharness/xharness.exe $(XHARNESS_VERBOSITY) --run \"{0}\" --target {1}-simulator --sdkroot $(XCODE_DEVELOPER_ROOT) --logdirectory \"$(abspath $(CURDIR))/logs/$@\" --configuration $(CONFIG)", target.ProjectPath, target.Platform);
|
2016-07-25 22:01:34 +03:00
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (target.IsBCLProject && target.IsExe) {
|
|
|
|
|
writer.WriteTarget ("exec{0}-bcl-sim{2}-{1}", "exec{0}-sim-{1}", make_escaped_suffix, make_escaped_name, target.MakefileWhereSuffix);
|
|
|
|
|
writer.WriteLine ("\t$(Q) echo Exec succeeded"); // This is important, otherwise we'll end up executing the catch-all exec-% target
|
|
|
|
|
writer.WriteLine ();
|
2016-05-26 16:06:52 +03:00
|
|
|
|
|
|
|
|
|
if (target.IsMultiArchitecture) {
|
2016-07-25 22:01:34 +03:00
|
|
|
|
writer.WriteTarget ("exec{0}-bcl-sim32-{1}", "exec{0}-sim32-{1}", make_escaped_suffix, make_escaped_name);
|
|
|
|
|
writer.WriteLine ("\t$(Q) echo Exec succeeded"); // This is important, otherwise we'll end up executing the catch-all exec-% target
|
2016-05-26 16:06:52 +03:00
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
|
2016-07-25 22:01:34 +03:00
|
|
|
|
writer.WriteTarget ("exec{0}-bcl-sim64-{1}", "exec{0}-sim64-{1}", make_escaped_suffix, make_escaped_name);
|
2016-05-26 16:06:52 +03:00
|
|
|
|
writer.WriteLine ("\t$(Q) echo Exec succeeded"); // This is important, otherwise we'll end up executing the catch-all exec-% target
|
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// build dev project target
|
|
|
|
|
if (target.IsBCLProject) {
|
|
|
|
|
writer.WriteTarget ("build{0}-bcl-dev{2}-{1}", "build{0}-dev-{1}", make_escaped_suffix, make_escaped_name, target.MakefileWhereSuffix);
|
|
|
|
|
writer.WriteLine ("\t$(Q) echo Build succeeded"); // This is important, otherwise we'll end up executing the catch-all clean-% target
|
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
}
|
2016-10-07 16:01:26 +03:00
|
|
|
|
|
|
|
|
|
if (target.IsMultiArchitecture) {
|
|
|
|
|
writer.WriteTarget ("build{0}-dev-{1}", "build{0}-dev32-{1} build{0}-dev64-{1}", make_escaped_suffix, make_escaped_name);
|
|
|
|
|
writer.WriteLine ("\t$(Q) echo Build succeeded"); // This is important, otherwise we'll end up executing the catch-all build-% target
|
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
|
|
|
|
|
writer.WriteTarget ("build{0}-dev32-{1}", "{2} xharness/xharness.exe", make_escaped_suffix, make_escaped_name, target.ProjectPath.Replace (" ", "\\ "));
|
2018-11-16 22:24:35 +03:00
|
|
|
|
writer.WriteLine ("\t$(Q_XBUILD) $(SYSTEM_XIBUILD) -- \"/property:Configuration=$(CONFIG)32\" \"/property:Platform=iPhone\" /t:Build $(XBUILD_VERBOSITY) \"{0}\"", target.ProjectPath);
|
2016-10-07 16:01:26 +03:00
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
|
|
|
|
|
writer.WriteTarget ("build{0}-dev64-{1}", "{2} xharness/xharness.exe", make_escaped_suffix, make_escaped_name, target.ProjectPath.Replace (" ", "\\ "));
|
2018-11-16 22:24:35 +03:00
|
|
|
|
writer.WriteLine ("\t$(Q_XBUILD) $(SYSTEM_XIBUILD) -- \"/property:Configuration=$(CONFIG)64\" \"/property:Platform=iPhone\" /t:Build $(XBUILD_VERBOSITY) \"{0}\"", target.ProjectPath);
|
2016-10-07 16:01:26 +03:00
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
} else {
|
|
|
|
|
writer.WriteTarget ("build{0}-dev{3}-{1}", "{2} xharness/xharness.exe", make_escaped_suffix, make_escaped_name, target.ProjectPath.Replace (" ", "\\ "), target.MakefileWhereSuffix);
|
2018-11-16 22:24:35 +03:00
|
|
|
|
writer.WriteLine ("\t$(Q_XBUILD) $(SYSTEM_XIBUILD) -- \"/property:Configuration=$(CONFIG)\" \"/property:Platform=iPhone\" /t:Build $(XBUILD_VERBOSITY) \"{0}\"", target.ProjectPath);
|
2016-10-07 16:01:26 +03:00
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
}
|
2016-05-26 16:06:52 +03:00
|
|
|
|
|
|
|
|
|
// clean dev project target
|
|
|
|
|
if (target.IsBCLProject) {
|
|
|
|
|
writer.WriteTarget ("clean{0}-bcl-dev{2}-{1}", "clean{0}-dev-{1}", make_escaped_suffix, make_escaped_name, target.MakefileWhereSuffix);
|
|
|
|
|
writer.WriteLine ("\t$(Q) echo Clean succeeded"); // This is important, otherwise we'll end up executing the catch-all clean-% target
|
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
}
|
2016-10-07 16:01:26 +03:00
|
|
|
|
if (target.IsMultiArchitecture) {
|
|
|
|
|
writer.WriteTarget ("clean{0}-dev-{1}", "clean{0}-dev32-{1} clean{0}-dev64-{1}", make_escaped_suffix, make_escaped_name);
|
|
|
|
|
writer.WriteLine ("\t$(Q) echo Clean succeeded"); // This is important, otherwise we'll end up executing the catch-all clean-% target
|
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
|
|
|
|
|
writer.WriteTarget ("clean{0}-dev32-{1}", string.Empty, make_escaped_suffix, make_escaped_name);
|
2018-11-16 22:24:35 +03:00
|
|
|
|
writer.WriteLine ("\t$(Q_XBUILD) $(SYSTEM_XIBUILD) -- \"/property:Configuration=$(CONFIG)32\" \"/property:Platform=iPhone\" /t:Clean $(XBUILD_VERBOSITY) \"{0}\"", target.ProjectPath);
|
2016-10-07 16:01:26 +03:00
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
|
|
|
|
|
writer.WriteTarget ("clean{0}-dev64-{1}", string.Empty, make_escaped_suffix, make_escaped_name);
|
2018-11-16 22:24:35 +03:00
|
|
|
|
writer.WriteLine ("\t$(Q_XBUILD) $(SYSTEM_XIBUILD) -- \"/property:Configuration=$(CONFIG)64\" \"/property:Platform=iPhone\" /t:Clean $(XBUILD_VERBOSITY) \"{0}\"", target.ProjectPath);
|
2016-10-07 16:01:26 +03:00
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
} else {
|
|
|
|
|
writer.WriteTarget ("clean{0}-dev{2}-{1}", string.Empty, make_escaped_suffix, make_escaped_name, target.MakefileWhereSuffix);
|
2018-11-16 22:24:35 +03:00
|
|
|
|
writer.WriteLine ("\t$(Q_XBUILD) $(SYSTEM_XIBUILD) -- \"/property:Configuration=$(CONFIG)\" \"/property:Platform=iPhone\" /t:Clean $(XBUILD_VERBOSITY) \"{0}\"", target.ProjectPath);
|
2016-10-07 16:01:26 +03:00
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
}
|
2016-05-26 16:06:52 +03:00
|
|
|
|
|
2016-07-25 22:01:34 +03:00
|
|
|
|
// install dev project target
|
2016-10-07 16:01:26 +03:00
|
|
|
|
if (target.IsMultiArchitecture) {
|
|
|
|
|
writer.WriteTarget ("install{0}-dev32-{1}", "xharness/xharness.exe", make_escaped_suffix, make_escaped_name);
|
2018-11-16 22:24:35 +03:00
|
|
|
|
writer.WriteLine ("\t$(Q) $(SYSTEM_MONO) --debug $(XIBUILD_EXE_PATH) -t -- $(CURDIR)/xharness/xharness.exe $(XHARNESS_VERBOSITY) --install \"{0}\" --target {1}-device --sdkroot $(XCODE_DEVELOPER_ROOT) --configuration $(CONFIG)32", target.ProjectPath, target.Platform);
|
2016-10-07 16:01:26 +03:00
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
writer.WriteTarget ("install{0}-dev64-{1}", "xharness/xharness.exe", make_escaped_suffix, make_escaped_name);
|
2018-11-16 22:24:35 +03:00
|
|
|
|
writer.WriteLine ("\t$(Q) $(SYSTEM_MONO) --debug $(XIBUILD_EXE_PATH) -t -- $(CURDIR)/xharness/xharness.exe $(XHARNESS_VERBOSITY) --install \"{0}\" --target {1}-device --sdkroot $(XCODE_DEVELOPER_ROOT) --configuration $(CONFIG)64", target.ProjectPath, target.Platform);
|
2016-10-07 16:01:26 +03:00
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
} else {
|
|
|
|
|
if (target.IsBCLProject) {
|
|
|
|
|
writer.WriteTarget ("install{0}-bcl-dev{2}-{1}", "install{0}-dev-{1}", make_escaped_suffix, make_escaped_name, target.MakefileWhereSuffix);
|
|
|
|
|
writer.WriteLine ("\t$(Q) echo Install succeeded"); // This is important, otherwise we'll end up executing the catch-all install-% target
|
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
}
|
|
|
|
|
writer.WriteTarget ("install{0}-dev{2}-{1}", "xharness/xharness.exe", make_escaped_suffix, make_escaped_name, target.MakefileWhereSuffix);
|
2018-11-16 22:24:35 +03:00
|
|
|
|
writer.WriteLine ("\t$(Q) $(SYSTEM_MONO) --debug $(XIBUILD_EXE_PATH) -t -- $(CURDIR)/xharness/xharness.exe $(XHARNESS_VERBOSITY) --install \"{0}\" --target {1}-device --sdkroot $(XCODE_DEVELOPER_ROOT) --configuration $(CONFIG)", target.ProjectPath, target.Platform);
|
2016-05-26 16:06:52 +03:00
|
|
|
|
writer.WriteLine ();
|
2016-07-25 22:01:34 +03:00
|
|
|
|
}
|
2016-05-26 16:06:52 +03:00
|
|
|
|
|
2016-07-25 22:01:34 +03:00
|
|
|
|
// run dev project target
|
|
|
|
|
if (target.IsBCLProject) {
|
|
|
|
|
writer.WriteTarget ("run{0}-bcl-dev{2}-{1}", "run{0}-dev-{1}", make_escaped_suffix, make_escaped_name, target.MakefileWhereSuffix);
|
|
|
|
|
writer.WriteLine ("\t$(Q) echo Run succeeded"); // This is important, otherwise we'll end up executing the catch-all run-% target
|
2016-05-26 16:06:52 +03:00
|
|
|
|
writer.WriteLine ();
|
2016-07-25 22:01:34 +03:00
|
|
|
|
}
|
2016-10-07 16:01:26 +03:00
|
|
|
|
if (target.IsMultiArchitecture) {
|
|
|
|
|
writer.WriteTarget ("run{0}-dev-{1}", string.Empty, make_escaped_suffix, make_escaped_name);
|
|
|
|
|
writer.WriteLine ("\t$(Q) rm -f \".$@-failure.stamp\"");
|
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) build{0}-dev32-{1} build{0}-dev64-{1}", make_escaped_suffix, make_escaped_name);
|
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) install{0}-dev32-{1} || echo \"install{0}-dev32-{1} failed\" >> \".$@-failure.stamp\"", make_escaped_suffix, make_escaped_name);
|
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) exec{0}-dev32-{1} || echo \"exec{0}-dev32-{1} failed\" >> \".$@-failure.stamp\"", make_escaped_suffix, make_escaped_name);
|
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) install{0}-dev64-{1} || echo \"install{0}-dev32-{1} failed\" >> \".$@-failure.stamp\"", make_escaped_suffix, make_escaped_name);
|
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) exec{0}-dev64-{1} || echo \"exec{0}-dev64-{1} failed\" >> \".$@-failure.stamp\"", make_escaped_suffix, make_escaped_name);
|
|
|
|
|
writer.WriteLine ("\t$(Q) if test -e \".$@-failure.stamp\"; then cat \".$@-failure.stamp\"; rm \".$@-failure.stamp\"; exit 1; fi");
|
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
|
|
|
|
|
writer.WriteTarget ("run{0}-dev32-{1}", "xharness/xharness.exe", make_escaped_suffix, make_escaped_name);
|
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) build{0}-dev32-{1}", make_escaped_suffix, make_escaped_name);
|
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) install{0}-dev32-{1}", make_escaped_suffix, make_escaped_name);
|
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) exec{0}-dev32-{1}", make_escaped_suffix, make_escaped_name);
|
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
|
|
|
|
|
writer.WriteTarget ("run{0}-dev64-{1}", "xharness/xharness.exe", make_escaped_suffix, make_escaped_name);
|
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) build{0}-dev64-{1}", make_escaped_suffix, make_escaped_name);
|
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) install{0}-dev64-{1}", make_escaped_suffix, make_escaped_name);
|
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) exec{0}-dev64-{1}", make_escaped_suffix, make_escaped_name);
|
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
} else {
|
|
|
|
|
writer.WriteTarget ("run{0}-dev{2}-{1}", "xharness/xharness.exe", make_escaped_suffix, make_escaped_name, target.MakefileWhereSuffix);
|
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) build{0}-dev{2}-{1}", make_escaped_suffix, make_escaped_name, target.MakefileWhereSuffix);
|
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) install{0}-dev{2}-{1}", make_escaped_suffix, make_escaped_name, target.MakefileWhereSuffix);
|
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) exec{0}-dev{2}-{1}", make_escaped_suffix, make_escaped_name, target.MakefileWhereSuffix);
|
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
}
|
2016-05-26 16:06:52 +03:00
|
|
|
|
|
2016-07-25 22:01:34 +03:00
|
|
|
|
// exec dev project target
|
|
|
|
|
if (target.IsBCLProject) {
|
|
|
|
|
writer.WriteTarget ("exec{0}-bcl-dev{2}-{1}", "exec{0}-dev{2}-{1}", make_escaped_suffix, make_escaped_name, target.MakefileWhereSuffix);
|
|
|
|
|
writer.WriteLine ("\t$(Q) echo Exec succeeded"); // This is important, otherwise we'll end up executing the catch-all run-% target
|
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
}
|
2016-08-05 23:28:13 +03:00
|
|
|
|
var chunks = new List<string> ();
|
|
|
|
|
if (target is WatchOSTarget && target.IsBCLProject) {
|
|
|
|
|
if (target.Name == "mscorlib") {
|
|
|
|
|
for (int i = (int) 'A'; i <= (int) 'Z'; i++) {
|
|
|
|
|
chunks.Add (((char) i).ToString () + ((char) i).ToString ());
|
|
|
|
|
}
|
|
|
|
|
} else if (target.Name == "System") {
|
|
|
|
|
chunks.Add ("AE");
|
|
|
|
|
chunks.Add ("FJ");
|
|
|
|
|
chunks.Add ("KR");
|
|
|
|
|
chunks.Add ("ST");
|
|
|
|
|
chunks.Add ("UZ");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (chunks.Count > 0) {
|
|
|
|
|
var chunked_targets = new List<string> ();
|
|
|
|
|
foreach (var chunk in chunks) {
|
|
|
|
|
var chunk_name = chunk [0] == chunk [1] ? chunk [0].ToString () : chunk;
|
|
|
|
|
chunk_name = chunk_name.ToLowerInvariant ();
|
2016-10-07 16:01:26 +03:00
|
|
|
|
var suffixes = target.IsMultiArchitecture ? new string [] { "32", "64" } : new string [] { "" };
|
|
|
|
|
foreach (var suffix in suffixes) {
|
|
|
|
|
var target_name = string.Format ("exec{0}-dev{2}-{1}-{3}", make_escaped_suffix, make_escaped_name, suffix, chunk_name);
|
|
|
|
|
writer.WriteTarget (target_name, "xharness/xharness.exe");
|
|
|
|
|
writer.WriteLine ("\t@echo Executing subset: {0}-{1}", chunk [0], chunk [1]);
|
2018-11-16 22:24:35 +03:00
|
|
|
|
writer.WriteLine ("\t$(Q) $(SYSTEM_MONO) --debug $(XIBUILD_EXE_PATH) -t -- $(CURDIR)/xharness/xharness.exe $(XHARNESS_VERBOSITY) --run \"{0}\" --target {1}-device --sdkroot $(XCODE_DEVELOPER_ROOT) --configuration $(CONFIG){4} --logdirectory \"$(abspath $(CURDIR))/logs/$@\" --setenv:NUNIT_FILTER_START={2} --setenv:NUNIT_FILTER_END={3}", target.ProjectPath, target.Platform, chunk [0], chunk [1], suffix);
|
2016-10-07 16:01:26 +03:00
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
writer.WriteTarget ("run{0}-dev{2}-{1}-{3}", "xharness/xharness.exe", make_escaped_suffix, make_escaped_name, suffix, chunk_name);
|
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) build{0}-dev{2}-{1}", make_escaped_suffix, make_escaped_name, suffix);
|
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) install{0}-dev{2}-{1}", make_escaped_suffix, make_escaped_name, suffix);
|
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) exec{0}-dev{2}-{1}-{3}", make_escaped_suffix, make_escaped_name, suffix, chunk_name);
|
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
chunked_targets.Add (target_name);
|
|
|
|
|
}
|
2016-08-05 23:28:13 +03:00
|
|
|
|
}
|
|
|
|
|
writer.WriteTarget ("exec{0}-dev{2}-{1}", string.Join (" ", chunked_targets), make_escaped_suffix, make_escaped_name, target.MakefileWhereSuffix);
|
|
|
|
|
writer.WriteLine ("\t@echo Chunked tests {0} succeeded.", target.Name);
|
|
|
|
|
} else {
|
2016-10-07 16:01:26 +03:00
|
|
|
|
if (target.IsMultiArchitecture) {
|
|
|
|
|
writer.WriteTarget ("exec{0}-dev32-{1}", "xharness/xharness.exe", make_escaped_suffix, make_escaped_name);
|
2018-11-16 22:24:35 +03:00
|
|
|
|
writer.WriteLine ("\t$(Q) $(SYSTEM_MONO) --debug $(XIBUILD_EXE_PATH) -t -- $(CURDIR)/xharness/xharness.exe $(XHARNESS_VERBOSITY) --run \"{0}\" --target {1}-device --sdkroot $(XCODE_DEVELOPER_ROOT) --configuration $(CONFIG)32 --logdirectory \"$(abspath $(CURDIR))/logs/$@\"", target.ProjectPath, target.Platform);
|
2016-10-07 16:01:26 +03:00
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
|
|
|
|
|
writer.WriteTarget ("exec{0}-dev64-{1}", "xharness/xharness.exe", make_escaped_suffix, make_escaped_name);
|
2018-11-16 22:24:35 +03:00
|
|
|
|
writer.WriteLine ("\t$(Q) $(SYSTEM_MONO) --debug $(XIBUILD_EXE_PATH) -t -- $(CURDIR)/xharness/xharness.exe $(XHARNESS_VERBOSITY) --run \"{0}\" --target {1}-device --sdkroot $(XCODE_DEVELOPER_ROOT) --configuration $(CONFIG)64 --logdirectory \"$(abspath $(CURDIR))/logs/$@\"", target.ProjectPath, target.Platform);
|
2016-10-07 16:01:26 +03:00
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
} else {
|
|
|
|
|
writer.WriteTarget ("exec{0}-dev{2}-{1}", "xharness/xharness.exe", make_escaped_suffix, make_escaped_name, target.MakefileWhereSuffix);
|
2018-11-16 22:24:35 +03:00
|
|
|
|
writer.WriteLine ("\t$(Q) $(SYSTEM_MONO) --debug $(XIBUILD_EXE_PATH) -t -- $(CURDIR)/xharness/xharness.exe $(XHARNESS_VERBOSITY) --run \"{0}\" --target {1}-device --sdkroot $(XCODE_DEVELOPER_ROOT) --configuration $(CONFIG) --logdirectory \"$(abspath $(CURDIR))/logs/$@\"", target.ProjectPath, target.Platform);
|
2016-10-07 16:01:26 +03:00
|
|
|
|
}
|
2016-08-05 23:28:13 +03:00
|
|
|
|
}
|
2016-07-25 22:01:34 +03:00
|
|
|
|
writer.WriteLine ();
|
2016-05-26 16:06:52 +03:00
|
|
|
|
|
|
|
|
|
// targets that does both sim and device
|
2016-07-25 22:01:34 +03:00
|
|
|
|
if (!(target is UnifiedTarget) /* exclude Unified so that we don't end up duplicating these targets */) {
|
2016-05-26 16:06:52 +03:00
|
|
|
|
// build target
|
|
|
|
|
writer.WriteTarget ("build{0}-{1}", "build{0}-dev-{1} build{0}-sim-{1}", make_escaped_suffix, make_escaped_name);
|
|
|
|
|
writer.WriteLine ("\t$(Q) echo Build succeeded"); // This is important, otherwise we'll end up executing the catch-all build-% target
|
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
// run target
|
|
|
|
|
writer.WriteTarget ("run{0}-{1}", "run{0}-dev-{1} run{0}-sim-{1}", make_escaped_suffix, make_escaped_name);
|
|
|
|
|
writer.WriteLine ("\t$(Q) echo Run succeeded"); // This is important, otherwise we'll end up executing the catch-all run-% target
|
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
writer.WriteLine ("# Container targets that run multiple test projects");
|
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
writer.WriteLine ("run-local:"); // run every single test we have everywhere
|
|
|
|
|
writer.WriteLine ("\t$(Q) rm -rf \".$@-failure.stamp\"");
|
|
|
|
|
foreach (var target in allTargets) {
|
2019-05-31 14:05:22 +03:00
|
|
|
|
if (!target.IsExe || target.Name.IndexOf ("bcl-test", 0, StringComparison.Ordinal) != -1)
|
2016-05-26 16:06:52 +03:00
|
|
|
|
continue;
|
|
|
|
|
|
2017-01-04 21:45:26 +03:00
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) \"run{0}-sim-{1}\" || echo \"run{0}-sim-{1} failed\" >> \".$@-failure.stamp\"", target.GetMakeSuffix (false), target.GetMakeName (false));
|
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) \"run{0}-dev-{1}\" || echo \"run{0}-dev-{1} failed\" >> \".$@-failure.stamp\"", target.GetMakeSuffix (false), target.GetMakeName (false));
|
2016-05-26 16:06:52 +03:00
|
|
|
|
}
|
|
|
|
|
writer.WriteLine ("\t$(Q) if test -e \".$@-failure.stamp\"; then cat \".$@-failure.stamp\"; rm \".$@-failure.stamp\"; exit 1; fi");
|
|
|
|
|
|
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
writer.WriteLine ("run-sim run-all-sim:"); // run every single test we have in the simulator
|
|
|
|
|
writer.WriteLine ("\t$(Q) rm -rf \".$@-failure.stamp\"");
|
|
|
|
|
foreach (var target in allTargets) {
|
2019-05-31 14:05:22 +03:00
|
|
|
|
if (!target.IsExe || target.Name.IndexOf ("bcl-test", 0, StringComparison.Ordinal) != -1)
|
2016-05-26 16:06:52 +03:00
|
|
|
|
continue;
|
|
|
|
|
|
2017-01-04 21:45:26 +03:00
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) \"run{0}-sim-{1}\" || echo \"run{0}-sim-{1} failed\" >> \".$@-failure.stamp\"", target.GetMakeSuffix (false), target.GetMakeName (false));
|
2016-05-26 16:06:52 +03:00
|
|
|
|
}
|
|
|
|
|
writer.WriteLine ("\t$(Q) if test -e \".$@-failure.stamp\"; then cat \".$@-failure.stamp\"; rm \".$@-failure.stamp\"; exit 1; fi");
|
|
|
|
|
|
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
writer.WriteLine ("run-dev run-all-dev:"); // run every single test we have on device
|
|
|
|
|
writer.WriteLine ("\t$(Q) rm -rf \".$@-failure.stamp\"");
|
|
|
|
|
foreach (var target in allTargets) {
|
2019-05-31 14:05:22 +03:00
|
|
|
|
if (!target.IsExe || target.Name.IndexOf ("bcl-test", 0, StringComparison.Ordinal) != -1)
|
2016-05-26 16:06:52 +03:00
|
|
|
|
continue;
|
|
|
|
|
|
2017-01-04 21:45:26 +03:00
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) \"run{0}-dev-{1}\" || echo \"run{0}-dev-{1} failed\" >> \".$@-failure.stamp\"", target.GetMakeSuffix (false), target.GetMakeName (false));
|
2016-05-26 16:06:52 +03:00
|
|
|
|
}
|
|
|
|
|
writer.WriteLine ("\t$(Q) if test -e \".$@-failure.stamp\"; then cat \".$@-failure.stamp\"; rm \".$@-failure.stamp\"; exit 1; fi");
|
|
|
|
|
|
|
|
|
|
foreach (var mode in new string [] { "sim", "dev" }) {
|
2017-09-22 19:04:32 +03:00
|
|
|
|
WriteCollectionTarget (writer, "run-ios-" + mode, unified_targets.Where ((v) => v.IsExe && v.TestProject?.SkipiOSVariation != true), mode);
|
|
|
|
|
WriteCollectionTarget (writer, "run-tvos-" + mode, tvos_targets.Where ((v) => v.IsExe && v.TestProject?.SkiptvOSVariation != true), mode);
|
|
|
|
|
WriteCollectionTarget (writer, "run-watchos-" + mode, watchos_targets.Where ((v) => v.IsExe && v.TestProject?.SkipwatchOSVariation != true), mode);
|
2016-05-26 16:06:52 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
writer.WriteLine ("build build-all:"); // build everything
|
|
|
|
|
writer.WriteLine ("\t$(Q) rm -rf \".$@-failure.stamp\"");
|
2016-09-21 23:55:10 +03:00
|
|
|
|
foreach (var target in unified_targets) {
|
2019-05-31 14:05:22 +03:00
|
|
|
|
if (!target.IsExe || target.Name.IndexOf ("bcl-test", 0, StringComparison.Ordinal) != -1)
|
2016-05-26 16:06:52 +03:00
|
|
|
|
continue;
|
|
|
|
|
|
2017-01-04 21:45:26 +03:00
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) \"build-sim-{0}\" \"build-dev-{0}\" || echo \"build-{0} failed\" >> \".$@-failure.stamp\"", target.GetMakeName (false));
|
2016-05-26 16:06:52 +03:00
|
|
|
|
}
|
|
|
|
|
writer.WriteLine ("\t$(Q) if test -e \".$@-failure.stamp\"; then cat \".$@-failure.stamp\"; rm \".$@-failure.stamp\"; exit 1; fi");
|
|
|
|
|
|
|
|
|
|
// targets that run all platforms
|
|
|
|
|
writer.WriteLine ();
|
2016-09-21 23:55:10 +03:00
|
|
|
|
foreach (var target in unified_targets) {
|
2019-05-31 14:05:22 +03:00
|
|
|
|
if (!target.IsExe || target.Name.IndexOf ("bcl-test", 0, StringComparison.Ordinal) != -1)
|
2016-07-25 22:01:34 +03:00
|
|
|
|
continue;
|
2017-01-04 21:45:26 +03:00
|
|
|
|
var make_escaped_name = target.GetMakeName ();
|
2016-05-26 16:06:52 +03:00
|
|
|
|
|
2017-09-22 19:04:32 +03:00
|
|
|
|
var proj = target.TestProject;
|
|
|
|
|
var includeiOS = harness.INCLUDE_IOS && proj?.SkipiOSVariation != true;
|
|
|
|
|
var includetvOS = harness.INCLUDE_TVOS && proj?.SkiptvOSVariation != true;
|
|
|
|
|
var includewatchOS = harness.INCLUDE_WATCH && proj?.SkipwatchOSVariation != true;
|
|
|
|
|
|
|
|
|
|
var dependencies = new List<string> ();
|
|
|
|
|
if (includeiOS)
|
|
|
|
|
dependencies.Add ("ios");
|
|
|
|
|
if (includetvOS)
|
|
|
|
|
dependencies.Add ("tvos");
|
|
|
|
|
if (includewatchOS)
|
|
|
|
|
dependencies.Add ("watchos");
|
|
|
|
|
|
|
|
|
|
writer.WriteTarget ("build-sim-{0}", string.Join (" ", dependencies.Select ((v) => $"build-{v}-sim-{{0}}")), make_escaped_name);
|
2016-05-26 16:06:52 +03:00
|
|
|
|
writer.WriteLine ("\t$(Q) echo Simulator builds succeeded"); // This is important, otherwise we'll end up executing the catch-all build-% target
|
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
|
2017-09-22 19:04:32 +03:00
|
|
|
|
writer.WriteTarget ("build-dev-{0}", string.Join (" ", dependencies.Select ((v) => $"build-{v}-dev-{{0}}")), make_escaped_name);
|
2016-05-26 16:06:52 +03:00
|
|
|
|
writer.WriteLine ("\t$(Q) echo Device builds succeeded"); // This is important, otherwise we'll end up executing the catch-all build-% target
|
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
|
|
|
|
|
writer.WriteTarget ("build-{0}", "build-sim-{0} build-dev-{0}", make_escaped_name);
|
|
|
|
|
writer.WriteLine ("\t$(Q) echo Build succeeded"); // This is important, otherwise we'll end up executing the catch-all build-% target
|
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
|
|
|
|
|
writer.WriteTarget ("run-sim-{0}", "build-sim-{0}", make_escaped_name);
|
2017-09-22 19:04:32 +03:00
|
|
|
|
if (includeiOS) {
|
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) \"exec-ios-sim32-{0}\" || echo \"exec-ios-sim32-{0} failed\" >> \".$@-failure.stamp\"", target.GetMakeName (false));
|
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) \"exec-ios-sim64-{0}\" || echo \"exec-ios-sim64-{0} failed\" >> \".$@-failure.stamp\"", target.GetMakeName (false));
|
|
|
|
|
}
|
|
|
|
|
if (includetvOS)
|
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) \"exec-tvos-sim-{0}\" || echo \"exec-tvos-sim-{0} failed\" >> \".$@-failure.stamp\"", target.GetMakeName (false));
|
|
|
|
|
if (includewatchOS)
|
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) \"exec-watchos-sim-{0}\" || echo \"exec-watchos-sim-{0} failed\" >> \".$@-failure.stamp\"", target.GetMakeName (false));
|
2016-05-26 16:06:52 +03:00
|
|
|
|
writer.WriteLine ("\t$(Q) if test -e \".$@-failure.stamp\"; then cat \".$@-failure.stamp\"; rm \".$@-failure.stamp\"; exit 1; fi");
|
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
|
|
|
|
|
writer.WriteTarget ("run-dev-{0}", "build-dev-{0}", make_escaped_name);
|
2017-09-22 19:04:32 +03:00
|
|
|
|
if (includeiOS) {
|
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) \"install-ios-dev-{0}\" || echo \"install-ios-dev-{0} failed\" >> \".$@-failure.stamp\"", target.GetMakeName (false));
|
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) \"exec-ios-dev-{0}\" || echo \"exec-ios-dev-{0} failed\" >> \".$@-failure.stamp\"", target.GetMakeName (false));
|
|
|
|
|
}
|
|
|
|
|
if (includetvOS) {
|
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) \"install-tvos-dev-{0}\" || echo \"install-tvos-dev-{0} failed\" >> \".$@-failure.stamp\"", target.GetMakeName (false));
|
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) \"exec-tvos-dev-{0}\" || echo \"exec-tvos-dev-{0} failed\" >> \".$@-failure.stamp\"", target.GetMakeName (false));
|
|
|
|
|
}
|
|
|
|
|
if (includewatchOS) {
|
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) \"install-watchos-dev-{0}\" || echo \"install-watchos-dev-{0} failed\" >> \".$@-failure.stamp\"", target.GetMakeName (false));
|
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) \"exec-watchos-dev-{0}\" || echo \"exec-watchos-dev-{0} failed\" >> \".$@-failure.stamp\"", target.GetMakeName (false));
|
|
|
|
|
}
|
2016-05-26 16:06:52 +03:00
|
|
|
|
writer.WriteLine ("\t$(Q) if test -e \".$@-failure.stamp\"; then cat \".$@-failure.stamp\"; rm \".$@-failure.stamp\"; exit 1; fi");
|
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
|
|
|
|
|
writer.WriteTarget ("run-{0}", "build-{0}", make_escaped_name);
|
|
|
|
|
// sim
|
2017-09-22 19:04:32 +03:00
|
|
|
|
if (includeiOS) {
|
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) \"exec-ios-sim32-{0}\" || echo \"exec-ios-sim32-{0} failed\" >> \".$@-failure.stamp\"", target.GetMakeName (false));
|
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) \"exec-ios-sim64-{0}\" || echo \"exec-ios-sim64-{0} failed\" >> \".$@-failure.stamp\"", target.GetMakeName (false));
|
|
|
|
|
}
|
|
|
|
|
if (includetvOS)
|
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) \"exec-tvos-sim-{0}\" || echo \"exec-tvos-sim-{0} failed\" >> \".$@-failure.stamp\"", target.GetMakeName (false));
|
|
|
|
|
if (includewatchOS)
|
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) \"exec-watchos-sim-{0}\" || echo \"exec-watchos-sim-{0} failed\" >> \".$@-failure.stamp\"", target.GetMakeName (false));
|
2016-05-26 16:06:52 +03:00
|
|
|
|
// dev
|
2017-09-22 19:04:32 +03:00
|
|
|
|
if (includeiOS) {
|
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) \"install-ios-dev-{0}\" || echo \"install-ios-dev-{0} failed\" >> \".$@-failure.stamp\"", target.GetMakeName (false));
|
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) \"exec-ios-dev-{0}\" || echo \"exec-ios-dev-{0} failed\" >> \".$@-failure.stamp\"", target.GetMakeName (false));
|
|
|
|
|
}
|
|
|
|
|
if (includetvOS) {
|
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) \"install-tvos-dev-{0}\" || echo \"install-tvos-dev-{0} failed\" >> \".$@-failure.stamp\"", target.GetMakeName (false));
|
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) \"exec-tvos-dev-{0}\" || echo \"exec-tvos-dev-{0} failed\" >> \".$@-failure.stamp\"", target.GetMakeName (false));
|
|
|
|
|
}
|
|
|
|
|
if (includewatchOS) {
|
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) \"install-watchos-dev-{0}\" || echo \"install-watchos-dev-{0} failed\" >> \".$@-failure.stamp\"", target.GetMakeName (false));
|
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) \"exec-watchos-dev-{0}\" || echo \"exec-watchos-dev-{0} failed\" >> \".$@-failure.stamp\"", target.GetMakeName (false));
|
|
|
|
|
}
|
2016-05-26 16:06:52 +03:00
|
|
|
|
writer.WriteLine ("\t$(Q) if test -e \".$@-failure.stamp\"; then cat \".$@-failure.stamp\"; rm \".$@-failure.stamp\"; exit 1; fi");
|
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
|
|
|
|
|
// Wrench needs a slightly different approach, because we want to run some tests, even if other tests failed to build
|
|
|
|
|
// (the default is to build all, then run all if everything built). The problem is that there's no way (that I've found)
|
|
|
|
|
// to make the build parallelizable and support the wrench mode at the same time.
|
|
|
|
|
writer.WriteLine ("wrenchhelper-{0}:", make_escaped_name);
|
2016-09-21 23:55:10 +03:00
|
|
|
|
writer.WriteLine ("\t$(Q) rm -f \".$@-failure.stamp\" \".$@-ios-sim-build-failure.stamp\" \".$@-tvos-sim-build-failure.stamp\" \".$@-watchos-sim-build-failure.stamp\"");
|
2016-05-26 16:06:52 +03:00
|
|
|
|
writer.WriteLine ("\t$(Q) echo \"@MonkeyWrench: SetSummary:\"");
|
|
|
|
|
// first build (serialized)
|
2017-09-22 19:04:32 +03:00
|
|
|
|
if (includeiOS)
|
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) \"build-ios-sim-{0}\" || echo \"@MonkeyWrench: AddSummary: <b>ios failed to build</b> <br/>\" >> \".$@-ios-sim-build-failure.stamp\"", target.GetMakeName (false));
|
|
|
|
|
if (includetvOS)
|
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) \"build-tvos-sim-{0}\" || echo \"@MonkeyWrench: AddSummary: <b>tvos failed to build</b> <br/>\" >> \".$@-tvos-sim-build-failure.stamp\"", target.GetMakeName (false));
|
|
|
|
|
if (includewatchOS)
|
2017-01-04 21:45:26 +03:00
|
|
|
|
writer.WriteLine ("\t$(Q) $(MAKE) \"build-watchos-sim-{0}\" || echo \"@MonkeyWrench: AddSummary: <b>watchos failed to build</b> <br/>\" >> \".$@-watchos-sim-build-failure.stamp\"", target.GetMakeName (false));
|
2016-05-26 16:06:52 +03:00
|
|
|
|
// then run
|
2017-09-22 19:04:32 +03:00
|
|
|
|
if (includeiOS) {
|
|
|
|
|
writer.WriteLine ("\t$(Q) (test -e \".$@-ios-sim-build-failure.stamp\" && cat \".$@-ios-sim-build-failure.stamp\" >> \".$@-failure.stamp\") || $(MAKE) \"exec-ios-sim32-{0}\" || echo \"exec-ios-sim32-{0} failed\" >> \".$@-failure.stamp\"", target.GetMakeName (false));
|
|
|
|
|
writer.WriteLine ("\t$(Q) test -e \".$@-ios-sim-build-failure.stamp\" || $(MAKE) \"exec-ios-sim64-{0}\" || echo \"exec-ios-sim64-{0} failed\" >> \".$@-failure.stamp\"", target.GetMakeName (false));
|
|
|
|
|
}
|
|
|
|
|
if (includetvOS)
|
|
|
|
|
writer.WriteLine ("\t$(Q) (test -e \".$@-tvos-sim-build-failure.stamp\" && cat \".$@-tvos-sim-build-failure.stamp\" >> \".$@-failure.stamp\") || $(MAKE) \"exec-tvos-sim-{0}\" || echo \"exec-tvos-sim-{0} failed\" >> \".$@-failure.stamp\"", target.GetMakeName (false));
|
|
|
|
|
if (includewatchOS) {
|
2016-05-26 16:06:52 +03:00
|
|
|
|
if (harness.DisableWatchOSOnWrench) {
|
2017-01-04 21:45:26 +03:00
|
|
|
|
writer.WriteLine ("\t$(Q) (test -e \".$@-watchos-sim-build-failure.stamp\" && cat \".$@-watchos-sim-build-failure.stamp\" ) || $(MAKE) \"exec-watchos-sim-{0}\" || echo \"exec-watchos-sim-{0} failed\" ", target.GetMakeName (false));
|
2016-05-26 16:06:52 +03:00
|
|
|
|
} else {
|
2017-01-04 21:45:26 +03:00
|
|
|
|
writer.WriteLine ("\t$(Q) (test -e \".$@-watchos-sim-build-failure.stamp\" && cat \".$@-watchos-sim-build-failure.stamp\" >> \".$@-failure.stamp\") || $(MAKE) \"exec-watchos-sim-{0}\" || echo \"exec-watchos-sim-{0} failed\" >> \".$@-failure.stamp\"", target.GetMakeName (false));
|
2016-05-26 16:06:52 +03:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
writer.WriteLine ("\t$(Q) if test -e \".$@-failure.stamp\"; then cat \".$@-failure.stamp\"; rm \".$@-failure.stamp\"; exit 1; fi");
|
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
writer.WriteLine ();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|