diff --git a/msbuild/tests/Xamarin.iOS.Tasks.Tests/ProjectsTests/ProjectReference.cs b/msbuild/tests/Xamarin.iOS.Tasks.Tests/ProjectsTests/ProjectReference.cs index e6a3af90b5..90435c54e4 100644 --- a/msbuild/tests/Xamarin.iOS.Tasks.Tests/ProjectsTests/ProjectReference.cs +++ b/msbuild/tests/Xamarin.iOS.Tasks.Tests/ProjectsTests/ProjectReference.cs @@ -32,7 +32,7 @@ namespace Xamarin.iOS.Tasks NugetRestore ("../MyExtensionWithPackageReference/MyExtensionWithPackageReference.csproj"); // Can't use the in-process MSBuild engine, because it complains that the project file is invalid (the attribute 'Version' in the element '' is unrecognized) - var rv = ExecutionHelper.Execute ("xibuild", $"-- ../MyAppWithPackageReference/MyAppWithPackageReference.csproj /p:Platform={Platform} /p:Configuration=Debug", out var output); + var rv = ExecutionHelper.Execute (Configuration.XIBuildPath, $"-- ../MyAppWithPackageReference/MyAppWithPackageReference.csproj /p:Platform={Platform} /p:Configuration=Debug", out var output); if (rv != 0) { Console.WriteLine ("Build failed:"); Console.WriteLine (output); diff --git a/msbuild/xbuild-in-place b/msbuild/xbuild-in-place deleted file mode 100755 index 9836ca0cee..0000000000 --- a/msbuild/xbuild-in-place +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env bash - -self="$(dirname "$0")" -build_in_place_dir="$(python -c "import os; print os.path.realpath('$self/../_mac-build')")" -xammac_framework_dir="$build_in_place_dir/Library/Frameworks/Xamarin.Mac.framework/Versions/Current" -xbuild_external_dir="$build_in_place_dir/Library/Frameworks/Mono.framework/External" - -export TargetFrameworkFallbackSearchPaths="$xbuild_external_dir/xbuild-frameworks" -export MSBuildExtensionsPathFallbackPathsOverride="$xbuild_external_dir/xbuild" - -XamarinMacFrameworkRoot="$xammac_framework_dir" -TargetFrameworkIdentifier=Xamarin.Mac -TargetFrameworkVersion=v2.0 - -$(self)/../tools/xibuild/bin/Debug/xibuild.exe -- \ - /property:XamarinMacFrameworkRoot="$XamarinMacFrameworkRoot" \ - /property:TargetFrameworkIdentifier="$TargetFrameworkIdentifier" \ - /property:TargetFrameworkVersion="$TargetFrameworkVersion" \ - "$@" diff --git a/tests/Makefile b/tests/Makefile index 1be1d6a7e1..5901c99e97 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -47,8 +47,6 @@ export MSBuildExtensionsPathFallbackPathsOverride=$(IOS_DESTDIR)/Library/Framewo export XAMMAC_FRAMEWORK_PATH=$(MAC_DESTDIR)/Library/Frameworks/Xamarin.Mac.framework/Versions/Current export XamarinMacFrameworkRoot=$(MAC_DESTDIR)/Library/Frameworks/Xamarin.Mac.framework/Versions/Current -export PATH := $(abspath $(TOP)/tools/xibuild:$(PATH)) - ifneq ($(RELEASE),) ifneq ($(BITCODE),) CONFIG=Release-bitcode diff --git a/tests/common/Configuration.cs b/tests/common/Configuration.cs index 41c3b4a8ff..4eb03eea24 100644 --- a/tests/common/Configuration.cs +++ b/tests/common/Configuration.cs @@ -417,6 +417,7 @@ namespace Xamarin.Tests } } +#if !XAMMAC_TESTS public static string GetBaseLibrary (Profile profile) { switch (profile) { @@ -482,6 +483,7 @@ namespace Xamarin.Tests return "/Library/Frameworks/Mono.framework/Commands/mcs"; } } +#endif // !XAMMAC_TESTS public static void AssertXcodeSupports32Bit () { @@ -501,5 +503,9 @@ namespace Xamarin.Tests return Path.Combine (RootPath, "packages"); } } + + public static string XIBuildPath { + get { return Path.GetFullPath (Path.Combine (RootPath, "tools", "xibuild", "xibuild")); } + } } } diff --git a/tests/common/ExecutionHelper.cs b/tests/common/ExecutionHelper.cs index 998855e66e..fb2629fd66 100644 --- a/tests/common/ExecutionHelper.cs +++ b/tests/common/ExecutionHelper.cs @@ -84,7 +84,7 @@ namespace Xamarin.Tests output.Clear (); output_lines = null; - var rv = ExecutionHelper.Execute ("xibuild", $"-t -- {toolPath} " + string.Format (arguments, args), EnvironmentVariables, output, output, workingDirectory: WorkingDirectory); + var rv = ExecutionHelper.Execute (Configuration.XIBuildPath, $"-t -- {toolPath} " + string.Format (arguments, args), EnvironmentVariables, output, output, workingDirectory: WorkingDirectory); if ((rv != 0 || always_show_output) && output.Length > 0) Console.WriteLine ("\t" + output.ToString ().Replace ("\n", "\n\t")); @@ -375,7 +375,7 @@ namespace Xamarin.Tests public static string ToolPath { get { - return "xibuild"; + return Configuration.XIBuildPath; } } diff --git a/tests/common/mac/ProjectTestHelpers.cs b/tests/common/mac/ProjectTestHelpers.cs index 122905331e..6148c8e5fe 100644 --- a/tests/common/mac/ProjectTestHelpers.cs +++ b/tests/common/mac/ProjectTestHelpers.cs @@ -227,7 +227,7 @@ namespace Xamarin.MMP.Tests // In most cases we generate projects in tmp and this is not needed. But nuget and test projects can make that hard public static void CleanUnifiedProject (string csprojTarget) { - RunAndAssert ("xibuild", new StringBuilder ("-- " + csprojTarget + " /t:clean"), "Clean"); + RunAndAssert (Configuration.XIBuildPath, new StringBuilder ("-- " + csprojTarget + " /t:clean"), "Clean"); } public static string BuildProject (string csprojTarget, bool isUnified, bool shouldFail = false, bool release = false, string[] environment = null) @@ -267,7 +267,7 @@ namespace Xamarin.MMP.Tests if (isUnified) { buildArgs.Insert (0, " -- "); - return RunAndAssert ("xibuild", buildArgs, "Compile", shouldFail, getBuildProjectErrorInfo, environment); + return RunAndAssert (Configuration.XIBuildPath, buildArgs, "Compile", shouldFail, getBuildProjectErrorInfo, environment); } else return RunAndAssert ("/Applications/Visual Studio.app/Contents/MacOS/vstool", buildArgs, "Compile", shouldFail, getBuildProjectErrorInfo, environment); } @@ -581,7 +581,7 @@ namespace TestCase Environment.SetEnvironmentVariable ("XAMMAC_FRAMEWORK_PATH", rootDirectory + "/Library/Frameworks/Xamarin.Mac.framework/Versions/Current"); Environment.SetEnvironmentVariable ("XamarinMacFrameworkRoot", rootDirectory + "/Library/Frameworks/Xamarin.Mac.framework/Versions/Current"); - var rv = ExecutionHelper.Execute ("xibuild", $"-- /restore {StringUtils.Quote (project)}", out var output); + var rv = ExecutionHelper.Execute (Configuration.XIBuildPath, $"-- /restore {StringUtils.Quote (project)}", out var output); if (rv != 0) { Console.WriteLine ("nuget restore failed:"); Console.WriteLine (output); diff --git a/tests/xammac_tests/xammac_tests.csproj b/tests/xammac_tests/xammac_tests.csproj index 319ca51d32..e8ce769f56 100644 --- a/tests/xammac_tests/xammac_tests.csproj +++ b/tests/xammac_tests/xammac_tests.csproj @@ -17,7 +17,7 @@ full false bin\x86\Debug - __UNIFIED__;DEBUG;MONOMAC;XAMCORE_2_0 + __UNIFIED__;DEBUG;MONOMAC;XAMCORE_2_0;XAMMAC_TESTS prompt 4 false @@ -38,7 +38,7 @@ true bin\x86\Release - __UNIFIED__;MONOMAC;XAMCORE_2_0 + __UNIFIED__;MONOMAC;XAMCORE_2_0;XAMMAC_TESTS prompt 4 false @@ -60,8 +60,12 @@ + + + Configuration.cs + TestRuntime.cs diff --git a/tests/xharness/Harness.cs b/tests/xharness/Harness.cs index d7ec7f442a..590dbc3806 100644 --- a/tests/xharness/Harness.cs +++ b/tests/xharness/Harness.cs @@ -30,6 +30,10 @@ namespace xharness public bool UseSystem { get; set; } // if the system XI/XM should be used, or the locally build XI/XM. public HashSet Labels { get; } = new HashSet (); + public string XIBuildPath { + get { return Path.GetFullPath (Path.Combine (RootDirectory, "..", "tools", "xibuild", "xibuild")); } + } + public static string Timestamp { get { return $"{DateTime.Now:yyyyMMdd_HHmmss}"; diff --git a/tests/xharness/Jenkins.cs b/tests/xharness/Jenkins.cs index aafd17f5ec..99236e8cf3 100644 --- a/tests/xharness/Jenkins.cs +++ b/tests/xharness/Jenkins.cs @@ -2760,7 +2760,7 @@ function toggleAll (show) await RestoreNugetsAsync (log, resource); using (var xbuild = new Process ()) { - xbuild.StartInfo.FileName = "xibuild"; + xbuild.StartInfo.FileName = Harness.XIBuildPath; var args = new StringBuilder (); args.Append ("-- "); args.Append ("/verbosity:diagnostic "); @@ -2797,7 +2797,7 @@ function toggleAll (show) { // Don't require the desktop resource here, this shouldn't be that resource sensitive using (var xbuild = new Process ()) { - xbuild.StartInfo.FileName = "xibuild"; + xbuild.StartInfo.FileName = Harness.XIBuildPath; var args = new StringBuilder (); args.Append ("-- "); args.Append ("/verbosity:diagnostic "); @@ -2874,7 +2874,7 @@ function toggleAll (show) using (var proc = new Process ()) { proc.StartInfo.WorkingDirectory = WorkingDirectory; - proc.StartInfo.FileName = "xibuild"; + proc.StartInfo.FileName = Harness.XIBuildPath; var args = new StringBuilder (); args.Append ("-t -- "); args.Append (StringUtils.Quote (Path.GetFullPath (TestExecutable))).Append (' ');