Skip to content

Commit 3f42363

Browse files
committed
add normalizedPlatformName in platformData
1 parent 5f12de3 commit 3f42363

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

lib/definitions/platform.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ interface IPlatformData {
1111
frameworkPackageName: string;
1212
platformProjectService: IPlatformSpecificProjectService;
1313
projectRoot: string;
14+
normalizedPlatformName: string;
1415
targetedOS?: string[];
1516
}
1617

lib/services/platform-service.ts

+4-13
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@ class PlatformsData implements IPlatformsData {
99
ios: {
1010
frameworkPackageName: "tns-ios",
1111
platformProjectService: $injector.resolve("iOSProjectService"),
12+
normalizedPlatformName: "iOS",
1213
projectRoot: "",
1314
targetedOS: ['darwin']
1415
},
1516
android: {
1617
frameworkPackageName: "tns-android",
1718
platformProjectService: $injector.resolve("androidProjectService"),
19+
normalizedPlatformName: "Android",
1820
projectRoot: ""
1921
}
2022
};
@@ -111,9 +113,9 @@ export class PlatformService implements IPlatformService {
111113
return (() => {
112114
platform = platform.toLowerCase();
113115
this.validatePlatform(platform);
114-
var normalizedPlatformName = this.normalizePlatformName(platform);
115116

116-
this.$platformProjectService.prepareProject(normalizedPlatformName, this.$platformsData.platformsNames).wait();
117+
this.$platformProjectService.prepareProject(this.$platformsData.getPlatformData(platform).normalizedPlatformName,
118+
this.$platformsData.platformsNames).wait();
117119
}).future<void>()();
118120
}
119121

@@ -149,16 +151,5 @@ export class PlatformService implements IPlatformService {
149151

150152
return false;
151153
}
152-
153-
private normalizePlatformName(platform: string): string {
154-
switch(platform) {
155-
case "android":
156-
return "Android";
157-
case "ios":
158-
return "iOS";
159-
}
160-
161-
return undefined;
162-
}
163154
}
164155
$injector.register("platformService", PlatformService);

0 commit comments

Comments
 (0)