Created
February 26, 2013 02:29
-
-
Save larryaasen/5035313 to your computer and use it in GitHub Desktop.
Using the Xcodeproj Ruby Gem - open exising Xcode project, add a file to the project in the main group, add the file to the main target, and save the Xcode project file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Open the existing Xcode project | |
project_file = product_name + '.xcodeproj' | |
project = Xcodeproj::Project.new(project_file) | |
# Add a file to the project in the main group | |
file_name = 'Message.m' | |
group_name = product_name | |
file = project.new_file(file_name, group_name) | |
# Add the file to the main target | |
main_target = project.targets.first | |
main_target.add_file_references([file]) | |
# Save the project file | |
project.save_as(project_file) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi! How can I list all files/frameworks that were added to existed project?