Skip to content

Commit

Permalink
Improve CreateProvisioningProfileCommand with platform
Browse files Browse the repository at this point in the history
  • Loading branch information
tinder-cwybranowski committed Oct 11, 2023
1 parent 1d07488 commit 3428713
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ internal struct CreateProvisioningProfileCommand: ParsableCommand {
case keychainPassword = "keychainPassword"
case bundleIdentifier = "bundleIdentifier"
case bundleIdentifierName = "bundleIdentifierName"
case platform = "platform"
case profileType = "profileType"
case certificateType = "certificateType"
case outputPath = "outputPath"
Expand Down Expand Up @@ -146,6 +147,9 @@ internal struct CreateProvisioningProfileCommand: ParsableCommand {
@Option(help: "The bundle identifier name for the desired bundle identifier, this is optional but if it is not set the logic will select the first bundle id it finds that matches `--bundle-identifier`")
internal var bundleIdentifierName: String?

@Option(help: "The intended operating system for the target (https://developer.apple.com/documentation/appstoreconnectapi/bundleidplatform)")
internal var platform: String

@Option(help: "The profile type which you wish to create (https://developer.apple.com/documentation/appstoreconnectapi/profilecreaterequest/data/attributes)")
internal var profileType: String

Expand Down Expand Up @@ -218,7 +222,8 @@ internal struct CreateProvisioningProfileCommand: ParsableCommand {
opensslPath: String,
intermediaryAppleCertificates: [String],
certificateSigningRequestSubject: String,
bundleIdentifierName: String?
bundleIdentifierName: String?,
platform: String
) {
self.files = files
self.log = log
Expand All @@ -240,6 +245,7 @@ internal struct CreateProvisioningProfileCommand: ParsableCommand {
self.intermediaryAppleCertificates = intermediaryAppleCertificates
self.certificateSigningRequestSubject = certificateSigningRequestSubject
self.bundleIdentifierName = bundleIdentifierName
self.platform = platform
}

internal init(from decoder: Decoder) throws {
Expand Down Expand Up @@ -272,7 +278,8 @@ internal struct CreateProvisioningProfileCommand: ParsableCommand {
opensslPath: try container.decode(String.self, forKey: .opensslPath),
intermediaryAppleCertificates: try container.decodeIfPresent([String].self, forKey: .intermediaryAppleCertificates) ?? [],
certificateSigningRequestSubject: try container.decode(String.self, forKey: .certificateSigningRequestSubject),
bundleIdentifierName: try container.decodeIfPresent(String.self, forKey: .bundleIdentifierName)
bundleIdentifierName: try container.decodeIfPresent(String.self, forKey: .bundleIdentifierName),
platform: try container.decode(String.self, forKey: .platform)
)
}

Expand Down Expand Up @@ -303,7 +310,8 @@ internal struct CreateProvisioningProfileCommand: ParsableCommand {
bundleId: try iTunesConnectService.determineBundleIdITCId(
jsonWebToken: jsonWebToken,
bundleIdentifier: bundleIdentifier,
bundleIdentifierName: bundleIdentifierName
bundleIdentifierName: bundleIdentifierName,
platform: platform
),
certificateId: certificateId,
deviceIDs: deviceIDs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ final class CreateProvisioningProfileCommandTests: XCTestCase {
opensslPath: "/opensslPath",
intermediaryAppleCertificates: ["/intermediaryAppleCertificate"],
certificateSigningRequestSubject: "certificateSigningRequestSubject",
bundleIdentifierName: "bundleIdentifierName"
bundleIdentifierName: "bundleIdentifierName",
platform: "platform"
)
isRecording = false
}
Expand Down Expand Up @@ -158,7 +159,8 @@ final class CreateProvisioningProfileCommandTests: XCTestCase {
"outputPath": "/outputPath",
"opensslPath": "/opensslPath",
"certificateSigningRequestSubject": "certificateSigningRequestSubject",
"bundleIdentifierName": "bundleIdentifierName"
"bundleIdentifierName": "bundleIdentifierName",
"platform": "platform"
}
""".utf8)

Expand All @@ -177,6 +179,7 @@ final class CreateProvisioningProfileCommandTests: XCTestCase {
XCTAssertEqual(subject.certificateType, "certificateType")
XCTAssertEqual(subject.outputPath, "/outputPath")
XCTAssertEqual(subject.bundleIdentifierName, "bundleIdentifierName")
XCTAssertEqual(subject.platform, "platform")
}

func test_execute_alreadyActiveCertificate() throws {
Expand Down

0 comments on commit 3428713

Please sign in to comment.