Permalink
Browse files

Correctly handle the case where HEADER_SEARCH_PATHS is a single string

Reviewed By: ericvicenti

Differential Revision: D5519379

fbshipit-source-id: a07ea0629f98c23e1027202cc7a7957233780643
  • Loading branch information...
hramos authored and facebook-github-bot committed Aug 4, 2017
1 parent ac43548 commit 23f72a9eb9169c1a9e4873fc7acd041d4f33b1d4
@@ -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);
}
});
};

0 comments on commit 23f72a9

Please sign in to comment.