Skip to content

chore: remove projectTemplate logic #4517

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

Merged
merged 1 commit into from
Apr 10, 2019
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
2 changes: 1 addition & 1 deletion lib/commands/add-platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export class AddPlatformCommand extends ValidatePlatformCommandBase implements I
}

public async execute(args: string[]): Promise<void> {
await this.$platformService.addPlatforms(args, this.$options.platformTemplate, this.$projectData, this.$options, this.$options.frameworkPath);
await this.$platformService.addPlatforms(args, this.$projectData, this.$options, this.$options.frameworkPath);
}

public async canExecute(args: string[]): Promise<ICanExecuteCommandOutput> {
Expand Down
1 change: 0 additions & 1 deletion lib/commands/appstore-upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ export class PublishIOS implements ICommand {
const platformInfo: IPreparePlatformInfo = {
platform,
appFilesUpdaterOptions,
platformTemplate: this.$options.platformTemplate,
projectData: this.$projectData,
config: this.$options,
env: this.$options.env
Expand Down
1 change: 0 additions & 1 deletion lib/commands/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export abstract class BuildCommandBase extends ValidatePlatformCommandBase {
const platformInfo: IPreparePlatformInfo = {
platform,
appFilesUpdaterOptions,
platformTemplate: this.$options.platformTemplate,
projectData: this.$projectData,
config: this.$options,
env: this.$options.env
Expand Down
1 change: 0 additions & 1 deletion lib/commands/clean-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export class CleanAppCommandBase extends ValidatePlatformCommandBase implements
appFilesUpdaterOptions,
platform: this.platform.toLowerCase(),
config: this.$options,
platformTemplate: this.$options.platformTemplate,
projectData: this.$projectData,
env: this.$options.env
};
Expand Down
2 changes: 1 addition & 1 deletion lib/commands/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class InstallCommand implements ICommand {
const platformProjectService = platformData.platformProjectService;
await platformProjectService.validate(this.$projectData, this.$options);

await this.$platformService.addPlatforms([`${platform}@${frameworkPackageData.version}`], this.$options.platformTemplate, this.$projectData, this.$options, this.$options.frameworkPath);
await this.$platformService.addPlatforms([`${platform}@${frameworkPackageData.version}`], this.$projectData, this.$options, this.$options.frameworkPath);
} catch (err) {
error = `${error}${EOL}${err}`;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/commands/platform-clean.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export class CleanCommand implements ICommand {
}

public async execute(args: string[]): Promise<void> {
await this.$platformService.cleanPlatforms(args, this.$options.platformTemplate, this.$projectData, this.$options);
await this.$platformService.cleanPlatforms(args, this.$projectData, this.$options);
}

public async canExecute(args: string[]): Promise<boolean> {
Expand Down
1 change: 0 additions & 1 deletion lib/commands/prepare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export class PrepareCommand extends ValidatePlatformCommandBase implements IComm
const platformInfo: IPreparePlatformInfo = {
platform: args[0],
appFilesUpdaterOptions,
platformTemplate: this.$options.platformTemplate,
projectData: this.$projectData,
config: this.$options,
env: this.$options.env
Expand Down
2 changes: 1 addition & 1 deletion lib/commands/update-platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export class UpdatePlatformCommand implements ICommand {
}

public async execute(args: string[]): Promise<void> {
await this.$platformService.updatePlatforms(args, this.$options.platformTemplate, this.$projectData, this.$options);
await this.$platformService.updatePlatforms(args, this.$projectData, this.$options);
}

public async canExecute(args: string[]): Promise<boolean> {
Expand Down
4 changes: 2 additions & 2 deletions lib/commands/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,12 @@ export class UpdateCommand extends ValidatePlatformCommandBase implements IComma

if (args.length === 1) {
for (const platform of platforms.packagePlatforms) {
await this.$platformService.addPlatforms([platform + "@" + args[0]], this.$options.platformTemplate, this.$projectData, this.$options, this.$options.frameworkPath);
await this.$platformService.addPlatforms([platform + "@" + args[0]], this.$projectData, this.$options, this.$options.frameworkPath);
}

await this.$pluginsService.add(`${constants.TNS_CORE_MODULES_NAME}@${args[0]}`, this.$projectData);
} else {
await this.$platformService.addPlatforms(platforms.packagePlatforms, this.$options.platformTemplate, this.$projectData, this.$options, this.$options.frameworkPath);
await this.$platformService.addPlatforms(platforms.packagePlatforms, this.$projectData, this.$options, this.$options.frameworkPath);
await this.$pluginsService.add(constants.TNS_CORE_MODULES_NAME, this.$projectData);
}

Expand Down
11 changes: 3 additions & 8 deletions lib/declarations.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -441,11 +441,6 @@ interface IBundleString {
bundle: string;
}

interface IPlatformTemplate {
platformTemplate: string;
}


interface IClean {
clean: boolean;
}
Expand Down Expand Up @@ -499,7 +494,7 @@ interface IAndroidBundleOptions {
aab: boolean;
}

interface IOptions extends IRelease, IDeviceIdentifier, IJustLaunch, IAvd, IAvailableDevices, IProfileDir, IHasEmulatorOption, IBundleString, IPlatformTemplate, IHasEmulatorOption, IClean, IProvision, ITeamIdentifier, IAndroidReleaseOptions, IAndroidBundleOptions, INpmInstallConfigurationOptions, IPort, IEnvOptions, IPluginSeedOptions, IGenerateOptions {
interface IOptions extends IRelease, IDeviceIdentifier, IJustLaunch, IAvd, IAvailableDevices, IProfileDir, IHasEmulatorOption, IBundleString, IHasEmulatorOption, IClean, IProvision, ITeamIdentifier, IAndroidReleaseOptions, IAndroidBundleOptions, INpmInstallConfigurationOptions, IPort, IEnvOptions, IPluginSeedOptions, IGenerateOptions {
argv: IYargArgv;
validateOptions(commandSpecificDashedOptions?: IDictionary<IDashedOption>): void;
options: IDictionary<IDashedOption>;
Expand Down Expand Up @@ -589,11 +584,11 @@ interface IDeviceEmulator extends IHasEmulatorOption, IDeviceIdentifier { }

interface IRunPlatformOptions extends IJustLaunch, IDeviceEmulator { }

interface IDeployPlatformOptions extends IAndroidReleaseOptions, IPlatformTemplate, IRelease, IClean, IDeviceEmulator, IProvision, ITeamIdentifier, IProjectDir {
interface IDeployPlatformOptions extends IAndroidReleaseOptions, IRelease, IClean, IDeviceEmulator, IProvision, ITeamIdentifier, IProjectDir {
forceInstall?: boolean;
}

interface IUpdatePlatformOptions extends IPlatformTemplate {
interface IUpdatePlatformOptions {
currentVersion: string;
newVersion: string;
canUpdate: boolean;
Expand Down
9 changes: 4 additions & 5 deletions lib/definitions/platform.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ interface IBuildPlatformAction {
}

interface IPlatformService extends IBuildPlatformAction, NodeJS.EventEmitter {
cleanPlatforms(platforms: string[], platformTemplate: string, projectData: IProjectData, config: IPlatformOptions, framework?: string): Promise<void>;
cleanPlatforms(platforms: string[], projectData: IProjectData, config: IPlatformOptions, framework?: string): Promise<void>;

addPlatforms(platforms: string[], platformTemplate: string, projectData: IProjectData, config: IPlatformOptions, frameworkPath?: string): Promise<void>;
addPlatforms(platforms: string[], projectData: IProjectData, config: IPlatformOptions, frameworkPath?: string): Promise<void>;

/**
* Gets list of all installed platforms (the ones for which <project dir>/platforms/<platform> exists).
Expand Down Expand Up @@ -48,7 +48,7 @@ interface IPlatformService extends IBuildPlatformAction, NodeJS.EventEmitter {
*/
removePlatforms(platforms: string[], projectData: IProjectData): Promise<void>;

updatePlatforms(platforms: string[], platformTemplate: string, projectData: IProjectData, config: IPlatformOptions): Promise<void>;
updatePlatforms(platforms: string[], projectData: IProjectData, config: IPlatformOptions): Promise<void>;

/**
* Ensures that the specified platform and its dependencies are installed.
Expand Down Expand Up @@ -316,7 +316,6 @@ interface IAddPlatformInfo extends IProjectDataComposition, IPlatformDataComposi
frameworkDir: string;
installedVersion: string;
config: IPlatformOptions;
platformTemplate?: string;
}

interface IPreparePlatformJSInfo extends IPreparePlatformCoreInfo, ICopyAppFilesData {
Expand All @@ -335,7 +334,7 @@ interface IPreparePlatformCoreInfo extends IPreparePlatformInfoBase, IOptionalPr
platformSpecificData: IPlatformSpecificData;
}

interface IPreparePlatformInfo extends IPreparePlatformInfoBase, IPlatformConfig, IPlatformTemplate, ISkipNativeCheckOptional { }
interface IPreparePlatformInfo extends IPreparePlatformInfoBase, IPlatformConfig, ISkipNativeCheckOptional { }

interface IPlatformConfig {
config: IPlatformOptions;
Expand Down
3 changes: 1 addition & 2 deletions lib/definitions/project.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,10 +336,9 @@ interface ILocalBuildService {
* Builds a project locally.
* @param {string} platform Platform for which to build.
* @param {IPlatformBuildData} platformBuildOptions Additional options for controlling the build.
* @param {string} platformTemplate The name of the template.
* @return {Promise<string>} Path to the build output.
*/
build(platform: string, platformBuildOptions: IPlatformBuildData, platformTemplate?: string): Promise<string>;
build(platform: string, platformBuildOptions: IPlatformBuildData): Promise<string>;
/**
* Removes build artifacts specific to the platform
* @param {ICleanNativeAppData} data Data describing the clean app process
Expand Down
1 change: 0 additions & 1 deletion lib/helpers/deploy-command-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export class DeployCommandHelper implements IDeployCommandHelper {
device: this.$options.device,
projectDir: this.$projectData.projectDir,
emulator: this.$options.emulator,
platformTemplate: this.$options.platformTemplate,
release: this.$options.release,
forceInstall: true,
provision: this.$options.provision,
Expand Down
1 change: 0 additions & 1 deletion lib/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ export class Options {
compileSdk: { type: OptionType.Number, hasSensitiveValue: false },
port: { type: OptionType.Number, hasSensitiveValue: false },
copyTo: { type: OptionType.String, hasSensitiveValue: true },
platformTemplate: { type: OptionType.String, hasSensitiveValue: true },
js: { type: OptionType.Boolean, hasSensitiveValue: false },
javascript: { type: OptionType.Boolean, hasSensitiveValue: false },
ng: { type: OptionType.Boolean, hasSensitiveValue: false },
Expand Down
1 change: 0 additions & 1 deletion lib/services/livesync/livesync-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,6 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
nativePrepare: nativePrepare,
filesToSync: options.filesToSync,
filesToRemove: options.filesToRemove,
platformTemplate: null,
skipModulesNativeCheck: options.skipModulesNativeCheck,
config: platformSpecificOptions
};
Expand Down
3 changes: 1 addition & 2 deletions lib/services/local-build-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class LocalBuildService extends EventEmitter implements ILocalBuildServic
super();
}

public async build(platform: string, platformBuildOptions: IPlatformBuildData, platformTemplate?: string): Promise<string> {
public async build(platform: string, platformBuildOptions: IPlatformBuildData): Promise<string> {
if (this.$mobileHelper.isAndroidPlatform(platform) && platformBuildOptions.release && (!platformBuildOptions.keyStorePath || !platformBuildOptions.keyStorePassword || !platformBuildOptions.keyStoreAlias || !platformBuildOptions.keyStoreAliasPassword)) {
this.$errors.fail(ANDROID_RELEASE_BUILD_ERROR_MESSAGE);
}
Expand All @@ -21,7 +21,6 @@ export class LocalBuildService extends EventEmitter implements ILocalBuildServic
const prepareInfo: IPreparePlatformInfo = {
platform,
appFilesUpdaterOptions: platformBuildOptions,
platformTemplate,
projectData: this.$projectData,
env: platformBuildOptions.env,
config: {
Expand Down
Loading