Skip to content

Commit

Permalink
[xharness] Add support for adding PropertyGroups for unknown platform…
Browse files Browse the repository at this point in the history
…/configuration values in a csproj. Fixes xamarin/maccore@2277. (#9347)

Fixes xamarin/maccore#2277.
  • Loading branch information
rolfbjarne committed Aug 12, 2020
1 parent 621bf6c commit d36853c
Showing 1 changed file with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,25 @@ public static void AddAdditionalDefines (this XmlDocument csproj, string value,
return;
}

throw new Exception ("Could not find where to add a new DefineConstants node");
// Create a new PropertyGroup with the desired condition, and add it just after the last PropertyGroup in the csproj.
var projectNode = csproj.SelectSingleNode ("//*[local-name() = 'Project']");
var lastPropertyGroup = csproj.SelectNodes ("//*[local-name() = 'PropertyGroup']").Cast<XmlNode> ().Last ();
var newPropertyGroup = csproj.CreateElement ("PropertyGroup", csproj.GetNamespace ());
var conditionAttribute = csproj.CreateAttribute ("Condition");
var condition = "";
if (!string.IsNullOrEmpty (platform))
condition = $"'$(Platform)' == '{platform}'";
if (!string.IsNullOrEmpty (configuration)) {
if (!string.IsNullOrEmpty (condition))
condition += " And ";
condition += $"'$(Configuration)' == '{configuration}'";
}
conditionAttribute.Value = condition;
newPropertyGroup.Attributes.Append (conditionAttribute);
var defineConstantsElement = csproj.CreateElement ("DefineConstants", csproj.GetNamespace ());
defineConstantsElement.InnerText = "$(DefineConstants);" + value;
newPropertyGroup.AppendChild (defineConstantsElement);
projectNode.InsertAfter (newPropertyGroup, lastPropertyGroup);
}

public static void AddTopLevelProperty (this XmlDocument csproj, string property, string value)
Expand Down

9 comments on commit d36853c

@xamarin-release-manager
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 Pipeline scripts tests failed on VSTS: device tests iOS (DDFun) 🔥

The tests of the scripts used in the pepeline failed. The build was cancelled.

Pipeline on Agent

@xamarin-release-manager
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 Tests failed catastrophically on VSTS: device tests iOS (DDFun) 🔥

Failed provisioning profiles.

Pipeline on Agent

@xamarin-release-manager
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 Tests failed catastrophically on VSTS: device tests iOS (DDFun) 🔥

Failed installing dependencies.

Pipeline on Agent

@xamarin-release-manager
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 Pipeline scripts tests failed on VSTS: device tests tvOS (DDFun) 🔥

The tests of the scripts used in the pepeline failed. The build was cancelled.

Pipeline on Agent

@xamarin-release-manager
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 Tests failed catastrophically on VSTS: device tests tvOS (DDFun) 🔥

Failed provisioning profiles.

Pipeline on Agent

@xamarin-release-manager
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jenkins job (on internal Jenkins) succeeded

Provisioning succeeded
Build succeeded
✅ Packages built successfully

View packages

API Diff (from stable)
API Diff (from PR only) (no change)
Generator Diff (no change)
Test run succeeded

@xamarin-release-manager
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Device tests failed on VSTS: device tests iOS (Cambridge) ❌

Device tests failed on VSTS: device tests iOS (Cambridge).

Test results

35 tests failed, 115 tests passed.

Failed tests

  • monotouch-test/iOS Unified 64-bits - device/Debug: Crashed
  • monotouch-test/iOS Unified 64-bits - device/AssemblyBuildTarget: dylib (debug): Crashed
  • monotouch-test/iOS Unified 64-bits - device/AssemblyBuildTarget: SDK framework (debug): Crashed
  • monotouch-test/iOS Unified 64-bits - device/AssemblyBuildTarget: dylib (debug, profiling): Crashed
  • monotouch-test/iOS Unified 64-bits - device/AssemblyBuildTarget: SDK framework (debug, profiling): Crashed
  • monotouch-test/iOS Unified 64-bits - device/Release: Crashed
  • monotouch-test/iOS Unified 64-bits - device/AssemblyBuildTarget: SDK framework (release): Crashed
  • monotouch-test/iOS Unified 64-bits - device/Debug (dynamic registrar): Crashed
  • monotouch-test/iOS Unified 64-bits - device/Release (all optimizations): Crashed
  • monotouch-test/iOS Unified 64-bits - device/Debug (all optimizations): Crashed
  • monotouch-test/iOS Unified 64-bits - device/Debug: SGenConc: Crashed
  • monotouch-test/iOS Unified 64-bits - device/Debug (interpreter): Crashed
  • monotouch-test/iOS Unified 64-bits - device/Debug (interpreter -mscorlib): Crashed
  • monotouch-test/iOS Unified 64-bits - device/Release (interpreter -mscorlib): Crashed
  • link sdk/iOS Unified 64-bits - device/Debug: Failed
  • link sdk/iOS Unified 64-bits - device/AssemblyBuildTarget: dylib (debug): Failed
  • link sdk/iOS Unified 64-bits - device/AssemblyBuildTarget: SDK framework (debug): Failed
  • link sdk/iOS Unified 64-bits - device/AssemblyBuildTarget: dylib (debug, profiling): Failed
  • link sdk/iOS Unified 64-bits - device/AssemblyBuildTarget: SDK framework (debug, profiling): Failed
  • link sdk/iOS Unified 64-bits - device/Release: Failed
  • link sdk/iOS Unified 64-bits - device/AssemblyBuildTarget: SDK framework (release): Failed
  • [NUnit] Mono BCL tests group 2/iOS Unified 64-bits - device/Debug: Failed
  • [NUnit] Mono BCL tests group 2/iOS Unified 64-bits - device/AssemblyBuildTarget: dylib (debug): Failed
  • [NUnit] Mono BCL tests group 2/iOS Unified 64-bits - device/AssemblyBuildTarget: SDK framework (debug): Failed
  • [NUnit] Mono BCL tests group 2/iOS Unified 64-bits - device/AssemblyBuildTarget: dylib (debug, profiling): Failed
  • [NUnit] Mono BCL tests group 2/iOS Unified 64-bits - device/AssemblyBuildTarget: SDK framework (debug, profiling): Failed
  • [NUnit] Mono BCL tests group 2/iOS Unified 64-bits - device/Release: Failed
  • [NUnit] Mono BCL tests group 2/iOS Unified 64-bits - device/AssemblyBuildTarget: SDK framework (release): Failed
  • [xUnit] Mono SystemXunit/iOS Unified 64-bits - device/Debug: Failed
  • [xUnit] Mono SystemXunit/iOS Unified 64-bits - device/AssemblyBuildTarget: dylib (debug): Failed
  • [xUnit] Mono SystemXunit/iOS Unified 64-bits - device/AssemblyBuildTarget: SDK framework (debug): Failed
  • [xUnit] Mono SystemXunit/iOS Unified 64-bits - device/AssemblyBuildTarget: dylib (debug, profiling): Failed
  • [xUnit] Mono SystemXunit/iOS Unified 64-bits - device/AssemblyBuildTarget: SDK framework (debug, profiling): Failed
  • [xUnit] Mono SystemXunit/iOS Unified 64-bits - device/Release: Failed
  • [xUnit] Mono SystemXunit/iOS Unified 64-bits - device/AssemblyBuildTarget: SDK framework (release): Failed

Pipeline on Agent XI-A-BruceWayne

@xamarin-release-manager
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Device tests failed on VSTS: device tests tvOS (Cambridge) ❌

Device tests failed on VSTS: device tests tvOS (Cambridge).

Test results

15 tests failed, 135 tests passed.

Failed tests

  • monotouch-test/tvOS - device/Debug: Failed
  • monotouch-test/tvOS - device/AssemblyBuildTarget: dylib (debug): Failed
  • monotouch-test/tvOS - device/AssemblyBuildTarget: SDK framework (debug): Failed
  • monotouch-test/tvOS - device/AssemblyBuildTarget: dylib (debug, profiling): Failed
  • monotouch-test/tvOS - device/AssemblyBuildTarget: SDK framework (debug, profiling): Failed
  • monotouch-test/tvOS - device/Release: Failed
  • monotouch-test/tvOS - device/AssemblyBuildTarget: SDK framework (release): Failed
  • monotouch-test/tvOS - device/Debug (dynamic registrar): Failed
  • monotouch-test/tvOS - device/Release (all optimizations): Failed
  • monotouch-test/tvOS - device/Debug (all optimizations): Failed
  • monotouch-test/tvOS - device/Debug: SGenConc: Failed
  • monotouch-test/tvOS - device/Debug (interpreter): Failed
  • monotouch-test/tvOS - device/Debug (interpreter -mscorlib): Failed
  • monotouch-test/tvOS - device/Release (interpreter -mscorlib): Failed
  • dont link/tvOS - device/AssemblyBuildTarget: SDK framework (release): Crashed

Pipeline on Agent XI-A-BruceWayne

@xamarin-release-manager
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Device tests failed on VSTS: device tests iOS32b (Cambridge) ❌

Device tests failed on VSTS: device tests iOS32b (Cambridge).

Test results

96 tests failed, 8 tests' device not found, 57 tests passed.

Failed tests

  • monotouch-test/iOS Unified 32-bits - device/Debug: Crashed
  • monotouch-test/iOS Unified 32-bits - device/AssemblyBuildTarget: dylib (debug): Crashed
  • monotouch-test/iOS Unified 32-bits - device/AssemblyBuildTarget: SDK framework (debug): Crashed
  • monotouch-test/iOS Unified 32-bits - device/AssemblyBuildTarget: dylib (debug, profiling): Crashed
  • monotouch-test/iOS Unified 32-bits - device/AssemblyBuildTarget: SDK framework (debug, profiling): Crashed
  • monotouch-test/iOS Unified 32-bits - device/Release: Crashed
  • monotouch-test/iOS Unified 32-bits - device/Release: UseThumb: Crashed
  • monotouch-test/iOS Unified 32-bits - device/AssemblyBuildTarget: SDK framework (release): Crashed
  • monotouch-test/iOS Unified 32-bits - device/Release (all optimizations): Crashed
  • monotouch-test/iOS Unified 32-bits - device/Debug (all optimizations): Crashed
  • monotouch-test/iOS Unified 32-bits - device/Debug: SGenConc: Crashed
  • [NUnit] Mono BCL tests group 1/iOS Unified 32-bits - device/Debug: Crashed
  • [NUnit] Mono BCL tests group 1/iOS Unified 32-bits - device/AssemblyBuildTarget: dylib (debug): Crashed
  • [NUnit] Mono BCL tests group 1/iOS Unified 32-bits - device/AssemblyBuildTarget: SDK framework (debug): Crashed
  • [NUnit] Mono BCL tests group 1/iOS Unified 32-bits - device/AssemblyBuildTarget: dylib (debug, profiling): Crashed
  • [NUnit] Mono BCL tests group 1/iOS Unified 32-bits - device/AssemblyBuildTarget: SDK framework (debug, profiling): Crashed
  • [NUnit] Mono BCL tests group 1/iOS Unified 32-bits - device/Release: Crashed
  • [NUnit] Mono BCL tests group 1/iOS Unified 32-bits - device/Release: UseThumb: Crashed
  • [NUnit] Mono BCL tests group 1/iOS Unified 32-bits - device/AssemblyBuildTarget: SDK framework (release): Crashed
  • [NUnit] Mono BCL tests group 2/iOS Unified 32-bits - device/Debug: Crashed
  • [NUnit] Mono BCL tests group 2/iOS Unified 32-bits - device/AssemblyBuildTarget: dylib (debug): Crashed
  • [NUnit] Mono BCL tests group 2/iOS Unified 32-bits - device/AssemblyBuildTarget: SDK framework (debug): Crashed
  • [NUnit] Mono BCL tests group 2/iOS Unified 32-bits - device/AssemblyBuildTarget: dylib (debug, profiling): Crashed
  • [NUnit] Mono BCL tests group 2/iOS Unified 32-bits - device/AssemblyBuildTarget: SDK framework (debug, profiling): Crashed
  • [NUnit] Mono BCL tests group 2/iOS Unified 32-bits - device/Release: Crashed
  • [NUnit] Mono BCL tests group 2/iOS Unified 32-bits - device/Release: UseThumb: Crashed
  • [NUnit] Mono BCL tests group 2/iOS Unified 32-bits - device/AssemblyBuildTarget: SDK framework (release): Crashed
  • [xUnit] Mono BCL tests group 3/iOS Unified 32-bits - device/Debug: Crashed
  • [xUnit] Mono BCL tests group 3/iOS Unified 32-bits - device/AssemblyBuildTarget: dylib (debug): Crashed
  • [xUnit] Mono BCL tests group 3/iOS Unified 32-bits - device/AssemblyBuildTarget: SDK framework (debug): Crashed
  • [xUnit] Mono BCL tests group 3/iOS Unified 32-bits - device/AssemblyBuildTarget: dylib (debug, profiling): Crashed
  • [xUnit] Mono BCL tests group 3/iOS Unified 32-bits - device/AssemblyBuildTarget: SDK framework (debug, profiling): Crashed
  • [xUnit] Mono BCL tests group 3/iOS Unified 32-bits - device/Release: Crashed
  • [xUnit] Mono BCL tests group 3/iOS Unified 32-bits - device/Release: UseThumb: Crashed
  • [xUnit] Mono BCL tests group 3/iOS Unified 32-bits - device/AssemblyBuildTarget: SDK framework (release): Crashed
  • [xUnit] Mono BCL tests group 4/iOS Unified 32-bits - device/Debug: Crashed
  • [xUnit] Mono BCL tests group 4/iOS Unified 32-bits - device/AssemblyBuildTarget: dylib (debug): Crashed
  • [xUnit] Mono BCL tests group 4/iOS Unified 32-bits - device/AssemblyBuildTarget: SDK framework (debug): Crashed
  • [xUnit] Mono BCL tests group 4/iOS Unified 32-bits - device/AssemblyBuildTarget: dylib (debug, profiling): Crashed
  • [xUnit] Mono BCL tests group 4/iOS Unified 32-bits - device/AssemblyBuildTarget: SDK framework (debug, profiling): Crashed
  • [xUnit] Mono BCL tests group 4/iOS Unified 32-bits - device/Release: Crashed
  • [xUnit] Mono BCL tests group 4/iOS Unified 32-bits - device/Release: UseThumb: Crashed (HE0052: Failed to stop session: Read Error (error: 0xe8000004))
  • [xUnit] Mono BCL tests group 4/iOS Unified 32-bits - device/AssemblyBuildTarget: SDK framework (release): Crashed
  • mscorlib Part 1/iOS Unified 32-bits - device/Debug: Crashed
  • mscorlib Part 1/iOS Unified 32-bits - device/AssemblyBuildTarget: dylib (debug): Crashed
  • mscorlib Part 1/iOS Unified 32-bits - device/AssemblyBuildTarget: SDK framework (debug): Crashed
  • mscorlib Part 1/iOS Unified 32-bits - device/AssemblyBuildTarget: dylib (debug, profiling): Crashed
  • mscorlib Part 1/iOS Unified 32-bits - device/AssemblyBuildTarget: SDK framework (debug, profiling): Crashed
  • mscorlib Part 1/iOS Unified 32-bits - device/Release: BuildFailure Known issue: Undefined symbol ___multi3 on Release Mode.
  • mscorlib Part 1/iOS Unified 32-bits - device/Release: UseThumb: BuildFailure Known issue: Undefined symbol ___multi3 on Release Mode.
  • mscorlib Part 1/iOS Unified 32-bits - device/AssemblyBuildTarget: SDK framework (release): BuildFailure Known issue: Undefined symbol ___multi3 on Release Mode.
  • mscorlib Part 1/iOS Unified 32-bits - device/Debug: SGenConc: Crashed
  • mscorlib Part 2/iOS Unified 32-bits - device/Debug: Crashed
  • mscorlib Part 2/iOS Unified 32-bits - device/AssemblyBuildTarget: dylib (debug): Crashed
  • mscorlib Part 2/iOS Unified 32-bits - device/AssemblyBuildTarget: SDK framework (debug): Crashed
  • mscorlib Part 2/iOS Unified 32-bits - device/AssemblyBuildTarget: dylib (debug, profiling): Crashed
  • mscorlib Part 2/iOS Unified 32-bits - device/AssemblyBuildTarget: SDK framework (debug, profiling): Crashed
  • mscorlib Part 2/iOS Unified 32-bits - device/Release: Crashed (HE0052: Failed to stop session: Read Error (error: 0xe8000004))
  • mscorlib Part 2/iOS Unified 32-bits - device/Release: UseThumb: Crashed (HE0052: Failed to stop session: Read Error (error: 0xe8000004))
  • mscorlib Part 2/iOS Unified 32-bits - device/AssemblyBuildTarget: SDK framework (release): Crashed
  • mscorlib Part 2/iOS Unified 32-bits - device/Debug: SGenConc: Crashed
  • mscorlib Part 3/iOS Unified 32-bits - device/Debug: Crashed
  • mscorlib Part 3/iOS Unified 32-bits - device/AssemblyBuildTarget: dylib (debug): Crashed
  • mscorlib Part 3/iOS Unified 32-bits - device/AssemblyBuildTarget: SDK framework (debug): Crashed
  • mscorlib Part 3/iOS Unified 32-bits - device/AssemblyBuildTarget: dylib (debug, profiling): Crashed
  • mscorlib Part 3/iOS Unified 32-bits - device/AssemblyBuildTarget: SDK framework (debug, profiling): Crashed
  • mscorlib Part 3/iOS Unified 32-bits - device/Release: Crashed
  • mscorlib Part 3/iOS Unified 32-bits - device/Release: UseThumb: Crashed
  • mscorlib Part 3/iOS Unified 32-bits - device/AssemblyBuildTarget: SDK framework (release): Crashed
  • mscorlib Part 3/iOS Unified 32-bits - device/Debug: SGenConc: Crashed
  • [xUnit] Mono SystemCoreXunit Part 1/iOS Unified 32-bits - device/Debug: Crashed
  • [xUnit] Mono SystemCoreXunit Part 1/iOS Unified 32-bits - device/AssemblyBuildTarget: dylib (debug): Crashed
  • [xUnit] Mono SystemCoreXunit Part 1/iOS Unified 32-bits - device/AssemblyBuildTarget: SDK framework (debug): Crashed
  • [xUnit] Mono SystemCoreXunit Part 1/iOS Unified 32-bits - device/AssemblyBuildTarget: dylib (debug, profiling): Crashed
  • [xUnit] Mono SystemCoreXunit Part 1/iOS Unified 32-bits - device/AssemblyBuildTarget: SDK framework (debug, profiling): Crashed
  • [xUnit] Mono SystemCoreXunit Part 1/iOS Unified 32-bits - device/Release: Crashed
  • [xUnit] Mono SystemCoreXunit Part 1/iOS Unified 32-bits - device/Release: UseThumb: Crashed
  • [xUnit] Mono SystemCoreXunit Part 1/iOS Unified 32-bits - device/AssemblyBuildTarget: SDK framework (release): Crashed
  • [xUnit] Mono SystemCoreXunit Part 2/iOS Unified 32-bits - device/Debug: Crashed
  • [xUnit] Mono SystemCoreXunit Part 2/iOS Unified 32-bits - device/AssemblyBuildTarget: dylib (debug): Crashed
  • [xUnit] Mono SystemCoreXunit Part 2/iOS Unified 32-bits - device/AssemblyBuildTarget: SDK framework (debug): Crashed
  • [xUnit] Mono SystemCoreXunit Part 2/iOS Unified 32-bits - device/AssemblyBuildTarget: dylib (debug, profiling): Crashed
  • [xUnit] Mono SystemCoreXunit Part 2/iOS Unified 32-bits - device/AssemblyBuildTarget: SDK framework (debug, profiling): Crashed
  • [xUnit] Mono SystemCoreXunit Part 2/iOS Unified 32-bits - device/Release: Crashed
  • [xUnit] Mono SystemCoreXunit Part 2/iOS Unified 32-bits - device/Release: UseThumb: Crashed
  • [xUnit] Mono SystemCoreXunit Part 2/iOS Unified 32-bits - device/AssemblyBuildTarget: SDK framework (release): Crashed
  • [xUnit] Mono SystemXunit/iOS Unified 32-bits - device/Debug: Crashed
  • [xUnit] Mono SystemXunit/iOS Unified 32-bits - device/AssemblyBuildTarget: dylib (debug): Crashed
  • [xUnit] Mono SystemXunit/iOS Unified 32-bits - device/AssemblyBuildTarget: SDK framework (debug): Crashed
  • [xUnit] Mono SystemXunit/iOS Unified 32-bits - device/AssemblyBuildTarget: dylib (debug, profiling): Crashed
  • [xUnit] Mono SystemXunit/iOS Unified 32-bits - device/AssemblyBuildTarget: SDK framework (debug, profiling): Crashed
  • [xUnit] Mono SystemXunit/iOS Unified 32-bits - device/Release: Crashed
  • [xUnit] Mono SystemXunit/iOS Unified 32-bits - device/Release: UseThumb: Crashed
  • [xUnit] Mono SystemXunit/iOS Unified 32-bits - device/AssemblyBuildTarget: SDK framework (release): Crashed
  • [xUnit] Mono BCL tests group 5/iOS Unified 32-bits - device/AssemblyBuildTarget: dylib (debug): Crashed
  • [xUnit] Mono BCL tests group 5/iOS Unified 32-bits - device/AssemblyBuildTarget: SDK framework (debug): Crashed

Pipeline on Agent XI-W-BULBASAUR

Please sign in to comment.