Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

*.pbxproj eol=lf
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:

strategy:
matrix:
os: [ubuntu-latest, macos-26]
os: [windows-latest, ubuntu-latest, macos-26]
# The "--test-coverage-exclude" flag is supported in v22.5.0 and later.
# By default, all matching test files are excluded from the coverage report.
# Only Node.js 22.x requires explicitly declaring test file exclusions.
Expand Down Expand Up @@ -100,6 +100,7 @@ jobs:
NODE_OPTIONS: ${{ matrix.node.options }}

- name: Check for uncommitted changes
if: ${{ ! startsWith(matrix.os, 'windows') }}
run: |
if ! git diff --exit-code; then
echo ""
Expand Down
2 changes: 1 addition & 1 deletion lib/pbxFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ function defaultPath (fileRef, filePath) {
}

if (defaultPath) {
return path.join(defaultPath, path.basename(filePath));
return path.posix.join(defaultPath, path.basename(filePath));
}

return filePath;
Expand Down
8 changes: 4 additions & 4 deletions lib/pbxProject.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function PBXProject (filename) {
util.inherits(PBXProject, EventEmitter);

PBXProject.prototype.parse = function (cb) {
const worker = fork(path.join(__dirname, '/parseJob.js'), [this.filepath]);
const worker = fork(path.join(__dirname, 'parseJob.js'), [this.filepath]);

worker.on('message', function (msg) {
if (msg.name === 'SyntaxError' || msg.code) {
Expand Down Expand Up @@ -1392,7 +1392,7 @@ PBXProject.prototype.addTarget = function (name, type, subfolder, bundleId) {
// Setup uuid and name of new target
const targetUuid = this.generateUuid();
const targetType = type;
const targetSubfolder = subfolder || name;
const targetSubfolder = (subfolder || name).replace(/\\/g, '/');
const targetName = name.trim();
const targetBundleId = bundleId;

Expand All @@ -1418,7 +1418,7 @@ PBXProject.prototype.addTarget = function (name, type, subfolder, bundleId) {
isa: 'XCBuildConfiguration',
buildSettings: {
GCC_PREPROCESSOR_DEFINITIONS: ['"DEBUG=1"', '"$(inherited)"'],
INFOPLIST_FILE: '"' + path.join(targetSubfolder, targetSubfolder + '-Info.plist' + '"'),
INFOPLIST_FILE: '"' + path.posix.join(targetSubfolder, targetSubfolder + '-Info.plist' + '"'),
LD_RUNPATH_SEARCH_PATHS: '"$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"',
PRODUCT_NAME: '"' + targetName + '"',
SKIP_INSTALL: 'YES'
Expand All @@ -1428,7 +1428,7 @@ PBXProject.prototype.addTarget = function (name, type, subfolder, bundleId) {
name: 'Release',
isa: 'XCBuildConfiguration',
buildSettings: {
INFOPLIST_FILE: '"' + path.join(targetSubfolder, targetSubfolder + '-Info.plist' + '"'),
INFOPLIST_FILE: '"' + path.posix.join(targetSubfolder, targetSubfolder + '-Info.plist' + '"'),
LD_RUNPATH_SEARCH_PATHS: '"$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"',
PRODUCT_NAME: '"' + targetName + '"',
SKIP_INSTALL: 'YES'
Expand Down
4 changes: 2 additions & 2 deletions test/dataModelDocument.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ const path = require('node:path');
const PBXProject = require('../lib/pbxProject');
const PBXFile = require('../lib/pbxFile');
const proj = new PBXProject('.');
const singleDataModelFilePath = path.join(__dirname, '/fixtures/single-data-model.xcdatamodeld');
const multipleDataModelFilePath = path.join(__dirname, '/fixtures/multiple-data-model.xcdatamodeld');
const singleDataModelFilePath = path.join(__dirname, 'fixtures', 'single-data-model.xcdatamodeld');
const multipleDataModelFilePath = path.join(__dirname, 'fixtures', 'multiple-data-model.xcdatamodeld');

function cleanHash () {
return JSON.parse(fullProjectStr);
Expand Down
Loading