forked from fealebenpae/node-xcode
-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathxcode5searchPaths.js
More file actions
58 lines (45 loc) · 1.77 KB
/
xcode5searchPaths.js
File metadata and controls
58 lines (45 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
var xcode5proj = require('./fixtures/library-search-paths')
xcode5projStr = JSON.stringify(xcode5proj),
pbx = require('../lib/pbxProject'),
pbxFile = require('../lib/pbxFile'),
proj = new pbx('.'),
libPoop = { path: 'some/path/poop.a' };
function cleanHash() {
return JSON.parse(xcode5projStr);
}
exports.setUp = function (callback) {
proj.hash = cleanHash();
callback();
}
var PRODUCT_NAME = '"$(TARGET_NAME)"';
exports.addAndRemoveToFromLibrarySearchPaths = {
'add should add the path to each configuration section':function(test) {
var expected = '"\\"$(SRCROOT)/$(TARGET_NAME)/some/path\\""',
config = proj.pbxXCBuildConfigurationSection(),
ref, lib, refSettings;
proj.addToLibrarySearchPaths(libPoop);
for (ref in config) {
if (ref.indexOf('_comment') > -1)
continue;
refSettings = config[ref].buildSettings;
if (refSettings.PRODUCT_NAME != PRODUCT_NAME)
continue;
lib = refSettings.LIBRARY_SEARCH_PATHS;
test.equal(lib[1], expected);
}
test.done();
},
'remove should remove from the path to each configuration section':function(test) {
var config, ref, lib;
proj.addToLibrarySearchPaths(libPoop);
proj.removeFromLibrarySearchPaths(libPoop);
config = proj.pbxXCBuildConfigurationSection();
for (ref in config) {
if (ref.indexOf('_comment') > -1 || config[ref].buildSettings.PRODUCT_NAME != PRODUCT_NAME) continue;
lib = config[ref].buildSettings.LIBRARY_SEARCH_PATHS;
test.ok(lib.length === 1);
test.ok(lib[0].indexOf('$(SRCROOT)/KitchenSinktablet/some/path') == -1);
}
test.done();
}
}