Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Globalization] Exclude not used ICU Files #20828

Closed
wants to merge 17 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
b30dc91
Revert "Migrate Messaging Build agent to .NET 8 (#20705)" (#20790)
rolfbjarne Jul 1, 2024
a28cf64
[msbuild] Don't support RuntimeIdentifiers for Hot Restart. (#20750)
rolfbjarne Jul 1, 2024
a3f61a9
Backport bot: Use managed identity (MI) authorization (#20798)
mjbond-msft Jul 1, 2024
9a88882
[CI] Disable the governance checks on the tests. (#20797)
mandel-macaque Jul 1, 2024
95df610
[build] Parameterize the .NET download script url. (#20806)
rolfbjarne Jul 3, 2024
323d28c
[Foundation] Make the generic collection classes' generic GetEnumerat…
rolfbjarne Jul 3, 2024
6da8273
[src/tools] Propagate the BackwardsCompatibleCodeGeneration field fro…
rolfbjarne Jul 3, 2024
7e615b0
[main] Update dependencies from dotnet/installer (#20753)
dotnet-maestro[bot] Jul 3, 2024
63b4703
[main] Update dependencies from dotnet/xharness (#20770)
dotnet-maestro[bot] Jul 3, 2024
7f2c575
[siminstaller] Don't use the C# compiler server. (#20812)
rolfbjarne Jul 4, 2024
c930ab3
[monotouch-test] Remove ignore for Mac Catalyst. (#20810)
rolfbjarne Jul 4, 2024
91ffc65
[msbuild] Show a slightly better warning message when trying to expan…
rolfbjarne Jul 4, 2024
9582522
[xtro] Convert most projects to .NET projects. (#20760)
rolfbjarne Jul 5, 2024
71acf6a
[bgen] Add simple makefile. (#20789)
rolfbjarne Jul 5, 2024
649c3e7
icu dat files are not used anymore
mkhamoyan Jul 8, 2024
80b8e45
Merge branch 'main' into dev/mkhamoyan/clean-icu-files
mkhamoyan Jul 8, 2024
36aaaef
Merge remote-tracking branch 'origin/net9.0' into dev/mkhamoyan/clean…
mkhamoyan Jul 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions .github/workflows/backport-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,37 @@ jobs:
steps:
- name: Parse Comment
id: parse_comment
shell: pwsh
run: |
Write-Host "Parsing $env:COMMENT"
($botName, $backport, $backportTargetBranch) = [System.Text.RegularExpressions.Regex]::Split("$env:COMMENT", "\s+")
echo "::set-output name=target_branch::$backportTargetBranch"
shell: pwsh
Write-Host "GITHUB_OUTPUT: ${env:GITHUB_OUTPUT}"
[IO.File]::AppendAllText($env:GITHUB_OUTPUT, "target_branch=${backportTargetBranch}$([Environment]::NewLine)") # Equivalent to the deprecated ::set-output command: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idoutputs
env:
COMMENT: "${{ github.event.comment.body }}"

launchBackportBuild:
needs: setupBackport
uses: xamarin/backport-bot-action/.github/workflows/backport-action.yml@v1.1
uses: xamarin/backport-bot-action/.github/workflows/backport-action.yml@v2.0
# GITHUB_TOKEN change from read-write to read-only on 2024-02-01 requiring permissions block
# https://docs.opensource.microsoft.com/github/apps/permission-changes/
# https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
permissions:
actions: none
contents: read
security-events: none
id-token: write # The backport-action template being invoked requires this permission
with:
pull_request_url: ${{ github.event.issue.pull_request.url }}
target_branch: ${{ needs.setupBackport.outputs.target_branch }}
comment_author: ${{ github.actor }}
github_repository: ${{ github.repository }}
use_fork: true
secrets:
azure_tenant_id: ${{ secrets.BACKPORT_AZURE_TENANT_ID }}
azure_subscription_id: ${{ secrets.BACKPORT_AZURE_SUBSCRIPTION_ID }}
azure_client_id: ${{ secrets.BACKPORT_AZURE_CLIENT_ID }}
ado_organization: ${{ secrets.ADO_PROJECTCOLLECTION }}
ado_project: ${{ secrets.ADO_PROJECT }}
backport_pipeline_id: ${{ secrets.BACKPORT_PIPELINEID }}
ado_build_pat: ${{ secrets.ADO_BUILDPAT }}
github_account_pat: ${{ secrets.SERVICEACCOUNT_PAT }}
4 changes: 3 additions & 1 deletion builds/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,10 @@ print-dotnet-pkg-urls: dotnet-install.sh
$(Q) if ! test -f $@-found-it.stamp; then echo "No working urls were found."; exit 1; fi
$(Q) rm -f $@-found-it.stamp

DOTNET_DOWNLOAD_URL?=https://dot.net/v1/dotnet-install.sh

dotnet-install.sh: Makefile
$(Q) $(CURL_RETRY) https://dot.net/v1/dotnet-install.sh --output $@.tmp
$(Q) $(CURL_RETRY) $(DOTNET_DOWNLOAD_URL) --output $@.tmp
$(Q) chmod +x $@.tmp
$(Q) mv $@.tmp $@

Expand Down
2 changes: 1 addition & 1 deletion dotnet/Workloads/SignList.xml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
<FirstParty Include="Broker.exe" />
<FirstParty Include="Broker.resources.dll" />
<!-- Build.zip -->
<FirstParty Include="Build.dll" />
<FirstParty Include="Build.exe" />
<FirstParty Include="Microsoft.Build*.dll" />
<FirstParty Include="Microsoft.NET.StringTools.dll" />
<FirstParty Include="System.IO.Abstractions.dll" />
Expand Down
4 changes: 2 additions & 2 deletions dotnet/targets/Xamarin.Shared.Sdk.targets
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@
</PropertyGroup>

<PropertyGroup>
<_GlobalizationDataFile Condition="'$(_PlatformName)' != 'macOS' And '$(InvariantGlobalization)' != 'true' And '$(HybridGlobalization)' != 'true' And '$(_GlobalizationDataFile)' == ''">icudt.dat</_GlobalizationDataFile>
<_GlobalizationDataFile Condition="'$(_PlatformName)' != 'macOS' And '$(InvariantGlobalization)' != 'true' And '$(HybridGlobalization)' == 'true' And '$(_GlobalizationDataFile)' == ''">icudt_hybrid.dat</_GlobalizationDataFile>
<_GlobalizationDataFile Condition="'$(_PlatformName)' != 'macOS' And '$(InvariantGlobalization)' != 'true' And '$(HybridGlobalization)' != 'true' And '$(_GlobalizationDataFile)' == '' And $([MSBuild]::VersionLessThan($(TargetFrameworkVersion), '9.0'))">icudt.dat</_GlobalizationDataFile>
<_GlobalizationDataFile Condition="'$(_PlatformName)' != 'macOS' And '$(InvariantGlobalization)' != 'true' And '$(HybridGlobalization)' == 'true' And '$(_GlobalizationDataFile)' == '' And $([MSBuild]::VersionLessThan($(TargetFrameworkVersion), '9.0'))">icudt_hybrid.dat</_GlobalizationDataFile>
Comment on lines +169 to +170
Copy link
Member

Choose a reason for hiding this comment

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

Instead of adding the condition on .NET 9, you can just target the net9.0 branch.

That way I believe you can just remove these lines, and also any other lines related to the icu file:

$ git grep GlobalizationDataFile
dotnet/targets/Xamarin.Shared.Sdk.targets:              <_GlobalizationDataFile Condition="'$(_PlatformName)' != 'macOS' And '$(InvariantGlobalization)' != 'true' And '$(HybridGlobalization)' != 'true' And '$(_GlobalizationDataFile)' == ''">icudt.dat</_GlobalizationDataFile>
dotnet/targets/Xamarin.Shared.Sdk.targets:              <_GlobalizationDataFile Condition="'$(_PlatformName)' != 'macOS' And '$(InvariantGlobalization)' != 'true' And '$(HybridGlobalization)' == 'true' And '$(_GlobalizationDataFile)' == ''">icudt_hybrid.dat</_GlobalizationDataFile>
dotnet/targets/Xamarin.Shared.Sdk.targets:                      <_ArchitectureSpecificFiles Include="$(_GlobalizationDataFile)" Condition="'$(_GlobalizationDataFile)' != ''" />
dotnet/targets/Xamarin.Shared.Sdk.targets:              <Error Text="Can not set values for both InvariantGlobalization '$(InvariantGlobalization)' and _GlobalizationDataFile '$(_GlobalizationDataFile)'" Condition="'$(_GlobalizationDataFile)' != '' And '$(InvariantGlobalization)' == 'true'" />
dotnet/targets/Xamarin.Shared.Sdk.targets:                              GlobalizationDataFile=$(_GlobalizationDataFile)
dotnet/targets/Xamarin.Shared.Sdk.targets:                                          '%(ResolvedFileToPublish.Filename)%(ResolvedFileToPublish.Extension)' == '$(_GlobalizationDataFile)' And
msbuild/Xamarin.Shared/Xamarin.Shared.targets:                  <_GlobalizationDataFileAppBundleRelativePath Condition="'$(_AppContentsRelativePath)' == ''">$(_GlobalizationDataFile)</_GlobalizationDataFileAppBundleRelativePath>
msbuild/Xamarin.Shared/Xamarin.Shared.targets:                  <_GlobalizationDataFileAppBundleRelativePath Condition="'$(_AppContentsRelativePath)' != ''">$(_AppContentsRelativePath)\$(_GlobalizationDataFile)</_GlobalizationDataFileAppBundleRelativePath>
msbuild/Xamarin.Shared/Xamarin.Shared.targets:                  <RuntimeHostConfigurationOption Include="ICU_DAT_FILE_PATH" Value="$(_GlobalizationDataFileAppBundleRelativePath.Replace('\','/'))" />
tools/dotnet-linker/LinkerConfiguration.cs:             public string GlobalizationDataFile { get; private set; } = string.Empty;
tools/dotnet-linker/LinkerConfiguration.cs:                             case "GlobalizationDataFile":
tools/dotnet-linker/LinkerConfiguration.cs:                                     GlobalizationDataFile = value;

Looking at the runtime PR, it also looks like we'll have to stop linking with these libraries:

$ git grep -E 'icudata|icui18n|icuuc'
runtime/Makefile:DOTNET_iphonesimulator_DYLIB_FLAGS=-lmonosgen-2.0 -licudata -licui18n -licuuc -framework UIKit
runtime/Makefile:DOTNET_iphoneos_DYLIB_FLAGS=-lmonosgen-2.0 -licudata -licui18n -licuuc -framework UIKit
runtime/Makefile:DOTNET_tvsimulator_DYLIB_FLAGS=-lmonosgen-2.0 -licudata -licui18n -licuuc -framework UIKit

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rolfbjarne by mistake I pushed 66e7a1a to net9.0 instead of my branch, could you please help me revert that?

Copy link
Member

Choose a reason for hiding this comment

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

I reverted that commit and pushed the revert.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks a lot!

</PropertyGroup>

<PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion msbuild/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
enclosed in brackets.

-->
<MessagingVersion>[2.0.28]</MessagingVersion>
<MessagingVersion>[1.14.6]</MessagingVersion>
<HotRestartVersion>[1.1.7]</HotRestartVersion>
</PropertyGroup>
<Import Project="$(MSBuildThisFileDirectory)../Directory.Build.props" />
Expand Down
1 change: 0 additions & 1 deletion msbuild/ILMerge.targets
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
<MergedAssemblies Include="@(ReferencePath)" Condition="'%(FileName)' == 'System.ComponentModel.Composition'" />
<MergedAssemblies Include="@(ReferencePath)" Condition="'%(FileName)' == 'System.Diagnostics.Tracer'" />
<MergedAssemblies Include="@(ReferencePath)" Condition="'%(FileName)' == 'System.Net.Mqtt'" />
<MergedAssemblies Include="@(ReferencePath)" Condition="'%(FileName)' == 'System.Net.Mqtt.Server'" />
<MergedAssemblies Include="@(ReferencePath)" Condition="'%(FileName)' == 'System.Reactive'" />
<MergedAssemblies Include="@(ReferencePath)" Condition="'%(FileName)' == 'System.Security.Cryptography.ProtectedData'" />
<MergedAssemblies Include="@(ReferencePath)" Condition="'%(FileName)' == 'System.Text.Encoding.CodePages'" />
Expand Down
2 changes: 1 addition & 1 deletion msbuild/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -491,9 +491,9 @@ DOTNET_IOS_WINDOWS_OUTPUT_FILES = \
iSign.Core.pdb \
Xamarin.iOS.Windows.Client.pdb \
Broker.zip \
Build.zip \

DOTNET_IOS_WINDOWS_FILES = $(IOS_WINDOWS_TARGETS) $(foreach file,$(DOTNET_IOS_WINDOWS_OUTPUT_FILES),Xamarin.iOS.Tasks.Windows/bin/$(CONFIG)/$(TARGETFRAMEWORK)/$(WINDOWSRUNTIMEIDENTIFIER)/$(file))
DOTNET_IOS_WINDOWS_FILES += Messaging/Xamarin.Messaging.Build/obj/$(CONFIG)/Build.zip
DOTNET_IOS_WINDOWS_MOBILEDEVICE_TOOLS_X86 = $(foreach file,$(IOS_WINDOWS_MOBILEDEVICE_TOOLS),Xamarin.iOS.Tasks.Windows/bin/$(CONFIG)/$(TARGETFRAMEWORK)/$(WINDOWSRUNTIMEIDENTIFIER)/imobiledevice-x86/$(file).*)
DOTNET_IOS_WINDOWS_MOBILEDEVICE_TOOLS_X64 = $(foreach file,$(IOS_WINDOWS_MOBILEDEVICE_TOOLS),Xamarin.iOS.Tasks.Windows/bin/$(CONFIG)/$(TARGETFRAMEWORK)/$(WINDOWSRUNTIMEIDENTIFIER)/imobiledevice-x64/$(file).*)

Expand Down
3 changes: 3 additions & 0 deletions msbuild/Messaging/Xamarin.Messaging.Build/BuildAgent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ await TryRegisterHandlerAsync (new CopyItemMessageHandler ())
.ConfigureAwait (continueOnCapturedContext: false);
await TryRegisterHandlerAsync (new GetItemMessageHandler ())
.ConfigureAwait (continueOnCapturedContext: false);

await TryRegisterHandlerAsync (new VerifyXcodeVersionMessageHandler ())
.ConfigureAwait (continueOnCapturedContext: false);
await TryRegisterHandlerAsync (new GetUniversalTargetIdentifierMessageHandler ())
.ConfigureAwait (continueOnCapturedContext: false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,10 @@ await Task.Run (async () => {
message.SessionId,
PlatformPath.GetPathForCurrentPlatform (message.ItemSpec)));

if (File.Exists (targetPath)) {
if (File.Exists (targetPath))
File.Delete (targetPath);
} else {
var directoryName = Path.GetDirectoryName (targetPath);
if (directoryName is not null && !Directory.Exists (directoryName))
Directory.CreateDirectory (directoryName);
}
else if (!Directory.Exists (Path.GetDirectoryName (targetPath)))
Directory.CreateDirectory (Path.GetDirectoryName (targetPath));

using (var file = File.Create (targetPath))
using (var stream = new MemoryStream (message.Content))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net472</TargetFramework>
<OutputType>Exe</OutputType>
<AssemblyName>Build</AssemblyName>
<NoWarn>$(NoWarn);NU1603</NoWarn> <!-- Xamarin.Messaging.Build.Common 1.6.24 depends on Merq (>= 1.1.0) but Merq 1.1.0 was not found. An approximate best match of Merq 1.1.4 was resolved. -->
Expand All @@ -10,7 +10,6 @@
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
<WarningsAsErrors>Nullable</WarningsAsErrors>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
</PropertyGroup>

<PropertyGroup Label="Messaging">
Expand Down
23 changes: 17 additions & 6 deletions msbuild/Xamarin.Localization.MSBuild/MSBStrings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -479,14 +479,12 @@
</value>
</data>

<data name="W0108" xml:space="preserve">
<value>Cannot expand $(TeamIdentifierPrefix) in Entitlements.plist without a provisioning profile.
</value>
<data name="W0108b" xml:space="preserve">
<value>Cannot expand $(TeamIdentifierPrefix) in Entitlements.plist without a provisioning profile for key '{0}' with value '{1}'.</value>
</data>

<data name="W0109" xml:space="preserve">
<value>Cannot expand $(AppIdentifierPrefix) in Entitlements.plist without a provisioning profile.
</value>
<data name="W0109b" xml:space="preserve">
<value>Cannot expand $(AppIdentifierPrefix) in Entitlements.plist without a provisioning profile for key '{0}' with value '{1}'.</value>
</data>

<data name="W0110" xml:space="preserve">
Expand Down Expand Up @@ -878,6 +876,19 @@
<value>Could not resolve UTI for {0} in catalog {1}</value>
</data>

<data name="E0183" xml:space="preserve">
<value>An error occurred while trying to verify the compatibility between Xcode and the .NET SDK</value>
</data>

<data name="E0184" xml:space="preserve">
<value>The project was built with a version of Xcode ({0}) that is not compatible which may result in unexpected warnings or errors. Please install Xcode '{1}' or visit the documentation to learn more.</value>
</data>

<data name="E0185" xml:space="preserve">
<value>An error occurred while trying to verify the compatibility between Xcode and the .NET SDK. Details: {0}
</value>
</data>

<data name="E0186" xml:space="preserve">
<value>The provided Archive Path is not from a valid archive file (.xcarchive). Archive Path: '{0}'</value>
</data>
Expand Down
28 changes: 14 additions & 14 deletions msbuild/Xamarin.MacDev.Tasks/Tasks/CompileEntitlements.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ protected string EntitlementBundlePath {
}
}

PString MergeEntitlementString (PString pstr, MobileProvision? profile, bool expandWildcards)
PString MergeEntitlementString (PString pstr, MobileProvision? profile, bool expandWildcards, string? key)
{
string TeamIdentifierPrefix;
string AppIdentifierPrefix;
Expand All @@ -148,12 +148,12 @@ PString MergeEntitlementString (PString pstr, MobileProvision? profile, bool exp

if (profile is null) {
if (!warnedTeamIdentifierPrefix && pstr.Value.Contains ("$(TeamIdentifierPrefix)")) {
Log.LogWarning (null, null, null, Entitlements, 0, 0, 0, 0, MSBStrings.W0108);
Log.LogWarning (null, null, null, Entitlements, 0, 0, 0, 0, MSBStrings.W0108b /* Cannot expand $(TeamIdentifierPrefix) in Entitlements.plist without a provisioning profile for key '{0}' with value '{1}' */, key, pstr.Value);
warnedTeamIdentifierPrefix = true;
}

if (!warnedAppIdentifierPrefix && pstr.Value.Contains ("$(AppIdentifierPrefix)")) {
Log.LogWarning (null, null, null, Entitlements, 0, 0, 0, 0, MSBStrings.W0109);
Log.LogWarning (null, null, null, Entitlements, 0, 0, 0, 0, MSBStrings.W0109b /* Cannot expand $(AppIdentifierPrefix) in Entitlements.plist without a provisioning profile for key '{0}' with value '{1}' */, key, pstr.Value);
warnedAppIdentifierPrefix = true;
}
}
Expand Down Expand Up @@ -198,7 +198,7 @@ PString MergeEntitlementString (PString pstr, MobileProvision? profile, bool exp
return new PString (expanded);
}

PArray? MergeEntitlementArray (PArray array, MobileProvision? profile)
PArray? MergeEntitlementArray (PArray array, MobileProvision? profile, string? key)
{
var result = new PArray ();

Expand All @@ -208,9 +208,9 @@ PString MergeEntitlementString (PString pstr, MobileProvision? profile, bool exp
if (item is PDictionary)
value = MergeEntitlementDictionary ((PDictionary) item, profile);
else if (item is PString)
value = MergeEntitlementString ((PString) item, profile, false);
value = MergeEntitlementString ((PString) item, profile, false, key);
else if (item is PArray)
value = MergeEntitlementArray ((PArray) item, profile);
value = MergeEntitlementArray ((PArray) item, profile, key);
else
value = item.Clone ();

Expand All @@ -234,9 +234,9 @@ PDictionary MergeEntitlementDictionary (PDictionary dict, MobileProvision? profi
if (value is PDictionary)
value = MergeEntitlementDictionary ((PDictionary) value, profile);
else if (value is PString)
value = MergeEntitlementString ((PString) value, profile, false);
value = MergeEntitlementString ((PString) value, profile, false, item.Key);
else if (value is PArray)
value = MergeEntitlementArray ((PArray) value, profile);
value = MergeEntitlementArray ((PArray) value, profile, item.Key);
else
value = value.Clone ();

Expand Down Expand Up @@ -286,7 +286,7 @@ void AddCustomEntitlements (PDictionary dict, MobileProvision? profile)
dict [entitlement] = new PBoolean (booleanValue);
break;
case "string":
dict [entitlement] = MergeEntitlementString (new PString (value), profile, entitlement == ApplicationIdentifierKey);
dict [entitlement] = MergeEntitlementString (new PString (value), profile, entitlement == ApplicationIdentifierKey, entitlement);
break;
case "stringarray":
var arraySeparator = item.GetMetadata ("ArraySeparator");
Expand All @@ -295,7 +295,7 @@ void AddCustomEntitlements (PDictionary dict, MobileProvision? profile)
var arrayContent = value.Split (new string [] { arraySeparator }, StringSplitOptions.None);
var parray = new PArray ();
foreach (var element in arrayContent)
parray.Add (MergeEntitlementString (new PString (element), profile, entitlement == ApplicationIdentifierKey));
parray.Add (MergeEntitlementString (new PString (element), profile, entitlement == ApplicationIdentifierKey, entitlement));
dict [entitlement] = parray;
break;
default:
Expand Down Expand Up @@ -360,9 +360,9 @@ protected virtual PDictionary GetCompiledEntitlements (MobileProvision? profile,
else if (value is PDictionary)
value = MergeEntitlementDictionary ((PDictionary) value, profile);
else if (value is PString)
value = MergeEntitlementString ((PString) value, profile, item.Key == ApplicationIdentifierKey);
value = MergeEntitlementString ((PString) value, profile, item.Key == ApplicationIdentifierKey, key);
else if (value is PArray)
value = MergeEntitlementArray ((PArray) value, profile);
value = MergeEntitlementArray ((PArray) value, profile, key);
else
value = value.Clone ();

Expand Down Expand Up @@ -395,9 +395,9 @@ protected virtual PDictionary GetCompiledEntitlements (MobileProvision? profile,
if (value is PDictionary)
value = MergeEntitlementDictionary ((PDictionary) value, profile);
else if (value is PString)
value = MergeEntitlementString ((PString) value, profile, key == ApplicationIdentifierKey);
value = MergeEntitlementString ((PString) value, profile, key == ApplicationIdentifierKey, key);
else if (value is PArray)
value = MergeEntitlementArray ((PArray) value, profile);
value = MergeEntitlementArray ((PArray) value, profile, key);
else
value = value.Clone ();

Expand Down
46 changes: 46 additions & 0 deletions msbuild/Xamarin.MacDev.Tasks/Tasks/VerifyXcodeVersion.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
using System;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using Xamarin.Localization.MSBuild;
using Xamarin.MacDev.Tasks;
using Xamarin.Messaging.Build.Client;
using Xamarin.Messaging.Build.Contracts;
using Threading = System.Threading.Tasks;

namespace Xamarin.MacDev.Tasks {
public class VerifyXcodeVersion : XamarinTask {
public override bool Execute () => ExecuteAsync ().Result;

async Threading.Task<bool> ExecuteAsync ()
{
try {
var connection = await BuildConnection.GetAsync (BuildEngine4).ConfigureAwait (continueOnCapturedContext: false);
var buildClient = connection.GetClient (SessionId) as BuildClient;

if (!connection.IsConnected || buildClient is null) {
Log.LogWarning (MSBStrings.E0179, nameof (VerifyXcodeVersion));

return true;
}

var xcodeVerificationResult = await buildClient
.RunMessagingAsync<VerifyXcodeVersionMessage, VerifyXcodeVersionResult> (new VerifyXcodeVersionMessage ())
.ConfigureAwait (continueOnCapturedContext: false);

if (!xcodeVerificationResult.IsCompatibleVersion) {
if (string.IsNullOrEmpty (xcodeVerificationResult.XcodeVersion) || string.IsNullOrEmpty (xcodeVerificationResult.RecommendedXcodeVersion)) {
Log.LogWarning (MSBStrings.E0183);
} else {
Log.LogWarning (MSBStrings.E0184, xcodeVerificationResult.XcodeVersion, xcodeVerificationResult.RecommendedXcodeVersion);
}
}

return true;
} catch (Exception ex) {
Log.LogWarning (MSBStrings.E0185, ex.Message);

return true;
}
}
}
}
1 change: 1 addition & 0 deletions msbuild/Xamarin.Shared/Xamarin.Shared.targets
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ Copyright (C) 2018 Microsoft. All rights reserved.
<UsingTask TaskName="Xamarin.MacDev.Tasks.UnpackLibraryResources" AssemblyFile="$(_TaskAssemblyName)" />
<UsingTask TaskName="Xamarin.MacDev.Tasks.Unzip" AssemblyFile="$(_TaskAssemblyName)" />
<UsingTask TaskName="Xamarin.MacDev.Tasks.ValidateAppBundleTask" AssemblyFile="$(_TaskAssemblyName)" />
<UsingTask TaskName="Xamarin.MacDev.Tasks.VerifyXcodeVersion" AssemblyFile="$(_TaskAssemblyName)" />
<UsingTask TaskName="Xamarin.MacDev.Tasks.WriteAppManifest" AssemblyFile="$(_TaskAssemblyName)" />
<UsingTask TaskName="Xamarin.MacDev.Tasks.WriteAssetPackManifest" AssemblyFile="$(_TaskAssemblyName)" />
<UsingTask TaskName="Xamarin.MacDev.Tasks.WriteItemsToFile" AssemblyFile="$(_TaskAssemblyName)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@
<IsRemoteBuild Condition="'$(IsHotRestartBuild)' == 'True'">False</IsRemoteBuild>
</PropertyGroup>
</Target>

<!-- AfterConnect belongs to Xamarin.Messaging.Build.targets -->
<Target Name="AfterConnect" Condition="'$(IsRemoteBuild)' == 'true'" DependsOnTargets="_VerifyXcodeVersion" />

<Target Name="_VerifyXcodeVersion" Condition="'$(IsRemoteBuild)' == 'true' And '$(IsMacEnabled)' == 'true'">
<VerifyXcodeVersion SessionId="$(BuildSessionId)" />
</Target>

<PropertyGroup>
<MessagingAppleTargetsImported>True</MessagingAppleTargetsImported>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
<Import Project="$(MSBuildThisFileDirectory)Xamarin.Messaging.Build.targets" Condition="Exists('$(MSBuildThisFileDirectory)Xamarin.Messaging.Build.targets') And '$(MessagingBuildTargetsImported)' != 'true'" />
<Import Project="$(MSBuildThisFileDirectory)Xamarin.Messaging.Apple.targets" Condition="Exists('$(MSBuildThisFileDirectory)Xamarin.Messaging.Apple.targets') And '$(MessagingAppleTargetsImported)' != 'true'" />

<Target Name="_ValidateHotRestartState" Condition="'$(IsHotRestartBuild)' == 'true'" BeforeTargets="Build">
<Error Condition="'$(RuntimeIdentifiers)' != ''" Text="Hot Restart is not supported when 'RuntimeIdentifiers' (plural) is set. Use 'RuntimeIdentifier' (singular) instead." />
</Target>

<Target Name="_GenerateHotRestartBuildSessionId">
<GenerateBuildSessionId MessagingVersion="$(MessagingVersion)"
TargetFramework="$(TargetFramework)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@
<PackageReference Include="GitInfo" Version="2.2.0" ExcludeAssets="all" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Messaging\Xamarin.Messaging.Build\Xamarin.Messaging.Build.csproj">
<ExcludeAssets>all</ExcludeAssets>
<ReferenceOutputAssembly>False</ReferenceOutputAssembly>
<IsAgent>True</IsAgent>
</ProjectReference>
<ProjectReference Include="..\..\external\Xamarin.MacDev\Xamarin.MacDev\Xamarin.MacDev.csproj" />
</ItemGroup>
<ItemGroup>
Expand Down
4 changes: 3 additions & 1 deletion src/Foundation/NSArray.cs
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,9 @@ public NSObject [] ToArray ()
return ToArray<NSObject> ();
}

IEnumerator<NSObject> IEnumerable<NSObject>.GetEnumerator ()
/// <summary>Returns an enumerator that iterates through the array.</summary>
/// <returns>An enumerator that can be used to iterate through the array.</returns>
public IEnumerator<NSObject> GetEnumerator ()
{
return new NSFastEnumerator<NSObject> (this);
}
Expand Down
Loading