42 lines
1.0 KiB
Ruby
42 lines
1.0 KiB
Ruby
#!/usr/bin/env ruby
|
|
require 'xcodeproj'
|
|
|
|
project_path = 'jellypig.xcodeproj'
|
|
project = Xcodeproj::Project.open(project_path)
|
|
|
|
# Find the main target
|
|
target = project.targets.find { |t| t.name == 'jellypig tvOS' }
|
|
|
|
# File names to remove
|
|
file_names = [
|
|
'EPGViewModel.swift',
|
|
'EPGProgramCell.swift',
|
|
'EPGChannelRow.swift',
|
|
'EPGTimelineHeader.swift',
|
|
'EPGCurrentTimeIndicator.swift'
|
|
]
|
|
|
|
file_names.each do |file_name|
|
|
# Find and remove from all groups
|
|
project.main_group.recursive_children.each do |child|
|
|
if child.is_a?(Xcodeproj::Project::Object::PBXFileReference) && child.path == file_name
|
|
# Remove from build phase
|
|
target.source_build_phase.files.each do |build_file|
|
|
if build_file.file_ref == child
|
|
target.source_build_phase.files.delete(build_file)
|
|
puts "Removed from build phase: #{file_name}"
|
|
end
|
|
end
|
|
|
|
# Remove file reference
|
|
child.remove_from_project
|
|
puts "Removed reference: #{file_name}"
|
|
end
|
|
end
|
|
end
|
|
|
|
# Save the project
|
|
project.save
|
|
|
|
puts "\nCleanup completed!"
|