Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ protected string ApplicationIdentifierKey {

public string CodesignProvision { get; set; }

public string CodesignEntitlements { get; set; }
public ITaskItem CodesignEntitlements { get; set; }

public string CodesignRequireProvisioningProfile { get; set; }

Expand Down Expand Up @@ -180,13 +180,13 @@ public bool RequireProvisioningProfile {
bool HasEntitlements {
get {
if (!hasEntitlements.HasValue) {
if (string.IsNullOrEmpty (CodesignEntitlements)) {
if (string.IsNullOrEmpty (CodesignEntitlements?.ItemSpec)) {
// If no CodesignEntitlements was specified, we don't have any entitlements
hasEntitlements = false;
} else {
if (IsDotNet) {
// .NET: Check the file to see if there are any entitlements inside
var entitlements = PDictionary.FromFile (CodesignEntitlements);
var entitlements = PDictionary.FromFile (CodesignEntitlements.ItemSpec);
hasEntitlements = entitlements.Count > 0;
} else {
// Legacy Xamarin: to preserve backwards compat, consider the presence of a file enough to say we have entitlements.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public void EmptyEntitlements (EntitlementTestCase testCase)
File.WriteAllText (entitlementsPath, testCase.Entitlements);

var task = CreateTask (dir, simulator: testCase.IsSimulator);
task.CodesignEntitlements = entitlementsPath;
task.CodesignEntitlements = new TaskItem (entitlementsPath);
task.SdkIsSimulator = testCase.IsSimulator;
if (testCase.CodesignRequireProvisioningProfile.HasValue)
task.CodesignRequireProvisioningProfile = testCase.CodesignRequireProvisioningProfile.Value.ToString ();
Expand Down