Skip to content

Commit

Permalink
Merge pull request #8 from NativeScript/kddimitrov/set-code-signing-b…
Browse files Browse the repository at this point in the history
…y-product-type-list

feat: set signing for target matching one of the specified product types
  • Loading branch information
KristianDD authored Apr 25, 2019
2 parents d6441dd + 3182291 commit bb6ebd4
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pbxproj-dom",
"version": "1.1.0",
"version": "1.2.0",
"description": "",
"main": "index.js",
"devDependencies": {
Expand Down
27 changes: 22 additions & 5 deletions xcode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,29 @@ export class Xcode {
});
}

/**
* Sets Manual signing style for targets in the pbx.Document that match a specified product types.
*/
setManualSigningStyleByTargetProductType(targetProductType: string, {team, uuid, name, identity}: ManualSigning = { team: undefined, uuid: undefined, name: undefined }) {
this.setManualSigningStyleByTargetProductTypesList([targetProductType], {team, uuid, name, identity});
}

/**
* Sets Manual signing style for targets in the pbx.Document that match one of the specified product types.
*/
setManualSigningStyleByTargetProductTypesList(targetProductTypesList: string[], {team, uuid, name, identity}: ManualSigning = { team: undefined, uuid: undefined, name: undefined }) {
this.document.targets
.filter(target => target.productType === targetProductType)
.filter(target => targetProductTypesList.indexOf(target.productType) >= 0)
.forEach(target => {
this.setTargetManualSigningStyle(target, {team, uuid, name, identity})
this.setTargetManualSigningStyle(target, {team, uuid, name, identity});
});
}

setManualSigningStyleByTargetKey(targetKey: string, {team, uuid, name, identity}: ManualSigning = { team: undefined, uuid: undefined, name: undefined }) {
this.document.targets
.filter(target => target.key === targetKey)
.forEach(target => {
this.setTargetManualSigningStyle(target, {team, uuid, name, identity})
this.setTargetManualSigningStyle(target, {team, uuid, name, identity});
});
}

Expand All @@ -89,11 +99,18 @@ export class Xcode {
}

/**
* Sets Automatic signing style for a target in the pbx.Document.
* Sets Automatic signing style for a target in the pbx.Document that match one of the specified product types.
*/
setAutomaticSigningStyleByTargetProductType(targetProductType: string, developmentTeam: string) {
this.setAutomaticSigningStyleByTargetProductTypesList([targetProductType], developmentTeam);
}

/**
* Sets Automatic signing style for targets in the pbx.Document that match one of the specified product types.
*/
setAutomaticSigningStyleByTargetProductTypesList(targetProductTypesList: string[], developmentTeam: string) {
this.document.targets
.filter(target => target.productType === targetProductType)
.filter(target => targetProductTypesList.indexOf(target.productType) >= 0)
.forEach(target => {
this.setTargetAutomaticSigningStyle(target, developmentTeam);
});
Expand Down

0 comments on commit bb6ebd4

Please sign in to comment.