Use a full path to xibuild. (#5140)
* Use a full path to xibuild. Use a full path to xibuild everywhere, since it's easier than making sure PATH is correct every time we want to invoke xibuild. Also remove the xbuild-in-place script, it's not used anymore. * Fix xibuild path lookup. * [xammac_tests] Remove unneeded csproj changes.
This commit is contained in:
Родитель
50bb4912e1
Коммит
f91e8fb811
|
@ -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 '<PackageReference>' 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);
|
||||
|
|
|
@ -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" \
|
||||
"$@"
|
|
@ -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
|
||||
|
|
|
@ -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")); }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\x86\Debug</OutputPath>
|
||||
<DefineConstants>__UNIFIED__;DEBUG;MONOMAC;XAMCORE_2_0</DefineConstants>
|
||||
<DefineConstants>__UNIFIED__;DEBUG;MONOMAC;XAMCORE_2_0;XAMMAC_TESTS</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<EnableCodeSigning>false</EnableCodeSigning>
|
||||
|
@ -38,7 +38,7 @@
|
|||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\x86\Release</OutputPath>
|
||||
<DefineConstants>__UNIFIED__;MONOMAC;XAMCORE_2_0</DefineConstants>
|
||||
<DefineConstants>__UNIFIED__;MONOMAC;XAMCORE_2_0;XAMMAC_TESTS</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<EnableCodeSigning>false</EnableCodeSigning>
|
||||
|
@ -60,8 +60,12 @@
|
|||
</Reference>
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="OpenTK" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="..\common\Configuration.cs">
|
||||
<Link>Configuration.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\common\TestRuntime.cs">
|
||||
<Link>TestRuntime.cs</Link>
|
||||
</Compile>
|
||||
|
|
|
@ -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<string> Labels { get; } = new HashSet<string> ();
|
||||
|
||||
public string XIBuildPath {
|
||||
get { return Path.GetFullPath (Path.Combine (RootDirectory, "..", "tools", "xibuild", "xibuild")); }
|
||||
}
|
||||
|
||||
public static string Timestamp {
|
||||
get {
|
||||
return $"{DateTime.Now:yyyyMMdd_HHmmss}";
|
||||
|
|
|
@ -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 (' ');
|
||||
|
|
Загрузка…
Ссылка в новой задаче