Skip to content

Commit 6054866

Browse files
committed
chore: remove platformTemplate logic
1 parent 573da91 commit 6054866

19 files changed

+72
-130
lines changed

lib/commands/add-platform.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export class AddPlatformCommand extends ValidatePlatformCommandBase implements I
1313
}
1414

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

1919
public async canExecute(args: string[]): Promise<ICanExecuteCommandOutput> {

lib/commands/appstore-upload.ts

-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ export class PublishIOS implements ICommand {
6464
const platformInfo: IPreparePlatformInfo = {
6565
platform,
6666
appFilesUpdaterOptions,
67-
platformTemplate: this.$options.platformTemplate,
6867
projectData: this.$projectData,
6968
config: this.$options,
7069
env: this.$options.env

lib/commands/build.ts

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ export abstract class BuildCommandBase extends ValidatePlatformCommandBase {
2424
const platformInfo: IPreparePlatformInfo = {
2525
platform,
2626
appFilesUpdaterOptions,
27-
platformTemplate: this.$options.platformTemplate,
2827
projectData: this.$projectData,
2928
config: this.$options,
3029
env: this.$options.env

lib/commands/clean-app.ts

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ export class CleanAppCommandBase extends ValidatePlatformCommandBase implements
2525
appFilesUpdaterOptions,
2626
platform: this.platform.toLowerCase(),
2727
config: this.$options,
28-
platformTemplate: this.$options.platformTemplate,
2928
projectData: this.$projectData,
3029
env: this.$options.env
3130
};

lib/commands/install.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export class InstallCommand implements ICommand {
3434
const platformProjectService = platformData.platformProjectService;
3535
await platformProjectService.validate(this.$projectData, this.$options);
3636

37-
await this.$platformService.addPlatforms([`${platform}@${frameworkPackageData.version}`], this.$options.platformTemplate, this.$projectData, this.$options, this.$options.frameworkPath);
37+
await this.$platformService.addPlatforms([`${platform}@${frameworkPackageData.version}`], this.$projectData, this.$options, this.$options.frameworkPath);
3838
} catch (err) {
3939
error = `${error}${EOL}${err}`;
4040
}

lib/commands/platform-clean.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export class CleanCommand implements ICommand {
1010
}
1111

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

1616
public async canExecute(args: string[]): Promise<boolean> {

lib/commands/prepare.ts

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ export class PrepareCommand extends ValidatePlatformCommandBase implements IComm
2121
const platformInfo: IPreparePlatformInfo = {
2222
platform: args[0],
2323
appFilesUpdaterOptions,
24-
platformTemplate: this.$options.platformTemplate,
2524
projectData: this.$projectData,
2625
config: this.$options,
2726
env: this.$options.env

lib/commands/update-platform.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export class UpdatePlatformCommand implements ICommand {
1010
}
1111

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

1616
public async canExecute(args: string[]): Promise<boolean> {

lib/commands/update.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,12 @@ export class UpdateCommand extends ValidatePlatformCommandBase implements IComma
9494

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

100100
await this.$pluginsService.add(`${constants.TNS_CORE_MODULES_NAME}@${args[0]}`, this.$projectData);
101101
} else {
102-
await this.$platformService.addPlatforms(platforms.packagePlatforms, this.$options.platformTemplate, this.$projectData, this.$options, this.$options.frameworkPath);
102+
await this.$platformService.addPlatforms(platforms.packagePlatforms, this.$projectData, this.$options, this.$options.frameworkPath);
103103
await this.$pluginsService.add(constants.TNS_CORE_MODULES_NAME, this.$projectData);
104104
}
105105

lib/declarations.d.ts

+3-8
Original file line numberDiff line numberDiff line change
@@ -441,11 +441,6 @@ interface IBundleString {
441441
bundle: string;
442442
}
443443

444-
interface IPlatformTemplate {
445-
platformTemplate: string;
446-
}
447-
448-
449444
interface IClean {
450445
clean: boolean;
451446
}
@@ -499,7 +494,7 @@ interface IAndroidBundleOptions {
499494
aab: boolean;
500495
}
501496

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

590585
interface IRunPlatformOptions extends IJustLaunch, IDeviceEmulator { }
591586

592-
interface IDeployPlatformOptions extends IAndroidReleaseOptions, IPlatformTemplate, IRelease, IClean, IDeviceEmulator, IProvision, ITeamIdentifier, IProjectDir {
587+
interface IDeployPlatformOptions extends IAndroidReleaseOptions, IRelease, IClean, IDeviceEmulator, IProvision, ITeamIdentifier, IProjectDir {
593588
forceInstall?: boolean;
594589
}
595590

596-
interface IUpdatePlatformOptions extends IPlatformTemplate {
591+
interface IUpdatePlatformOptions {
597592
currentVersion: string;
598593
newVersion: string;
599594
canUpdate: boolean;

lib/definitions/platform.d.ts

+4-5
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ interface IBuildPlatformAction {
1515
}
1616

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

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

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

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

5353
/**
5454
* Ensures that the specified platform and its dependencies are installed.
@@ -316,7 +316,6 @@ interface IAddPlatformInfo extends IProjectDataComposition, IPlatformDataComposi
316316
frameworkDir: string;
317317
installedVersion: string;
318318
config: IPlatformOptions;
319-
platformTemplate?: string;
320319
}
321320

322321
interface IPreparePlatformJSInfo extends IPreparePlatformCoreInfo, ICopyAppFilesData {
@@ -335,7 +334,7 @@ interface IPreparePlatformCoreInfo extends IPreparePlatformInfoBase, IOptionalPr
335334
platformSpecificData: IPlatformSpecificData;
336335
}
337336

338-
interface IPreparePlatformInfo extends IPreparePlatformInfoBase, IPlatformConfig, IPlatformTemplate, ISkipNativeCheckOptional { }
337+
interface IPreparePlatformInfo extends IPreparePlatformInfoBase, IPlatformConfig, ISkipNativeCheckOptional { }
339338

340339
interface IPlatformConfig {
341340
config: IPlatformOptions;

lib/definitions/project.d.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -336,10 +336,9 @@ interface ILocalBuildService {
336336
* Builds a project locally.
337337
* @param {string} platform Platform for which to build.
338338
* @param {IPlatformBuildData} platformBuildOptions Additional options for controlling the build.
339-
* @param {string} platformTemplate The name of the template.
340339
* @return {Promise<string>} Path to the build output.
341340
*/
342-
build(platform: string, platformBuildOptions: IPlatformBuildData, platformTemplate?: string): Promise<string>;
341+
build(platform: string, platformBuildOptions: IPlatformBuildData): Promise<string>;
343342
/**
344343
* Removes build artifacts specific to the platform
345344
* @param {ICleanNativeAppData} data Data describing the clean app process

lib/helpers/deploy-command-helper.ts

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ export class DeployCommandHelper implements IDeployCommandHelper {
1717
device: this.$options.device,
1818
projectDir: this.$projectData.projectDir,
1919
emulator: this.$options.emulator,
20-
platformTemplate: this.$options.platformTemplate,
2120
release: this.$options.release,
2221
forceInstall: true,
2322
provision: this.$options.provision,

lib/options.ts

-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ export class Options {
9090
compileSdk: { type: OptionType.Number, hasSensitiveValue: false },
9191
port: { type: OptionType.Number, hasSensitiveValue: false },
9292
copyTo: { type: OptionType.String, hasSensitiveValue: true },
93-
platformTemplate: { type: OptionType.String, hasSensitiveValue: true },
9493
js: { type: OptionType.Boolean, hasSensitiveValue: false },
9594
javascript: { type: OptionType.Boolean, hasSensitiveValue: false },
9695
ng: { type: OptionType.Boolean, hasSensitiveValue: false },

lib/services/livesync/livesync-service.ts

-1
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,6 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
429429
nativePrepare: nativePrepare,
430430
filesToSync: options.filesToSync,
431431
filesToRemove: options.filesToRemove,
432-
platformTemplate: null,
433432
skipModulesNativeCheck: options.skipModulesNativeCheck,
434433
config: platformSpecificOptions
435434
};

lib/services/local-build-service.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export class LocalBuildService extends EventEmitter implements ILocalBuildServic
1212
super();
1313
}
1414

15-
public async build(platform: string, platformBuildOptions: IPlatformBuildData, platformTemplate?: string): Promise<string> {
15+
public async build(platform: string, platformBuildOptions: IPlatformBuildData): Promise<string> {
1616
if (this.$mobileHelper.isAndroidPlatform(platform) && platformBuildOptions.release && (!platformBuildOptions.keyStorePath || !platformBuildOptions.keyStorePassword || !platformBuildOptions.keyStoreAlias || !platformBuildOptions.keyStoreAliasPassword)) {
1717
this.$errors.fail(ANDROID_RELEASE_BUILD_ERROR_MESSAGE);
1818
}
@@ -21,7 +21,6 @@ export class LocalBuildService extends EventEmitter implements ILocalBuildServic
2121
const prepareInfo: IPreparePlatformInfo = {
2222
platform,
2323
appFilesUpdaterOptions: platformBuildOptions,
24-
platformTemplate,
2524
projectData: this.$projectData,
2625
env: platformBuildOptions.env,
2726
config: {

0 commit comments

Comments
 (0)