[devops] Stop building test dependencies on each test run. (#18096)
Stop building the test dependencies on each test run, and instead use the archived test dependencies we have from the main build: * Stop running 'make all' in tests/ on every separate test run. * Add a lot more stuff in the package-test-libraries.zip archive. * Extract all the new stuff on every test run. We add stuff from outside the tests/ directory, so adjust archive creation and extraction to use the root directory of the repository as the root of the zip archive as well. * Also add the introspection dependencies to the same archive to simplify the logic. * Fix xharness to not store absolute paths in generated projects. * Fix test project to not automatically run make in tests/test-libraries when running on the bots. Building the test dependencies takes ~10 minutes for each test run, so this saves about that time for each test run.
This commit is contained in:
Родитель
00de70eb8f
Коммит
cdac4507a2
|
@ -343,8 +343,20 @@ verify-system-vsmac-xcode-match:
|
|||
if [[ "$$SYSTEM_XCODE" != "$$VSMAC_XCODE" ]]; then echo "Error: the system's Xcode ($$SYSTEM_XCODE) does not match the Xcode selected in Visual Studio for Mac ($$VSMAC_XCODE). This will make tests fail in non-trivial ways, so please make sure both match the expected Xcode ($(shell dirname $(shell dirname $(XCODE_DEVELOPER_ROOT))))."; exit 1; fi
|
||||
|
||||
package-test-libraries.zip:
|
||||
$(Q) @$(MAKE) all -C test-libraries
|
||||
$(Q) mkdir -p $@.tmpdir
|
||||
$(Q) $(CP) -a test-libraries/* $@.tmpdir
|
||||
$(Q_GEN) cd $@.tmpdir && zip -9r --symlinks $(abspath $@) .
|
||||
$(Q) rm -rf $@.tmpdir
|
||||
$(Q) $(MAKE) all -C test-libraries
|
||||
$(Q) $(MAKE) all -C test-libraries/custom-type-assembly build-assembly
|
||||
$(Q_GEN) rm -f "$@" "$@.tmp"
|
||||
$(Q_GEN) cd $(TOP) && zip -9r --symlinks $(abspath $@).tmp ./tests/test-libraries
|
||||
$(Q_GEN) cd $(TOP) && zip -9r --symlinks $(abspath $@).tmp ./tests/mono-native/macOS/unified ./tests/mono-native/macOS/compat
|
||||
$(Q_GEN) cd $(TOP) && zip -9r --symlinks $(abspath $@).tmp ./tests/mono-native/iOS/unified ./tests/mono-native/iOS/compat
|
||||
$(Q_GEN) cd $(TOP) && zip -9r --symlinks $(abspath $@).tmp ./tests/bcl-test/generated ./tests/bcl-test/templates
|
||||
$(Q_GEN) cd $(TOP) && find tests -regex '.*/generated-projects/.*[c|f]sproj' | zip -9r --symlinks $(abspath $@).tmp -@
|
||||
$(Q_GEN) cd $(TOP) && find tests -regex '.*/generated-projects/.*sln' | zip -9r --symlinks $(abspath $@).tmp -@
|
||||
$(Q_GEN) cd $(TOP) && find tests -regex 'tests/test-libraries/custom-type-assembly/.libs/.*dll' | zip -9r --symlinks $(abspath $@).tmp -@
|
||||
$(Q_GEN) cd $(TOP) && git ls-files -o -- 'tests/*/Info-*plist' | zip -9r --symlinks $(abspath $@).tmp -@
|
||||
ifdef INCLUDE_XAMARIN_LEGACY
|
||||
ifdef INCLUDE_IOS
|
||||
$(Q_GEN) cd $(TOP) && zip -9r --symlinks $(abspath $@).tmp ./tools/mtouch/simlauncher*-sgen*
|
||||
endif
|
||||
endif
|
||||
$(Q) mv "$@".tmp "$@"
|
||||
|
|
|
@ -60,6 +60,6 @@
|
|||
</ItemGroup>
|
||||
|
||||
<Target Name="BeforeBuild" Inputs="@(TestLibrariesInput)" Outputs="@(TestLibrariesOutput)" BeforeTargets="BeforeBuild">
|
||||
<Exec Command="make -j8 -C $(TestLibrariesDirectory)" />
|
||||
<Exec Command="make -j8 -C $(TestLibrariesDirectory)" Condition="'$(BUILD_REVISION)' == ''" />
|
||||
</Target>
|
||||
</Project>
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
<IntermediateOutputPath>obj\$(Platform)\$(Configuration)-unified</IntermediateOutputPath>
|
||||
<DefineConstants></DefineConstants>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<RootTestsDirectory>..\..</RootTestsDirectory>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' Or '$(Configuration)' == 'Debug32' Or '$(Configuration)' == 'Debug64' Or '$(Configuration)' == 'Debug64_32' ">
|
||||
<DebugSymbols>True</DebugSymbols>
|
||||
|
@ -92,6 +93,6 @@
|
|||
</NativeReference>
|
||||
</ItemGroup>
|
||||
<Target Name="BeforeBuild" Inputs="@(TestLibrariesInput)" Outputs="@(TestLibrariesOutput)">
|
||||
<Exec Command="make -j8 -C $(TestLibrariesDirectory)" />
|
||||
<Exec Command="make -j8 -C $(TestLibrariesDirectory)" Condition="'$(BUILD_REVISION)' == ''" />
|
||||
</Target>
|
||||
</Project>
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
<IntermediateOutputPath>obj\$(Platform)\$(Configuration)-unified</IntermediateOutputPath>
|
||||
<DefineConstants></DefineConstants>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<RootTestsDirectory>..\..</RootTestsDirectory>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug'">
|
||||
<DebugSymbols>True</DebugSymbols>
|
||||
|
@ -80,6 +81,6 @@
|
|||
<PackageReference Include="NUnitLite" Version="3.12.0" />
|
||||
</ItemGroup>
|
||||
<Target Name="BeforeBuild" Inputs="@(TestLibrariesInput)" Outputs="@(TestLibrariesOutput)">
|
||||
<Exec Command="make -j8 -C $(TestLibrariesDirectory)" />
|
||||
<Exec Command="make -j8 -C $(TestLibrariesDirectory)" Condition="'$(BUILD_REVISION)' == ''" />
|
||||
</Target>
|
||||
</Project>
|
||||
|
|
|
@ -78,6 +78,6 @@
|
|||
</ItemGroup>
|
||||
|
||||
<Target Name="BuildTestLibraries" Inputs="@(TestLibrariesInput)" Outputs="@(TestLibrariesOutput)" BeforeTargets="BeforeBuild">
|
||||
<Exec Command="make -j8 -C $(TestLibrariesDirectory)" />
|
||||
<Exec Command="make -j8 -C $(TestLibrariesDirectory)" Condition="'$(BUILD_REVISION)' == ''" />
|
||||
</Target>
|
||||
</Project>
|
||||
|
|
|
@ -116,7 +116,7 @@
|
|||
<GeneratedTestOutput Include="..\StructsAndEnums.generated.cs" />
|
||||
</ItemGroup>
|
||||
<Target Name="BeforeBuild" Inputs="@(GeneratedTestInput)" Outputs="@(GeneratedTestOutput)">
|
||||
<Exec Command="make -j8 -C $(TestLibrariesDirectory)" />
|
||||
<Exec Command="make -j8 -C $(TestLibrariesDirectory)" Condition="'$(BUILD_REVISION)' == ''" />
|
||||
</Target>
|
||||
</Project>
|
||||
|
||||
|
|
|
@ -106,7 +106,7 @@
|
|||
<PackageReference Include="NUnitLite" Version="3.12.0" />
|
||||
</ItemGroup>
|
||||
<Target Name="BeforeBuild" Inputs="@(GeneratedTestInput)" Outputs="@(GeneratedTestOutput)">
|
||||
<Exec Command="make -j8 -C $(TestLibrariesDirectory)" />
|
||||
<Exec Command="make -j8 -C $(TestLibrariesDirectory)" Condition="'$(BUILD_REVISION)' == ''" />
|
||||
</Target>
|
||||
</Project>
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@
|
|||
<GeneratedTestOutput Include="..\..\tests\test-libraries\.libs\ios-fat\libtest2.a" />
|
||||
</ItemGroup>
|
||||
<Target Name="BeforeBuild" Inputs="@(GeneratedTestInput)" Outputs="@(GeneratedTestOutput)">
|
||||
<Exec Command="make -j8 -C $(TestLibrariesDirectory)" />
|
||||
<Exec Command="make -j8 -C $(TestLibrariesDirectory)" Condition="'$(BUILD_REVISION)' == ''" />
|
||||
</Target>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\bindings-test\iOS\bindings-test.csproj">
|
||||
|
|
|
@ -52,6 +52,6 @@
|
|||
</ItemGroup>
|
||||
|
||||
<Target Name="BuildTestLibraries" Inputs="@(TestLibrariesInput)" Outputs="@(TestLibrariesOutput)" BeforeTargets="BeforeBuild">
|
||||
<Exec Command="make -j8 -C $(TestLibrariesDirectory)" />
|
||||
<Exec Command="make -j8 -C $(TestLibrariesDirectory)" Condition="'$(BUILD_REVISION)' == ''" />
|
||||
</Target>
|
||||
</Project>
|
||||
|
|
|
@ -43,6 +43,6 @@
|
|||
</ItemGroup>
|
||||
|
||||
<Target Name="BuildTestLibraries" Inputs="@(TestLibrariesInput)" Outputs="@(TestLibrariesOutput)" BeforeTargets="BeforeBuild">
|
||||
<Exec Command="make -j8 -C $(TestLibrariesDirectory)" />
|
||||
<Exec Command="make -j8 -C $(TestLibrariesDirectory)" Condition="'$(BUILD_REVISION)' == ''" />
|
||||
</Target>
|
||||
</Project>
|
||||
|
|
|
@ -82,6 +82,6 @@
|
|||
</NativeReference>
|
||||
</ItemGroup>
|
||||
<Target Name="BeforeBuild" Inputs="@(TestLibrariesInput)" Outputs="@(TestLibrariesOutput)">
|
||||
<Exec Command="make -j8 -C $(TestLibrariesDirectory)" />
|
||||
<Exec Command="make -j8 -C $(TestLibrariesDirectory)" Condition="'$(BUILD_REVISION)' == ''" />
|
||||
</Target>
|
||||
</Project>
|
||||
|
|
|
@ -84,6 +84,6 @@
|
|||
<PackageReference Include="NUnitLite" Version="3.12.0" />
|
||||
</ItemGroup>
|
||||
<Target Name="BeforeBuild" Inputs="@(TestLibrariesInput)" Outputs="@(TestLibrariesOutput)">
|
||||
<Exec Command="make -j8 -C $(TestLibrariesDirectory)" />
|
||||
<Exec Command="make -j8 -C $(TestLibrariesDirectory)" Condition="'$(BUILD_REVISION)' == ''" />
|
||||
</Target>
|
||||
</Project>
|
||||
|
|
|
@ -70,7 +70,7 @@
|
|||
</None>
|
||||
</ItemGroup>
|
||||
<Target Name="BeforeBuild" Inputs="$(RepositoryPath)\tests\test-libraries\libframework.m" Outputs="$(RepositoryPath)\tests\test-libraries\.libs\ios-fat\XTest.framework;$(RepositoryPath)\tests\test-libraries\.libs\ios-fat\XSharedObjectTest.framework;$(RepositoryPath)\tests\test-libraries\.libs\ios-fat\XSharedArTest.framework">
|
||||
<Exec Command="make -j8 -C $(RepositoryPath)\tests\test-libraries" />
|
||||
<Exec Command="make -j8 -C $(RepositoryPath)\tests\test-libraries" Condition="'$(BUILD_REVISION)' == ''" />
|
||||
</Target>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.ObjCBinding.CSharp.targets" />
|
||||
<ItemGroup>
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
</None>
|
||||
</ItemGroup>
|
||||
<Target Name="BeforeBuild" Inputs="$(RepositoryPath)\tests\test-libraries\libframework.m" Outputs="$(RepositoryPath)\tests\test-libraries\.libs\ios-fat\XTest.framework;$(RepositoryPath)\tests\test-libraries\.libs\ios-fat\XSharedObjectTest.framework;$(RepositoryPath)\tests\test-libraries\.libs\ios-fat\XSharedArTest.framework">
|
||||
<Exec Command="make -j8 -C $(RepositoryPath)\tests\test-libraries" />
|
||||
<Exec Command="make -j8 -C $(RepositoryPath)\tests\test-libraries" Condition="'$(BUILD_REVISION)' == ''" />
|
||||
</Target>
|
||||
<ItemGroup>
|
||||
<ObjcBindingApiDefinition Include="$(RepositoryPath)\tests\bindings-framework-test\ApiDefinition.cs">
|
||||
|
|
|
@ -211,8 +211,8 @@
|
|||
|
||||
<Target Name="BuildTestLibraries" Inputs="@(GeneratedTestInput)" Outputs="@(GeneratedTestOutput)" BeforeTargets="BeforeBuild"
|
||||
Condition="!Exists('$(TestLibrariesDirectory)/.libs/macos/custom-type-assembly.dll') Or !Exists('$(TestLibrariesDirectory)/.libs/dotnet/macos/custom-type-assembly.dll')" >
|
||||
<Exec Command="make -j8 -C $(TestLibrariesDirectory)" />
|
||||
<Exec Command="make -j8 -C $(TestLibrariesDirectory)/custom-type-assembly build-assembly" />
|
||||
<Exec Command="make -j8 -C $(TestLibrariesDirectory)" Condition="'$(BUILD_REVISION)' == ''" />
|
||||
<Exec Command="make -j8 -C $(TestLibrariesDirectory)/custom-type-assembly build-assembly" Condition="'$(BUILD_REVISION)' == ''" />
|
||||
</Target>
|
||||
|
||||
<Target Name="ComputeDefineConstants" BeforeTargets="BeforeBuild">
|
||||
|
|
|
@ -405,6 +405,6 @@
|
|||
<Exec Command="xcrun -sdk $(_SmeltingSdk) metallib $(IntermediateOutputPath)\fragmentShader.air -o $(AppBundleDir)\fragmentShader.metallib" EnvironmentVariables="DEVELOPER_DIR=$(_SdkDevPath)" />
|
||||
</Target>
|
||||
<Target Name="BeforeBuild" Inputs="@(GeneratedTestInput)" Outputs="@(GeneratedTestOutput)" DependsOnTargets="CustomMetalSmelting" >
|
||||
<Exec Command="make -j8 -C $(TestLibrariesDirectory)" />
|
||||
<Exec Command="make -j8 -C $(TestLibrariesDirectory)" Condition="'$(BUILD_REVISION)' == ''" />
|
||||
</Target>
|
||||
</Project>
|
||||
|
|
|
@ -26,6 +26,7 @@ export XAMMAC_FRAMEWORK_PATH=$MAC_DESTDIR/Library/Frameworks/Xamarin.Mac.framewo
|
|||
export XamarinMacFrameworkRoot=$MAC_DESTDIR/Library/Frameworks/Xamarin.Mac.framework/Versions/Current
|
||||
export TargetFrameworkFallbackSearchPaths=$MAC_DESTDIR/Library/Frameworks/Mono.framework/External/xbuild-frameworks
|
||||
export MSBuildExtensionsPathFallbackPathsOverride=$MAC_DESTDIR/Library/Frameworks/Mono.framework/External/xbuild
|
||||
export RootTestsDirectory="$(pwd)"
|
||||
|
||||
make
|
||||
make .stamp-xharness-configure
|
||||
|
|
|
@ -331,7 +331,7 @@
|
|||
</Target>
|
||||
<Target Name="BeforeBuild" Inputs="@(GeneratedTestInput)" Outputs="@(GeneratedTestOutput)" DependsOnTargets="CustomMetalSmelting"
|
||||
Condition="!Exists('$(TestLibrariesDirectory)/.libs/macos/custom-type-assembly.dll') Or !Exists('$(TestLibrariesDirectory)/.libs/dotnet/macos/custom-type-assembly.dll')" >
|
||||
<Exec Command="make -j8 -C $(TestLibrariesDirectory)" EnvironmentVariables="MSBUILD_EXE_PATH=;MSBuildSDKsPath="/>
|
||||
<Exec Command="make -j8 -C $(TestLibrariesDirectory)/custom-type-assembly build-assembly" EnvironmentVariables="MSBUILD_EXE_PATH=;MSBuildSDKsPath="/>
|
||||
<Exec Command="make -j8 -C $(TestLibrariesDirectory)" EnvironmentVariables="MSBUILD_EXE_PATH=;MSBuildSDKsPath=" Condition="'$(BUILD_REVISION)' == ''" />
|
||||
<Exec Command="make -j8 -C $(TestLibrariesDirectory)/custom-type-assembly build-assembly" EnvironmentVariables="MSBUILD_EXE_PATH=;MSBuildSDKsPath=" Condition="'$(BUILD_REVISION)' == ''"/>
|
||||
</Target>
|
||||
</Project>
|
||||
|
|
|
@ -118,7 +118,7 @@ namespace Xharness {
|
|||
|
||||
public async Task InitializeAsync ()
|
||||
{
|
||||
AppInformation = await appBundleInformationParser.ParseFromProject (projectFilePath, target, buildConfiguration);
|
||||
AppInformation = await appBundleInformationParser.ParseFromProject2 (harness.AppBundleLocator, projectFilePath, target, buildConfiguration);
|
||||
AppInformation.Variation = variation;
|
||||
}
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@ namespace Xharness {
|
|||
path = Path.Combine (Path.GetDirectoryName (path), "tests");
|
||||
if (!Directory.Exists (path))
|
||||
throw new Exception ("Could not find the tests directory.");
|
||||
root_directory = path;
|
||||
root_directory = Path.GetFullPath (path);
|
||||
}
|
||||
return root_directory;
|
||||
}
|
||||
|
@ -112,6 +112,16 @@ namespace Xharness {
|
|||
ls_files_semaphore.Release ();
|
||||
}
|
||||
}
|
||||
|
||||
public static string EvaluateRootTestsDirectory (string value)
|
||||
{
|
||||
return value.Replace ("$(RootTestsDirectory)", RootDirectory);
|
||||
}
|
||||
|
||||
public static string InjectRootTestsDirectory (string value)
|
||||
{
|
||||
return value.Replace (RootDirectory, "$(RootTestsDirectory)");
|
||||
}
|
||||
}
|
||||
|
||||
public class Harness : IHarness {
|
||||
|
|
|
@ -0,0 +1,80 @@
|
|||
using System;
|
||||
using Microsoft.DotNet.XHarness.iOS.Shared;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.DotNet.XHarness.iOS.Shared.Utilities;
|
||||
using System.IO;
|
||||
using System.Xml;
|
||||
|
||||
using Xharness.Targets;
|
||||
|
||||
#nullable enable
|
||||
|
||||
namespace Xharness {
|
||||
public static class IAppBundleInformationParserExtensions {
|
||||
// This is a copy of this method: https://github.com/dotnet/xharness/blob/aa434d0c7e6eb46df1ec11b3c63add37d835c4d0/src/Microsoft.DotNet.XHarness.iOS.Shared/AppBundleInformationParser.cs#L43-L103
|
||||
// And then augmented to handle that the path to the Info.plist might have $(RootTestsDirectory) in it.
|
||||
public async static Task<AppBundleInformation> ParseFromProject2 (this IAppBundleInformationParser @this, IAppBundleLocator? _appBundleLocator, string projectFilePath, TestTarget target, string buildConfiguration)
|
||||
{
|
||||
var csproj = new XmlDocument ();
|
||||
csproj.LoadWithoutNetworkAccess (projectFilePath);
|
||||
|
||||
var projectDirectory = Path.GetDirectoryName (projectFilePath) ?? throw new DirectoryNotFoundException ($"Cannot find directory of project '{projectFilePath}'");
|
||||
|
||||
var appName = csproj.GetAssemblyName ();
|
||||
var infoPlistPath = csproj.GetInfoPListInclude () ?? throw new InvalidOperationException ("Couldn't locate PList include tag");
|
||||
|
||||
var infoPlist = new XmlDocument ();
|
||||
var plistPath = Path.Combine (projectDirectory, HarnessConfiguration.EvaluateRootTestsDirectory (infoPlistPath.Replace ('\\', Path.DirectorySeparatorChar)));
|
||||
infoPlist.LoadWithoutNetworkAccess (plistPath);
|
||||
|
||||
var bundleIdentifier = infoPlist.GetCFBundleIdentifier ();
|
||||
var bundleExecutable = infoPlist.GetCFBundleExecutable ();
|
||||
|
||||
Extension? extension = null;
|
||||
var extensionPointIdentifier = infoPlist.GetNSExtensionPointIdentifier ();
|
||||
if (!string.IsNullOrEmpty (extensionPointIdentifier)) {
|
||||
extension = extensionPointIdentifier.ParseFromNSExtensionPointIdentifier ();
|
||||
}
|
||||
|
||||
var platform = target.IsSimulator () ? "iPhoneSimulator" : "iPhone";
|
||||
|
||||
string? appPath = null;
|
||||
if (_appBundleLocator is not null)
|
||||
appPath = await _appBundleLocator.LocateAppBundle (csproj, projectFilePath, target, buildConfiguration);
|
||||
|
||||
appPath ??= csproj.GetOutputPath (platform, buildConfiguration)?.Replace ('\\', Path.DirectorySeparatorChar);
|
||||
|
||||
appPath = Path.Combine (
|
||||
projectDirectory,
|
||||
appPath ?? string.Empty,
|
||||
appName + (extension != null ? ".appex" : ".app"));
|
||||
|
||||
var arch = csproj.GetMtouchArch (platform, buildConfiguration);
|
||||
|
||||
var supports32 = arch is not null && (Contains (arch, "ARMv7") || Contains (arch, "i386"));
|
||||
|
||||
if (!Directory.Exists (appPath))
|
||||
throw new DirectoryNotFoundException ($"The app bundle directory `{appPath}` does not exist");
|
||||
|
||||
var launchAppPath = target.ToRunMode () == RunMode.WatchOS
|
||||
? Directory.GetDirectories (Path.Combine (appPath, "Watch"), "*.app") [0]
|
||||
: appPath;
|
||||
|
||||
return new AppBundleInformation (
|
||||
appName,
|
||||
bundleIdentifier,
|
||||
appPath,
|
||||
launchAppPath,
|
||||
supports32,
|
||||
extension,
|
||||
bundleExecutable);
|
||||
}
|
||||
|
||||
// This method was added because .NET Standard 2.0 doesn't have case ignorant Contains() for String.
|
||||
static bool Contains (string haystack, string needle)
|
||||
{
|
||||
return haystack.IndexOf (needle, StringComparison.InvariantCultureIgnoreCase) > -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -34,6 +34,8 @@ namespace Xharness.Jenkins.TestTasks {
|
|||
{
|
||||
var xcodeRoot = Jenkins.Harness.XcodeRoot;
|
||||
|
||||
process.StartInfo.EnvironmentVariables ["RootTestsDirectory"] = HarnessConfiguration.RootDirectory;
|
||||
|
||||
switch (Platform) {
|
||||
case TestPlatform.iOS:
|
||||
case TestPlatform.iOS_Unified:
|
||||
|
|
|
@ -29,6 +29,7 @@ namespace Xharness.Jenkins.TestTasks {
|
|||
args.Add ($"/p:Platform={projectPlatform}");
|
||||
if (SpecifyConfiguration)
|
||||
args.Add ($"/p:Configuration={projectConfiguration}");
|
||||
args.Add ($"/p:RootTestsDirectory={HarnessConfiguration.RootDirectory}");
|
||||
if (Platform == TestPlatform.MacCatalyst)
|
||||
args.Add ("/r");
|
||||
args.Add (projectFile);
|
||||
|
|
|
@ -127,9 +127,10 @@ namespace Xharness {
|
|||
inputProject.AddAdditionalDefines (Flavor == MonoNativeFlavor.Compat ? "MONO_NATIVE_COMPAT" : "MONO_NATIVE_UNIFIED");
|
||||
inputProject.ResolveAllPaths (TemplatePath);
|
||||
|
||||
var template_info_plist = inputProject.GetInfoPListInclude ().Replace ('\\', '/');
|
||||
var template_info_plist = HarnessConfiguration.EvaluateRootTestsDirectory (inputProject.GetInfoPListInclude ().Replace ('\\', '/'));
|
||||
var target_info_plist = Path.Combine (Path.GetDirectoryName (ProjectPath), "Info" + FlavorSuffix + ".plist");
|
||||
SetInfoPListMinimumOSVersion (template_info_plist, target_info_plist);
|
||||
target_info_plist = HarnessConfiguration.InjectRootTestsDirectory (target_info_plist);
|
||||
inputProject.FixInfoPListInclude (FlavorSuffix, newName: target_info_plist);
|
||||
|
||||
inputProject.Save (ProjectPath, log);
|
||||
|
|
|
@ -190,7 +190,6 @@ namespace Xharness {
|
|||
"CodesignEntitlements",
|
||||
"TestLibrariesDirectory",
|
||||
"HintPath",
|
||||
"RootTestsDirectory",
|
||||
};
|
||||
var attributes_with_paths = new []
|
||||
{
|
||||
|
@ -245,12 +244,25 @@ namespace Xharness {
|
|||
if (makeFullPath) {
|
||||
input = input.Replace ('\\', '/'); // make unix-style
|
||||
input = Path.GetFullPath (Path.Combine (dir, input));
|
||||
var root = HarnessConfiguration.RootDirectory;
|
||||
if (input.Contains (root)) {
|
||||
input = input.Replace (root, "$(RootTestsDirectory)");
|
||||
} else if (input.Contains (Path.GetDirectoryName (root))) {
|
||||
input = input.Replace (Path.GetDirectoryName (root), "$(RootTestsDirectory)/..");
|
||||
}
|
||||
|
||||
if (input == "")
|
||||
input = "./";
|
||||
input = input.Replace ('/', '\\'); // make windows-style again
|
||||
}
|
||||
|
||||
return input;
|
||||
};
|
||||
|
||||
var rootTestsDirectoryNodes = csproj.SelectElementNodes ("RootTestsDirectory");
|
||||
foreach (var node in rootTestsDirectoryNodes)
|
||||
node.InnerText = HarnessConfiguration.RootDirectory;
|
||||
|
||||
foreach (var key in nodes_with_paths) {
|
||||
var nodes = csproj.SelectElementNodes (key);
|
||||
foreach (var node in nodes)
|
||||
|
@ -259,8 +271,9 @@ namespace Xharness {
|
|||
|
||||
foreach (var key in nodes_with_variables) {
|
||||
var nodes = csproj.SelectElementNodes (key);
|
||||
foreach (var node in nodes)
|
||||
node.InnerText = node.InnerText.Replace ("${ProjectDir}", StringUtils.Quote (Path.GetDirectoryName (project_path)));
|
||||
foreach (var node in nodes) {
|
||||
node.InnerText = node.InnerText.Replace ("${ProjectDir}", StringUtils.Quote (HarnessConfiguration.InjectRootTestsDirectory (Path.GetFullPath (Path.GetDirectoryName (project_path)))));
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var kvp in attributes_with_paths) {
|
||||
|
|
|
@ -86,7 +86,8 @@ namespace Xharness.Targets {
|
|||
|
||||
XmlDocument info_plist = new XmlDocument ();
|
||||
var target_info_plist = Path.Combine (TargetDirectory, $"Info{suffix}.plist");
|
||||
info_plist.LoadWithoutNetworkAccess (Path.Combine (TargetDirectory, OriginalInfoPListInclude));
|
||||
var original_info_plist_include = HarnessConfiguration.EvaluateRootTestsDirectory (OriginalInfoPListInclude);
|
||||
info_plist.LoadWithoutNetworkAccess (Path.Combine (TargetDirectory, original_info_plist_include));
|
||||
BundleIdentifier = info_plist.GetCFBundleIdentifier () + "-today";
|
||||
info_plist.SetCFBundleIdentifier (BundleIdentifier + ".todayextension");
|
||||
info_plist.SetMinimumOSVersion (GetMinimumOSVersion (SdkVersions.MiniOS));
|
||||
|
|
|
@ -143,7 +143,8 @@ namespace Xharness.Targets {
|
|||
|
||||
XmlDocument info_plist = new XmlDocument ();
|
||||
var target_info_plist = Path.Combine (TargetDirectory, $"Info{Suffix}-extension.plist");
|
||||
info_plist.LoadWithoutNetworkAccess (Path.Combine (TargetDirectory, OriginalInfoPListInclude));
|
||||
var original_info_plist_include = HarnessConfiguration.EvaluateRootTestsDirectory (OriginalInfoPListInclude);
|
||||
info_plist.LoadWithoutNetworkAccess (Path.Combine (TargetDirectory, original_info_plist_include));
|
||||
BundleIdentifier = info_plist.GetCFBundleIdentifier () + "_watch";
|
||||
if (BundleIdentifier.Length >= 58)
|
||||
BundleIdentifier = BundleIdentifier.Substring (0, 57); // If the main app's bundle id is 58 characters (or sometimes more), then the watch extension crashes at launch. radar #29847128.
|
||||
|
|
|
@ -25,7 +25,8 @@ namespace Xharness.Targets {
|
|||
{
|
||||
XmlDocument info_plist = new XmlDocument ();
|
||||
var target_info_plist = Path.Combine (TargetDirectory, "Info" + Suffix + ".plist");
|
||||
info_plist.LoadWithoutNetworkAccess (Path.Combine (TargetDirectory, OriginalInfoPListInclude));
|
||||
var original_info_plist_include = HarnessConfiguration.EvaluateRootTestsDirectory (OriginalInfoPListInclude);
|
||||
info_plist.LoadWithoutNetworkAccess (Path.Combine (TargetDirectory, original_info_plist_include));
|
||||
BundleIdentifier = info_plist.GetCFBundleIdentifier ();
|
||||
info_plist.SetMinimumOSVersion (GetMinimumOSVersion (info_plist.GetMinimumOSVersion ()));
|
||||
info_plist.SetUIDeviceFamily (UIDeviceFamily);
|
||||
|
|
|
@ -178,8 +178,9 @@ namespace Xharness {
|
|||
var projectReferences = new List<TestProject> ();
|
||||
foreach (var pr in doc.GetProjectReferences ()) {
|
||||
var prPath = pr.Replace ('\\', '/');
|
||||
prPath = HarnessConfiguration.EvaluateRootTestsDirectory (prPath);
|
||||
if (!allProjectReferences.TryGetValue (prPath, out var tp)) {
|
||||
tp = new TestProject (Label, pr.Replace ('\\', '/'));
|
||||
tp = new TestProject (Label, prPath);
|
||||
tp.TestPlatform = TestPlatform;
|
||||
await tp.CreateCopyAsync (log, processManager, test, rootDirectory, allProjectReferences);
|
||||
allProjectReferences.Add (prPath, tp);
|
||||
|
|
|
@ -179,6 +179,7 @@
|
|||
<Compile Include="..\..\tools\common\ApplePlatform.cs">
|
||||
<Link>ApplePlatform.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="IAppBundleInformationParserExtensions.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="..\..\tools\common\SdkVersions.cs">
|
||||
|
|
|
@ -130,24 +130,7 @@ steps:
|
|||
set -x
|
||||
set -e
|
||||
|
||||
make -C $(Build.SourcesDirectory)/xamarin-macios/tools/mtouch package-introspection-dependencies.zip || RC=$?
|
||||
exit $RC
|
||||
displayName: 'Package introspection dependencies'
|
||||
continueOnError: true # not a terrible blocking issue
|
||||
timeoutInMinutes: 60
|
||||
|
||||
- task: PublishPipelineArtifact@1
|
||||
displayName: 'Publish introspection dependencies'
|
||||
inputs:
|
||||
targetPath: $(Build.SourcesDirectory)/xamarin-macios/tools/mtouch/package-introspection-dependencies.zip
|
||||
artifactName: '${{ parameters.uploadPrefix }}package-introspection-dependencies'
|
||||
continueOnError: true
|
||||
|
||||
- bash: |
|
||||
set -x
|
||||
set -e
|
||||
|
||||
make -C $(Build.SourcesDirectory)/xamarin-macios/tests package-test-libraries.zip
|
||||
make -C $(Build.SourcesDirectory)/xamarin-macios/tests package-test-libraries.zip
|
||||
name: introPkg
|
||||
displayName: 'Package test libraries dependencies'
|
||||
continueOnError: true # not a terrible blocking issue
|
||||
|
|
|
@ -101,29 +101,12 @@ steps:
|
|||
- bash: |
|
||||
set -x
|
||||
set -e
|
||||
make -C tests -j8 all
|
||||
make -C tools/xibuild
|
||||
workingDirectory: $(System.DefaultWorkingDirectory)/xamarin-macios
|
||||
displayName: Build test dependencies
|
||||
timeoutInMinutes: 30
|
||||
|
||||
# get and expand the needed bins for intro to work.
|
||||
- task: DownloadPipelineArtifact@2
|
||||
displayName: Download introspection dependencies
|
||||
inputs:
|
||||
patterns: '**/package-introspection-dependencies.zip'
|
||||
allowFailedBuilds: true
|
||||
path: $(Build.SourcesDirectory)/artifacts/tmp
|
||||
|
||||
- bash: |
|
||||
ls -Rla $(Build.SourcesDirectory)/artifacts/tmp
|
||||
mv $(Build.SourcesDirectory)/artifacts/tmp/${{ parameters.uploadPrefix }}package-introspection-dependencies/package-introspection-dependencies.zip .
|
||||
unzip -o package-introspection-dependencies.zip
|
||||
workingDirectory: $(Build.SourcesDirectory)/xamarin-macios/tools/mtouch
|
||||
displayName: Expand introspection dependencies.
|
||||
timeoutInMinutes: 10
|
||||
|
||||
# get and expand the needed libs for monotouch
|
||||
# download the prebuilt test dependencies
|
||||
- task: DownloadPipelineArtifact@2
|
||||
displayName: Download test libraries dependencies
|
||||
inputs:
|
||||
|
@ -131,13 +114,11 @@ steps:
|
|||
allowFailedBuilds: true
|
||||
path: $(Build.SourcesDirectory)/artifacts/tmp
|
||||
|
||||
# this step replaces the test-libraries dir
|
||||
# expand all the prebuilt test dependencies
|
||||
- bash: |
|
||||
ls -Rla $(Build.SourcesDirectory)/artifacts/tmp
|
||||
rm -Rf test-libraries/*
|
||||
mv $(Build.SourcesDirectory)/artifacts/tmp/${{ parameters.uploadPrefix }}package-test-libraries/package-test-libraries.zip .
|
||||
unzip -o package-test-libraries.zip -d test-libraries
|
||||
workingDirectory: $(Build.SourcesDirectory)/xamarin-macios/tests
|
||||
unzip -o $(Build.SourcesDirectory)/artifacts/tmp/${{ parameters.uploadPrefix }}package-test-libraries/package-test-libraries.zip -d .
|
||||
workingDirectory: $(System.DefaultWorkingDirectory)/xamarin-macios
|
||||
displayName: Expand test libraries.
|
||||
timeoutInMinutes: 10
|
||||
|
||||
|
|
|
@ -116,10 +116,10 @@ steps:
|
|||
# this step replaces the test-libraries dir
|
||||
- pwsh: |
|
||||
$zip = "$(Build.SourcesDirectory)/artifacts/tmp/${{ parameters.uploadPrefix }}package-test-libraries/package-test-libraries.zip"
|
||||
$target = "$(Build.SourcesDirectory)/xamarin-macios/tests/test-libraries"
|
||||
$target = "$(Build.SourcesDirectory)/xamarin-macios"
|
||||
Expand-Archive -Force $zip -DestinationPath $target
|
||||
Get-ChildItem "$target" -Recurse
|
||||
workingDirectory: $(Build.SourcesDirectory)/xamarin-macios/tests
|
||||
workingDirectory: $(Build.SourcesDirectory)/xamarin-macios
|
||||
displayName: Expand test libraries.
|
||||
timeoutInMinutes: 10
|
||||
|
||||
|
|
|
@ -10,4 +10,3 @@ simlauncher64-sgen
|
|||
*.stamp
|
||||
mtouch.csproj.inc
|
||||
*.frameworks
|
||||
package-introspection-dependencies.zip
|
||||
|
|
|
@ -435,29 +435,6 @@ verify-sorted-resx:
|
|||
exit 1; \
|
||||
fi
|
||||
|
||||
ifdef INCLUDE_XAMARIN_LEGACY
|
||||
ifdef INCLUDE_IOS
|
||||
PACKAGE_INTROSPECTION_DEPENDENCIES=1
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef PACKAGE_INTROSPECTION_DEPENDENCIES
|
||||
ifdef IOS_SUPPORTS_32BIT_ARCHITECTURES
|
||||
package-introspection-dependencies.zip: simlauncher32-sgen simlauncher64-sgen
|
||||
else
|
||||
package-introspection-dependencies.zip: simlauncher64-sgen
|
||||
endif
|
||||
$(Q) mkdir -p $@.tmpdir
|
||||
$(Q) $(CP) -a simlauncher*-sgen* $@.tmpdir
|
||||
$(Q_GEN) cd $@.tmpdir && zip -9r $(abspath $@) .
|
||||
$(Q) rm -rf $@.tmpdir
|
||||
else
|
||||
package-introspection-dependencies.zip:
|
||||
@# This is dumb, but it makes things much easier in Azure DevOps if we just always have a zip file with something in it (doesn't matter what, so I'm just adding the Makefile)
|
||||
$(Q) rm -f "$@"
|
||||
$(Q) zip --quiet "$@" Makefile
|
||||
endif
|
||||
|
||||
clean-dotnet:
|
||||
rm -f $(TARGETS_DOTNET)
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче