appcenter-cli
Version:
Command line tool for Visual Studio App Center
46 lines (37 loc) • 1.35 kB
text/typescript
import { CommandArgs, help, longName, hasArg } from "../../../util/commandline";
import { XCUITestPreparer } from "../lib/xcuitest-preparer";
import { PrepareTestsCommand } from "../lib/prepare-tests-command";
import { Messages } from "../lib/help-messages";
export default class PrepareXCUITestCommand extends PrepareTestsCommand {
buildDir: string;
testIpaPath: string;
include: string[];
constructor(args: CommandArgs) {
super(args);
}
protected prepareManifest(): Promise<string> {
const preparer = new XCUITestPreparer(this.artifactsDir, this.buildDir, this.testIpaPath, this.include);
return preparer.prepare();
}
protected getSourceRootDir() {
return this.buildDir;
}
protected async validateOptions(): Promise<void> {
if (this.buildDir && this.testIpaPath) {
throw Error("--build-dir cannot be used with --test-ipa-path");
}
if (!(this.buildDir || this.testIpaPath)) {
throw Error("--build-dir or --test-ipa-path is required");
}
}
}