Skip to content

Commit

Permalink
feat(extensions): allow seperate release/debug build configuration (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jcassidyav authored Jul 18, 2023
1 parent eb91801 commit fdcc98e
Showing 1 changed file with 39 additions and 6 deletions.
45 changes: 39 additions & 6 deletions lib/services/ios-native-target-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import { injector } from "../common/yok";
export class IOSNativeTargetService implements IIOSNativeTargetService {
constructor(
protected $fs: IFileSystem,
protected $pbxprojDomXcode: IPbxprojDomXcode
protected $pbxprojDomXcode: IPbxprojDomXcode,
protected $logger: ILogger
) {}

public addTargetToProject(
Expand Down Expand Up @@ -141,19 +142,51 @@ export class IOSNativeTargetService implements IIOSNativeTargetService {
targetUuid
);
}
const properties: IXcodeTargetBuildConfigurationProperty[] = [];

// Set for both release and debug
if (configurationJson.targetBuildConfigurationProperties) {
const properties: IXcodeTargetBuildConfigurationProperty[] = [];
_.forEach(
configurationJson.targetBuildConfigurationProperties,
(value, name: string) => properties.push({ value, name })
);
this.setXcodeTargetBuildConfigurationProperties(
properties,
targetName,
project
}

if (configurationJson.targetNamedBuildConfigurationProperties) {
_.forEach(
configurationJson.targetNamedBuildConfigurationProperties,
(value, name: string) => {
var buildName: BuildNames = null;
switch (name) {
case "debug": {
buildName = BuildNames.debug;
break;
}
case "release": {
buildName = BuildNames.release;
break;
}
default: {
this.$logger.warn(
"Ignoring targetNamedBuildConfigurationProperties: %s. Only 'release', 'debug' are allowed.",
name
);
}
}
if (buildName) {
_.forEach(value, (value, name: string) =>
properties.push({ value, name, buildNames: [buildName] })
);
}
}
);
}

this.setXcodeTargetBuildConfigurationProperties(
properties,
targetName,
project
);
}
}
}
Expand Down

0 comments on commit fdcc98e

Please sign in to comment.