Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

How do you define the target for Specific Build Settings or Adding Frameworks?

Open
#54 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript, nodejs

Research direction

Start by tracing pbxProject.prototype.updateBuildProperty and addFramework, including the pbxfile/addToFrameworkSearchPaths path, using the extTarget.uuid shown in the report. Done means build properties and the custom framework are applied to the added app-extension target rather than only the main project.

Written by the indexing model from the issue text.

Description

enhancement help wanted support

I've made an App Extension with the addTarget function but even though I have the target defined like so :

// (some global paths deliberately left out but they all point correctly)
    var extFiles = [
        'NotificationService.h',
        'NotificationService.m',
        `${extName}-Info.plist`,
        'appgroupconfig.json',
        'PushExtension.entitlements',
    ];

        const proj = xcode.project(projPath);
        proj.parseSync();

        // Copy in the extension files
        fs.mkdirSync(`${iosPath}${extName}`);
        extFiles.forEach(function (extFile) {
            let targetFile = `${iosPath}${extName}/${extFile}`;
            fs.createReadStream(`${sourceDir}${extFile}`)
                .pipe(fs.createWriteStream(targetFile));
        });
        
        // Add a target for the extension
        let extTarget = proj.addTarget(extName, 'app_extension');

I cannot seem to define any buildProperties for it specifically. For example, the function

pbxProject.prototype.updateBuildProperty = function(prop, value, build)

takes in the property key the value and the build 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 the pbxfile that it creates to addToFrameworkSearchPaths the target is not passed or accessed in the constructor. The following code doesn't add the Framework to the target:

var opt = {target: extTarget.uuid, embed: true, customFramework: true, sign: true}
proj.addFramework(`${custom_framework_path}`, opt);

Can somebody please point me to the right direction here? I don't know what I'm doing wrong.

Dominant language
JavaScript
Stars
217
Forks
102
Avg merge
2d 9h
Merged PRs (30d)
8

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/cordova-node-xcode

All issues in apache/cordova-node-xcode

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.