Skip to content

Commit ffb0e8e

Browse files
committed
Using teamId without arg will print all teams, teamId and provision are mutually exclusive, teamId now should work with name if a provision that has the team id for the provided team name is found
1 parent 0aac8da commit ffb0e8e

19 files changed

+181
-124
lines changed

lib/commands/build.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export class BuildIosCommand extends BuildCommandBase implements ICommand {
5757

5858
public canExecute(args: string[]): Promise<boolean> {
5959
super.validatePlatform(this.$devicePlatformsConstants.iOS);
60-
return args.length === 0 && this.$platformService.validateOptions(this.$options.provision, this.$projectData, this.$platformsData.availablePlatforms.iOS);
60+
return args.length === 0 && this.$platformService.validateOptions(this.$options.provision, this.$options.teamId, this.$projectData, this.$platformsData.availablePlatforms.iOS);
6161
}
6262
}
6363

@@ -89,7 +89,7 @@ export class BuildAndroidCommand extends BuildCommandBase implements ICommand {
8989
const platformProjectService = platformData.platformProjectService;
9090
await platformProjectService.validate(this.$projectData);
9191

92-
return args.length === 0 && await this.$platformService.validateOptions(this.$options.provision, this.$projectData, this.$platformsData.availablePlatforms.Android);
92+
return args.length === 0 && await this.$platformService.validateOptions(this.$options.provision, this.$options.teamId, this.$projectData, this.$platformsData.availablePlatforms.Android);
9393
}
9494
}
9595

lib/commands/debug.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ export class DebugIOSCommand implements ICommand {
154154
this.$errors.fail(`Applications for platform ${this.$devicePlatformsConstants.iOS} can not be built on this OS`);
155155
}
156156

157-
return await this.debugPlatformCommand.canExecute(args) && await this.$platformService.validateOptions(this.$options.provision, this.$projectData, this.$platformsData.availablePlatforms.iOS);
157+
return await this.debugPlatformCommand.canExecute(args) && await this.$platformService.validateOptions(this.$options.provision, this.$options.teamId, this.$projectData, this.$platformsData.availablePlatforms.iOS);
158158
}
159159

160160
public platform = this.$devicePlatformsConstants.iOS;
@@ -186,7 +186,7 @@ export class DebugAndroidCommand implements ICommand {
186186
return this.debugPlatformCommand.execute(args);
187187
}
188188
public async canExecute(args: string[]): Promise<boolean> {
189-
return await this.debugPlatformCommand.canExecute(args) && await this.$platformService.validateOptions(this.$options.provision, this.$projectData, this.$platformsData.availablePlatforms.Android);
189+
return await this.debugPlatformCommand.canExecute(args) && await this.$platformService.validateOptions(this.$options.provision, this.$options.teamId, this.$projectData, this.$platformsData.availablePlatforms.Android);
190190
}
191191

192192
public platform = this.$devicePlatformsConstants.Android;

lib/commands/deploy.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export class DeployOnDeviceCommand implements ICommand {
4848
const platformProjectService = platformData.platformProjectService;
4949
await platformProjectService.validate(this.$projectData);
5050

51-
return this.$platformService.validateOptions(this.$options.provision, this.$projectData, args[0]);
51+
return this.$platformService.validateOptions(this.$options.provision, this.$options.teamId, this.$projectData, args[0]);
5252
}
5353
}
5454

lib/commands/prepare.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export class PrepareCommand implements ICommand {
1616

1717
public async canExecute(args: string[]): Promise<boolean> {
1818
const platform = args[0];
19-
const result = await this.$platformCommandParameter.validate(platform) && await this.$platformService.validateOptions(this.$options.provision, this.$projectData, platform);
19+
const result = await this.$platformCommandParameter.validate(platform) && await this.$platformService.validateOptions(this.$options.provision, this.$options.teamId, this.$projectData, platform);
2020
if (result) {
2121
const platformData = this.$platformsData.getPlatformData(platform, this.$projectData);
2222
const platformProjectService = platformData.platformProjectService;

lib/commands/run.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export class RunIosCommand implements ICommand {
9797
}
9898

9999
public async canExecute(args: string[]): Promise<boolean> {
100-
return await this.runCommand.canExecute(args) && await this.$platformService.validateOptions(this.$options.provision, this.$projectData, this.$platformsData.availablePlatforms.iOS);
100+
return await this.runCommand.canExecute(args) && await this.$platformService.validateOptions(this.$options.provision, this.$options.teamId, this.$projectData, this.$platformsData.availablePlatforms.iOS);
101101
}
102102
}
103103

@@ -140,7 +140,7 @@ export class RunAndroidCommand implements ICommand {
140140
if (this.$options.release && (!this.$options.keyStorePath || !this.$options.keyStorePassword || !this.$options.keyStoreAlias || !this.$options.keyStoreAliasPassword)) {
141141
this.$errors.fail("When producing a release build, you need to specify all --key-store-* options.");
142142
}
143-
return this.$platformService.validateOptions(this.$options.provision, this.$projectData, this.$platformsData.availablePlatforms.Android);
143+
return this.$platformService.validateOptions(this.$options.provision, this.$options.teamId, this.$projectData, this.$platformsData.availablePlatforms.Android);
144144
}
145145
}
146146

lib/definitions/platform.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ interface IPlatformService extends NodeJS.EventEmitter {
101101
* If no platform is provided or a falsy (null, undefined, "", false...) platform is provided,
102102
* the options will be validated for all available platforms.
103103
*/
104-
validateOptions(provision: any, projectData: IProjectData, platform?: string): Promise<boolean>;
104+
validateOptions(provision: true | string, teamId: true | string, projectData: IProjectData, platform?: string): Promise<boolean>;
105105

106106
/**
107107
* Executes prepare, build and installOnPlatform when necessary to ensure that the latest version of the app is installed on specified platform.
@@ -218,7 +218,7 @@ interface IPlatformOptions extends IPlatformSpecificData, ICreateProjectOptions
218218
/**
219219
* Platform specific data required for project preparation.
220220
*/
221-
interface IPlatformSpecificData extends IProvision {
221+
interface IPlatformSpecificData extends IProvision, ITeamIdentifier {
222222
/**
223223
* Target SDK for Android.
224224
*/

lib/definitions/project-changes.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ interface IProjectChangesInfo extends IAddedNativePlatform {
2222
readonly changesRequirePrepare: boolean;
2323
}
2424

25-
interface IProjectChangesOptions extends IAppFilesUpdaterOptions, IProvision {
25+
interface IProjectChangesOptions extends IAppFilesUpdaterOptions, IProvision, ITeamIdentifier {
2626
nativePlatformStatus?: "1" | "2" | "3";
2727
}
2828

2929
interface IProjectChangesService {
30-
checkForChanges(platform: string, projectData: IProjectData, buildOptions: IProjectChangesOptions): IProjectChangesInfo;
30+
checkForChanges(platform: string, projectData: IProjectData, buildOptions: IProjectChangesOptions): Promise<IProjectChangesInfo>;
3131
getPrepareInfo(platform: string, projectData: IProjectData): IPrepareInfo;
3232
savePrepareInfo(platform: string, projectData: IProjectData): void;
3333
getPrepareInfoFilePath(platform: string, projectData: IProjectData): string;

lib/definitions/project.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ interface IPlatformProjectService extends NodeJS.EventEmitter {
178178
* @param {any} provision UUID of the provisioning profile used in iOS option validation.
179179
* @returns {void}
180180
*/
181-
validateOptions(projectId?: string, provision?: true | string): Promise<boolean>;
181+
validateOptions(projectId?: string, provision?: true | string, teamId?: true | string): Promise<boolean>;
182182

183183
validatePlugins(projectData: IProjectData): Promise<void>;
184184

@@ -265,7 +265,7 @@ interface IPlatformProjectService extends NodeJS.EventEmitter {
265265
* Check the current state of the project, and validate against the options.
266266
* If there are parts in the project that are inconsistent with the desired options, marks them in the changeset flags.
267267
*/
268-
checkForChanges(changeset: IProjectChangesInfo, options: IProjectChangesOptions, projectData: IProjectData): void;
268+
checkForChanges(changeset: IProjectChangesInfo, options: IProjectChangesOptions, projectData: IProjectData): Promise<void>;
269269
}
270270

271271
interface IAndroidProjectPropertiesManager {

lib/options.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export class Options extends commonOptionsLibPath.OptionsBase {
3434
androidTypings: { type: OptionType.Boolean },
3535
bundle: { type: OptionType.Boolean },
3636
all: { type: OptionType.Boolean },
37-
teamId: { type: OptionType.String },
37+
teamId: { type: OptionType.Object },
3838
syncAllFiles: { type: OptionType.Boolean, default: false },
3939
liveEdit: { type: OptionType.Boolean },
4040
chrome: { type: OptionType.Boolean },

lib/services/android-project-service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
447447
await adb.executeShellCommand(["rm", "-rf", deviceRootPath]);
448448
}
449449

450-
public checkForChanges(changesInfo: IProjectChangesInfo, options: IProjectChangesOptions, projectData: IProjectData): void {
450+
public async checkForChanges(changesInfo: IProjectChangesInfo, options: IProjectChangesOptions, projectData: IProjectData): Promise<void> {
451451
// Nothing android specific to check yet.
452452
}
453453

0 commit comments

Comments
 (0)