-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How do you define the target for Specific Build Settings or Adding Frameworks? #54
Comments
To note: I have added this and got the target membership on xcode of the framework correctly checked: proj.addBuildPhase( [`${custom_framework_parth}`], 'PBXCopyFilesBuildPhase', 'Embed Frameworks', extTarget.uuid); however, The Framework Search Path is left blank so the framework is not recognised on xcode compilation. |
My apologies for the lack of response. Maintainers are completely overloaded. A PR with test coverage would be much appreciated. |
that's ok, I've found a workaround by iterating through xcode product names in an // Iterate through the entire XCBuildConfig for config of the new target PRODUCT_NAME and modify it
var config = proj.hash.project.objects['XCBuildConfiguration'];
for (var ref in config) {
if (
config[ref].buildSettings !== undefined &&
config[ref].buildSettings.PRODUCT_NAME !== undefined &&
config[ref].buildSettings.PRODUCT_NAME.includes(extName)
) {
console.log(`entered the setting: ${config[ref].buildSettings.PRODUCT_NAME} of ${ref}`);
var INHERITED = '"$(inherited)"';
if (!config[ref].buildSettings['FRAMEWORK_SEARCH_PATHS'] || config[ref].buildSettings['FRAMEWORK_SEARCH_PATHS'] === INHERITED) {
proj.hash.project.objects['XCBuildConfiguration'][ref].buildSettings['FRAMEWORK_SEARCH_PATHS'] = [INHERITED];
}
// Fix issues with the framework search paths
proj.hash.project.objects['XCBuildConfiguration'][ref].buildSettings['FRAMEWORK_SEARCH_PATHS'].push(`"${customFrameworkDirectory}"`);
}
} if I figure out where this should fit into |
Thanks @adam-govan. I have a dumb question: can you explain the relationship between this issue and #47? |
not a dumb question at all! 😄 I started in the same place that #47 was working on, automating a service extension (specifically for push in my case), but I found when adding a Custom Framework to the extension that it wasn't adding to the correct target. It wasn't exactly what #47 was covering so I decided to make my own issue and detail that exactly. I hope that's ok. I can close if you don't think it's required |
I've made an App Extension with the
addTarget
function but even though I have the target defined like so :I cannot seem to define any buildProperties for it specifically. For example, the function
takes in the
property key
thevalue
and thebuild
but this will only update the main project and not any of the targets defined.The target parameter in the
addFramework
function doesn't appear to work either. When digging into thepbxfile
that it creates toaddToFrameworkSearchPaths
thetarget
is not passed or accessed in the constructor. The following code doesn't add the Framework to the target:Can somebody please point me to the right direction here? I don't know what I'm doing wrong.
The text was updated successfully, but these errors were encountered: