Correctly handle the case where HEADER_SEARCH_PATHS is a single string
Reviewed By: ericvicenti Differential Revision: D5519379 fbshipit-source-id: a07ea0629f98c23e1027202cc7a7957233780643
This commit is contained in:
parent
ac43548063
commit
23f72a9eb9
|
@ -877,9 +877,7 @@
|
|||
);
|
||||
PRODUCT_NAME = Basic;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
);
|
||||
HEADER_SEARCH_PATHS = "$(inherited)";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
|
@ -897,9 +895,7 @@
|
|||
);
|
||||
PRODUCT_NAME = Basic;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
);
|
||||
HEADER_SEARCH_PATHS = "$(inherited)";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
|
|
|
@ -23,4 +23,15 @@ describe('ios::mapHeaderSearchPaths', () => {
|
|||
|
||||
expect(callback.mock.calls.length).toBe(2);
|
||||
});
|
||||
|
||||
it('calls the function with an array of paths, given a project with one', () => {
|
||||
const callback = jest.fn();
|
||||
mapHeaderSearchPaths(project, callback);
|
||||
|
||||
const paths = callback.mock.calls[0][0];
|
||||
|
||||
expect(paths instanceof Array).toBe(true);
|
||||
expect(paths.length).toBe(1);
|
||||
expect(paths[0]).toBe('"$(inherited)"');
|
||||
});
|
||||
});
|
||||
|
|
|
@ -31,9 +31,11 @@ module.exports = function headerSearchPathIter(project, func) {
|
|||
.indexOf('"-lc++"') >= 0;
|
||||
|
||||
if (shouldVisitBuildSettings) {
|
||||
buildSettings.HEADER_SEARCH_PATHS = func(
|
||||
buildSettings.HEADER_SEARCH_PATHS || defaultHeaderPaths
|
||||
);
|
||||
const searchPaths = buildSettings.HEADER_SEARCH_PATHS ?
|
||||
[].concat(buildSettings.HEADER_SEARCH_PATHS) :
|
||||
defaultHeaderPaths;
|
||||
|
||||
buildSettings.HEADER_SEARCH_PATHS = func(searchPaths);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue