Skip to content

Commit

Permalink
Merge d15-3 (#2322)
Browse files Browse the repository at this point in the history
* [msbuild] Re-added wildcard (*) expandsion for application-identifier in Entitlements.plist (#2186)

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=57119

* Bump mono (#2213)

* Framework tests were still binding non-linked Simple class which errors now (#2216) (#2218)

- Improve Makefile to rebuild when projects build with errors

* Bump mono to get cecil fix for bug #56808. (#2222)

https://bugzilla.xamarin.com/show_bug.cgi?id=56808

* [msbuild] Use @(ReferencePath) instead of @(ResolvedFiles) (#2188) (#2214)

This allows things to work on both xbuild and msbuild.

In xbuild, both lists are exactly the same and on msbuild,
only @(ReferencePath) exists.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=55147

* NSActivityOptions.IdleDisplaySleepDisabled had wrong value (#2232) (#2239)

This was due to an integer overflow.  The original value was based on Int32
1 << 40 == 256

The correct value should be based on a UInt64.
1UL << 40 == 1099511627776

* [tests] Fix bug 57699 - [iOS]InternalsTest failure (Linkall) tests on device (#2243)

Strip native debugging symbols should not be checked for debug builds

* Bump mono to get fix for bug #57780.

https://bugzilla.xamarin.com/show_bug.cgi?id=57780
  • Loading branch information
spouliot authored Jul 13, 2017
1 parent 2869ca5 commit 35765ec
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 15 deletions.
2 changes: 1 addition & 1 deletion msbuild/Xamarin.Mac.Tasks/Xamarin.Mac.Common.targets
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ Copyright (C) 2014 Xamarin. All rights reserved.
NoOverwrite="@(_BundleResourceWithLogicalName)"
IntermediateOutputPath="$(IntermediateOutputPath)"
TargetFrameworkDirectory="$(TargetFrameworkDirectory)"
ReferencedLibraries="@(ResolvedFiles)">
ReferencedLibraries="@(ReferencePath)">
<Output TaskParameter="BundleResourcesWithLogicalNames" ItemName="_BundleResourceWithLogicalName" />
<Output TaskParameter="BundleResourcesWithLogicalNames" ItemName="FileWrites" />
</UnpackLibraryResources>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ protected virtual bool MergeProfileEntitlements {
get { return true; }
}

PString MergeEntitlementString (PString pstr, MobileProvision profile)
PString MergeEntitlementString (PString pstr, MobileProvision profile, bool expandWildcards)
{
string TeamIdentifierPrefix;
string AppIdentifierPrefix;
Expand Down Expand Up @@ -96,6 +96,25 @@ PString MergeEntitlementString (PString pstr, MobileProvision profile)

var expanded = StringParserService.Parse (pstr.Value, customTags);

if (expandWildcards && expanded.IndexOf ('*') != -1) {
int asterisk = expanded.IndexOf ('*');
string prefix;

if (expanded.StartsWith (TeamIdentifierPrefix, StringComparison.Ordinal))
prefix = TeamIdentifierPrefix;
else if (expanded.StartsWith (AppIdentifierPrefix, StringComparison.Ordinal))
prefix = AppIdentifierPrefix;
else
prefix = string.Empty;

var baseBundleIdentifier = expanded.Substring (prefix.Length, asterisk - prefix.Length);

if (!BundleIdentifier.StartsWith (baseBundleIdentifier, StringComparison.Ordinal))
expanded = expanded.Replace ("*", BundleIdentifier);
else
expanded = prefix + BundleIdentifier;
}

return new PString (expanded);
}

Expand All @@ -109,7 +128,7 @@ PArray MergeEntitlementArray (PArray array, MobileProvision profile)
if (item is PDictionary)
value = MergeEntitlementDictionary ((PDictionary) item, profile);
else if (item is PString)
value = MergeEntitlementString ((PString) item, profile);
value = MergeEntitlementString ((PString) item, profile, false);
else if (item is PArray)
value = MergeEntitlementArray ((PArray) item, profile);
else
Expand All @@ -135,7 +154,7 @@ PDictionary MergeEntitlementDictionary (PDictionary dict, MobileProvision profil
if (value is PDictionary)
value = MergeEntitlementDictionary ((PDictionary) value, profile);
else if (value is PString)
value = MergeEntitlementString ((PString) value, profile);
value = MergeEntitlementString ((PString) value, profile, false);
else if (value is PArray)
value = MergeEntitlementArray ((PArray) value, profile);
else
Expand Down Expand Up @@ -210,7 +229,7 @@ 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);
value = MergeEntitlementString ((PString) value, profile, item.Key == ApplicationIdentifierKey);
else if (value is PArray)
value = MergeEntitlementArray ((PArray) value, profile);
else
Expand Down Expand Up @@ -244,7 +263,7 @@ 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);
value = MergeEntitlementString ((PString) value, profile, item.Key == ApplicationIdentifierKey);
else if (value is PArray)
value = MergeEntitlementArray ((PArray) value, profile);
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public void ValidateEntitlement ()
ExecuteTask (task);
var compiled = PDictionary.FromFile (compiledEntitlements);
Assert.IsTrue (compiled.Get<PBoolean> (EntitlementKeys.GetTaskAllow).Value, "#1");
Assert.AreEqual ("32UV7A8CDE.*", compiled.Get<PString> ("application-identifier").Value, "#2");
Assert.AreEqual ("32UV7A8CDE.com.xamarin.MySingleView", compiled.Get<PString> ("application-identifier").Value, "#2");
Assert.AreEqual ("Z8CSQKJE7R", compiled.Get<PString> ("com.apple.developer.team-identifier").Value, "#3");
Assert.AreEqual ("applinks:*.xamarin.com", compiled.GetAssociatedDomains ().ToStringArray ().First (), "#4");
Assert.AreEqual ("Z8CSQKJE7R.*", compiled.GetPassBookIdentifiers ().ToStringArray ().First (), "#5");
Expand Down
14 changes: 7 additions & 7 deletions src/Foundation/Enum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -970,13 +970,13 @@ public enum NSUrlErrorCancelledReason : nint {

[Flags]
public enum NSActivityOptions : ulong {
IdleDisplaySleepDisabled = 1 << 40,
IdleSystemSleepDisabled = 1 << 20,
SuddenTerminationDisabled = 1 << 14,
AutomaticTerminationDisabled = 1 << 15,
UserInitiated = 0x00FFFFFF | IdleSystemSleepDisabled,
Background = 0x000000ff,
LatencyCritical = 0xFF00000000,
IdleDisplaySleepDisabled = 1UL << 40,
IdleSystemSleepDisabled = 1UL << 20,
SuddenTerminationDisabled = 1UL << 14,
AutomaticTerminationDisabled = 1UL << 15,
UserInitiated = 0x00FFFFFFUL | IdleSystemSleepDisabled,
Background = 0x000000ffUL,
LatencyCritical = 0xFF00000000UL,
}

[Native]
Expand Down
1 change: 1 addition & 0 deletions tests/linker-ios/link all/link all.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
<MtouchI18n>mideast,other</MtouchI18n>
<MtouchArch>ARMv7, ARM64</MtouchArch>
<MtouchExtraArgs>-gcc_flags="-UhoItsB0rken"</MtouchExtraArgs>
<MtouchNoSymbolStrip>true</MtouchNoSymbolStrip>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug32|iPhone' ">
<DebugSymbols>True</DebugSymbols>
Expand Down

0 comments on commit 35765ec

Please sign in to comment.