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

[msbuild] Make DetectSigningIdentity.CodesignEntitlements an ITaskItem property. #16174

Merged
merged 1 commit into from
Sep 30, 2022
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 @@ -104,7 +104,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 @@ -178,13 +178,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