apache / apache/cordova-node-xcode

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

Đang mở
#54 5 bình luận 0 reaction 0 người được giao Xem trên GitHub
enhancement help wanted support
Ngôn ngữ chính
JavaScript
Star
217
Fork
102
Merge trung bình
2 ngày 3 giờ
Pull request đã merge (30 ngày)
6

Mô tả

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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu bằng cách lần theo pbxProject.prototype.updateBuildProperty và addFramework, bao gồm cả đường dẫn pbxfile/addToFrameworkSearchPaths, sử dụng extTarget.uuid được nêu trong báo cáo. Hoàn tất nghĩa là các thuộc tính build và framework tùy chỉnh được áp dụng cho target app-extension được thêm vào, thay vì chỉ áp dụng cho project chính.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
javascript, nodejs
Lĩnh vực
build-system, mobile, tooling
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.