apache / apache/cordova-node-xcode

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

オープン
#54 コメント 5 件 リアクション 0 件 担当者 0 名 GitHub で見る
enhancement help wanted support
主要言語
JavaScript
スター
217
フォーク
102
平均マージ
2日 3時間
マージ済み PR(30日)
6

説明

I've made an App Extension with the `addTarget` function but even though I have the target defined like so :
```javascript
// (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
```javascript
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:

```javascript
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.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

まず、レポートに示されている extTarget.uuid を使用して、pbxProject.prototype.updateBuildProperty と addFramework を、pbxfile/addToFrameworkSearchPaths の経路も含めて追跡します。完了の条件は、ビルドプロパティとカスタムフレームワークがメインプロジェクトだけでなく、追加された app-extension ターゲットに適用されることです。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript, nodejs
領域
build-system, mobile, tooling
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。