addFileToProject.js 1007 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = addFileToProject;
  6. function _pbxFile() {
  7. const data = _interopRequireDefault(require("xcode/lib/pbxFile"));
  8. _pbxFile = function () {
  9. return data;
  10. };
  11. return data;
  12. }
  13. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  14. /**
  15. * Copyright (c) Facebook, Inc. and its affiliates.
  16. *
  17. * This source code is licensed under the MIT license found in the
  18. * LICENSE file in the root directory of this source tree.
  19. *
  20. */
  21. /**
  22. * Given xcodeproj and filePath, it creates new file
  23. * from path provided, adds it to the project
  24. * and returns newly created instance of a file
  25. */
  26. function addFileToProject(project, filePath) {
  27. const file = new (_pbxFile().default)(filePath);
  28. file.uuid = project.generateUuid();
  29. file.fileRef = project.generateUuid();
  30. project.addToPbxFileReferenceSection(file);
  31. return file;
  32. }
  33. //# sourceMappingURL=addFileToProject.js.map