Sha256: 8137b0281ce4294e0e0aa61f8ed7eb310c2f913d7ea8f4913694c4a4125b3d87

Contents?: true

Size: 692 Bytes

Versions: 9

Compression:

Stored size: 692 Bytes

Contents

require 'xcodeproject/node'

module XcodeProject
	class PBXBuildFile < Node
		attr_reader :file_ref

		def initialize (root, uuid, data)
			super(root, uuid, data)

			@file_ref = data['fileRef']
		end

		def file_ref
			root.object!(@file_ref)
		end

		def remove!
			root.project.targets.each {|target| target.remove_source(self) }
			root.remove_object(uuid)
		end

		def self.add(root, file_ref_uuid)
			uuid, data = root.add_object(self.create_object_hash(file_ref_uuid)) 
			self.new(root, uuid, data)
		end

	private

		def self.create_object_hash (file_ref_uuid)
			data = []
			data << ['isa', 'PBXBuildFile']
			data << ['fileRef', file_ref_uuid]
			
			Hash[ data ]
		end
	end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
xcodeproject-0.3.10 lib/xcodeproject/pbx_build_file.rb
xcodeproject-0.3.9 lib/xcodeproject/pbx_build_file.rb
xcodeproject-0.3.8 lib/xcodeproject/pbx_build_file.rb
xcodeproject-0.3.6 lib/xcodeproject/pbx_build_file.rb
xcodeproject-0.3.5 lib/xcodeproject/pbx_build_file.rb
xcodeproject-0.3.1 lib/xcodeproject/pbx_build_file.rb
xcodeproject-0.3.0 lib/xcodeproject/pbx_build_file.rb
xcodeproject-0.2.4 lib/xcodeproject/pbx_build_file.rb
xcodeproject-0.2.3 lib/xcodeproject/pbx_build_file.rb