introduce undefined target platform

上级 fbb1d8de
......@@ -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;
......
......@@ -34,6 +34,7 @@ export const enum TargetPlatform {
UNIVERSAL = 'universal',
UNKNOWN = 'unknown',
UNDEFINED = 'undefined',
}
export function toTargetPlatform(targetPlatform: string): TargetPlatform {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册