introduce undefined target platform

This commit is contained in:
Sandeep Somavarapu 2021-08-23 13:47:30 +02:00
parent fbb1d8de11
commit f124333cc2
No known key found for this signature in database
GPG key ID: 1FED25EC4646638B
2 changed files with 7 additions and 1 deletions

View file

@ -313,7 +313,7 @@ function getIsPreview(flags: string): boolean {
}
function getTargetPlatform(version: IRawGalleryExtensionVersion): TargetPlatform {
return version.targetPlatform ? toTargetPlatform(version.targetPlatform) : TargetPlatform.UNIVERSAL;
return version.targetPlatform ? toTargetPlatform(version.targetPlatform) : TargetPlatform.UNDEFINED;
}
function getAllTargetPlatforms(rawGalleryExtension: IRawGalleryExtension): TargetPlatform[] {
@ -350,6 +350,11 @@ function isTargetPlatformCompatible(extensionTargetPlatform: TargetPlatform, all
return false;
}
// Compatible when extension target platform is not defined
if (extensionTargetPlatform === TargetPlatform.UNDEFINED) {
return true;
}
// Compatible when extension target platform is universal
if (extensionTargetPlatform === TargetPlatform.UNIVERSAL) {
return true;

View file

@ -34,6 +34,7 @@ export const enum TargetPlatform {
UNIVERSAL = 'universal',
UNKNOWN = 'unknown',
UNDEFINED = 'undefined',
}
export function toTargetPlatform(targetPlatform: string): TargetPlatform {