Skip to content

Commit a6717d8

Browse files
committed
fix: no way to control watchos deployment target
1 parent e444d49 commit a6717d8

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

lib/services/ios-extensions-service.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,13 @@ export class IOSExtensionsService extends NativeTargetServiceBase implements IIO
3333

3434
private configureTarget(extensionName: string, extensionPath: string, target: IXcode.target, project: IXcode.project, projectData: IProjectData) {
3535
const extJsonPath = path.join(extensionPath, "extension.json");
36-
this.setConfigurationsFromJsonFile(extJsonPath, target.uuid, project);
3736

3837
this.setXcodeTargetBuildConfigurationProperties(
3938
[{name: "PRODUCT_BUNDLE_IDENTIFIER", value: `${projectData.projectIdentifiers.ios}.${extensionName}`}],
4039
extensionName,
4140
project);
41+
42+
this.setConfigurationsFromJsonFile(extJsonPath, target.uuid, extensionName, project);
4243
}
4344

4445
public removeExtensions({pbxProjPath}: IRemoveExtensionsOptions): void {

lib/services/ios-native-target-service-base.ts

+10-2
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,25 @@ export abstract class NativeTargetServiceBase implements IIOSNativeTargetService
7171
});
7272
}
7373

74-
protected setConfigurationsFromJsonFile(jsonPath: string, targetUuid: string, project: IXcode.project) {
74+
protected setConfigurationsFromJsonFile(jsonPath: string, targetUuid: string, targetName: string, project: IXcode.project) {
7575
if (this.$fs.exists(jsonPath)) {
7676
const configurationJson = this.$fs.readJson(jsonPath) || {};
77+
7778
_.forEach(configurationJson.frameworks, framework => {
7879
project.addFramework(
7980
framework,
8081
{ target: targetUuid }
8182
);
8283
});
84+
8385
if (configurationJson.assetcatalogCompilerAppiconName) {
84-
project.addToBuildSettings("ASSETCATALOG_COMPILER_APPICON_NAME", configurationJson.assetcatalogCompilerAppiconName, targetUuid);
86+
project.addToBuildSettings("ASSETCATALOG_COMPILER_APPICON_NAME", configurationJson.assetcatalogCompilerAppiconName, targetUuid);
87+
}
88+
89+
if (configurationJson.targetBuildConfigurationProperties) {
90+
const properties: IXcodeTargetBuildConfigurationProperty[] = [];
91+
_.forEach(configurationJson.targetBuildConfigurationProperties, (value, name: string) => properties.push({value, name}));
92+
this.setXcodeTargetBuildConfigurationProperties(properties, targetName, project);
8593
}
8694
}
8795
}

lib/services/ios-watch-app-service.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ export class IOSWatchAppService extends NativeTargetServiceBase implements IIOSW
6464

6565
private configureTarget(targetName: string, targetPath: string, identifier: string, configurationFileName: string, target: IXcode.target, project: IXcode.project) {
6666
const targetConfigurationJsonPath = path.join(targetPath, configurationFileName);
67-
this.setConfigurationsFromJsonFile(targetConfigurationJsonPath, target.uuid, project);
6867

6968
const identifierParts = identifier.split(".");
7069
identifierParts.pop();
@@ -74,10 +73,11 @@ export class IOSWatchAppService extends NativeTargetServiceBase implements IIOSW
7473
{name: "PRODUCT_BUNDLE_IDENTIFIER", value: identifier},
7574
{name: "SDKROOT", value: "watchos"},
7675
{name: "TARGETED_DEVICE_FAMILY", value: IOSDeviceTargets.watchos},
77-
{name: "WATCHOS_DEPLOYMENT_TARGET", value: 4.1}, //TODO consider WATCHOS_DEPLOYMENT_TARGET in json configuration
76+
{name: "WATCHOS_DEPLOYMENT_TARGET", value: 5.2},
7877
{name: "WK_APP_BUNDLE_IDENTIFIER", value: wkAppBundleIdentifier}
7978
], targetName, project);
8079

80+
this.setConfigurationsFromJsonFile(targetConfigurationJsonPath, target.uuid, targetName, project);
8181
project.addToHeaderSearchPaths(targetPath, target.pbxNativeTarget.productName);
8282
}
8383
}

0 commit comments

Comments
 (0)