0

I know this is a rather trivial question, but I seem to be having the worst time with this.

I've tried :

obj =  Xcodeproj::Project::Object::PBXCopyFilesBuildPhase.new(PATH, 10)
target.build_phases.add(obj)

But the UUID is 0 and nothing is added to the Build Phases. Can someone please help me. I know the rest of my setup is correct.

gran_profaci
  • 8,087
  • 15
  • 66
  • 99

1 Answers1

1

Here's my example:

phase = target.new_copy_files_build_phase()

# Contrary to the docs (see http://www.rubydoc.info/github/CocoaPods/Xcodeproj/Xcodeproj/Project/Object/PBXCopyFilesBuildPhase) I believe this is not a path, but rather a code, e.g., 16 indicates to copy the file to the Products Directory.
phase.dst_subfolder_spec = "16"

fileRef = project.new(Xcodeproj::Project::Object::PBXFileReference)
fileRef.path = 'Server.plist'

phase.add_file_reference(fileRef)   
Chris Prince
  • 7,288
  • 2
  • 48
  • 66
  • agree with your comment, see constants documentation here: https://www.rubydoc.info/github/CocoaPods/Xcodeproj/Xcodeproj/Constants. `COPY_FILES_BUILD_PHASE_DESTINATIONS` – Stan Aug 15 '19 at 21:18