Skip to content

Commit 53bb98e

Browse files
Merge branch 'master' into forkChanges
# Conflicts: # package.json
2 parents 57f2a08 + 2e9a353 commit 53bb98e

File tree

4 files changed

+22
-24
lines changed

4 files changed

+22
-24
lines changed

lib/pbxFile.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,13 +171,12 @@ function pbxFile(filepath, opt) {
171171
// for custom frameworks
172172
if (opt.customFramework == true) {
173173
this.customFramework = true;
174-
this.dirname = path.dirname(filepath);
174+
this.dirname = path.dirname(filepath).replace(/\\/g, '/');
175175
}
176176

177-
this.path = defaultPath(this, filepath);
177+
this.path = defaultPath(this, filepath).replace(/\\/g, '/');
178178
this.fileEncoding = this.defaultEncoding = opt.defaultEncoding || defaultEncoding(self);
179179

180-
181180
// When referencing products / build output files
182181
if (opt.explicitFileType) {
183182
this.explicitFileType = opt.explicitFileType;

lib/pbxProject.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ pbxProject.prototype.removeFramework = function(fpath, opt) {
323323
this.removeFromPbxFrameworksBuildPhase(file); // PBXFrameworksBuildPhase
324324

325325
if (opt && opt.customFramework) {
326-
this.removeFromFrameworkSearchPaths(path.dirname(fpath));
326+
this.removeFromFrameworkSearchPaths(file);
327327
}
328328

329329
opt.embed = true;
@@ -1079,7 +1079,6 @@ pbxProject.prototype.removeFromFrameworkSearchPaths = function(file) {
10791079
searchPaths.splice(idx, 1);
10801080
});
10811081
}
1082-
10831082
}
10841083
}
10851084

test/dataModelDocument.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,8 @@ exports.dataModelDocument = {
152152
test.equal(xcVersionGroupEntry.children[0], newFile.models[0].fileRef);
153153
test.equal(xcVersionGroupEntry.currentVersion, newFile.currentModel.fileRef);
154154
test.equal(xcVersionGroupEntry.name, path.basename(singleDataModelFilePath));
155-
test.equal(xcVersionGroupEntry.path, singleDataModelFilePath);
155+
// Need to validate against normalized path, since paths should contain forward slash on OSX
156+
test.equal(xcVersionGroupEntry.path, singleDataModelFilePath.replace(/\\/g, '/'));
156157
test.equal(xcVersionGroupEntry.sourceTree, '"<group>"');
157158
test.equal(xcVersionGroupEntry.versionGroupType, 'wrapper.xcdatamodel');
158159

test/removeFramework.js

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var fullProject = require('./fixtures/full-project')
1+
var fullProject = require('./fixtures/full-project'),
22
fullProjectStr = JSON.stringify(fullProject),
33
pbx = require('../lib/pbxProject'),
44
pbxFile = require('../lib/pbxFile'),
@@ -47,22 +47,22 @@ exports.removeFramework = {
4747
var newFile = proj.addFramework('libsqlite3.dylib');
4848

4949
test.equal(newFile.constructor, pbxFile);
50-
50+
5151
var deletedFile = proj.removeFramework('libsqlite3.dylib');
5252

5353
test.equal(deletedFile.constructor, pbxFile);
54-
54+
5555
test.done()
5656
},
5757
'should set a fileRef on the pbxFile': function (test) {
5858
var newFile = proj.addFramework('libsqlite3.dylib');
5959

6060
test.ok(newFile.fileRef);
61-
61+
6262
var deletedFile = proj.removeFramework('libsqlite3.dylib');
6363

6464
test.ok(deletedFile.fileRef);
65-
65+
6666
test.done()
6767
},
6868
'should remove 2 fields from the PBXFileReference section': function (test) {
@@ -80,7 +80,7 @@ exports.removeFramework = {
8080
test.equal(66, frsLength);
8181
test.ok(!fileRefSection[deletedFile.fileRef]);
8282
test.ok(!fileRefSection[deletedFile.fileRef + '_comment']);
83-
83+
8484
test.done();
8585
},
8686
'should remove 2 fields from the PBXBuildFile section': function (test) {
@@ -93,13 +93,13 @@ exports.removeFramework = {
9393
test.ok(buildFileSection[newFile.uuid + '_comment']);
9494

9595
var deletedFile = proj.removeFramework('libsqlite3.dylib');
96-
96+
9797
bfsLength = Object.keys(buildFileSection).length;
9898

9999
test.equal(58, bfsLength);
100100
test.ok(!buildFileSection[deletedFile.uuid]);
101101
test.ok(!buildFileSection[deletedFile.uuid + '_comment']);
102-
102+
103103
test.done();
104104
},
105105
'should remove from the Frameworks PBXGroup': function (test) {
@@ -108,47 +108,46 @@ exports.removeFramework = {
108108
frameworks = proj.pbxGroupByName('Frameworks');
109109

110110
test.equal(frameworks.children.length, newLength);
111-
111+
112112
var deletedFile = proj.removeFramework('libsqlite3.dylib'),
113113
newLength = newLength - 1;
114114

115115
test.equal(frameworks.children.length, newLength);
116-
116+
117117
test.done();
118118
},
119119
'should remove from the PBXFrameworksBuildPhase': function (test) {
120120
var newFile = proj.addFramework('libsqlite3.dylib'),
121121
frameworks = proj.pbxFrameworksBuildPhaseObj();
122122

123123
test.equal(frameworks.files.length, 16);
124-
124+
125125
var deletedFile = proj.removeFramework('libsqlite3.dylib'),
126126
frameworks = proj.pbxFrameworksBuildPhaseObj();
127127

128128
test.equal(frameworks.files.length, 15);
129-
129+
130130
test.done();
131131
},
132132
'should remove custom frameworks': function (test) {
133-
var newFile = proj.addFramework('/path/to/Custom.framework'),
133+
var newFile = proj.addFramework('/path/to/Custom.framework', { customFramework: true }),
134134
frameworks = proj.pbxFrameworksBuildPhaseObj();
135135

136136
test.equal(frameworks.files.length, 16);
137-
138-
var deletedFile = proj.removeFramework('/path/to/Custom.framework'),
137+
138+
var deletedFile = proj.removeFramework('/path/to/Custom.framework', { customFramework: true }),
139139
frameworks = proj.pbxFrameworksBuildPhaseObj();
140140

141141
test.equal(frameworks.files.length, 15);
142-
142+
143143
var frameworkPaths = frameworkSearchPaths(proj);
144144
expectedPath = '"/path/to"';
145145

146146
for (i = 0; i < frameworkPaths.length; i++) {
147147
var current = frameworkPaths[i];
148-
test.ok(current.indexOf('"$(inherited)"') == -1);
149148
test.ok(current.indexOf(expectedPath) == -1);
150149
}
151-
150+
152151
test.done();
153152
}
154153
}

0 commit comments

Comments
 (0)