forked from alunny/node-xcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFrameworkSearchPaths.js
More file actions
46 lines (42 loc) · 1.61 KB
/
FrameworkSearchPaths.js
File metadata and controls
46 lines (42 loc) · 1.61 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
var fullProject = require('./fixtures/full-project')
fullProjectStr = JSON.stringify(fullProject),
pbx = require('../lib/pbxProject'),
pbxFile = require('../lib/pbxFile'),
proj = new pbx('.');
var pbxFile = {
path:'some/path/include',
dirname: 'some/path',
customFramework: true
}
function cleanHash() {
return JSON.parse(fullProjectStr);
}
exports.setUp = function (callback) {
proj.hash = cleanHash();
callback();
}
var PRODUCT_NAME = '"KitchenSinktablet"';
exports.addAndRemoveToFromFrameworkSearchPaths = {
'add should add the path to each configuration section':function(test) {
proj.addToFrameworkSearchPaths(pbxFile);
var config = proj.pbxXCBuildConfigurationSection();
for (var ref in config) {
if (ref.indexOf('_comment') > -1 || config[ref].buildSettings.PRODUCT_NAME != PRODUCT_NAME) continue;
var lib = config[ref].buildSettings.FRAMEWORK_SEARCH_PATHS;
test.ok(lib[1].indexOf('some/path') > -1);
}
test.done();
},
'remove should remove from the path to each configuration section':function(test) {
proj.addToFrameworkSearchPaths(pbxFile);
proj.removeFromFrameworkSearchPaths(pbxFile);
var config = proj.pbxXCBuildConfigurationSection();
for (var ref in config) {
if (ref.indexOf('_comment') > -1 || config[ref].buildSettings.PRODUCT_NAME != PRODUCT_NAME) continue;
var lib = config[ref].buildSettings.FRAMEWORK_SEARCH_PATHS;
test.ok(lib.length === 1);
test.ok(lib[0].indexOf('some/path') == -1);
}
test.done();
}
}