Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Issue] Remove file by file reference in project #132

Closed
lolgear opened this issue Mar 6, 2014 · 3 comments
Closed

[Issue] Remove file by file reference in project #132

lolgear opened this issue Mar 6, 2014 · 3 comments

Comments

@lolgear
Copy link

@lolgear lolgear commented Mar 6, 2014

I didn't find any method for operation "remove file".

Could you add it or point at an existing function?

@alloy alloy closed this Mar 6, 2014
@lolgear
Copy link
Author

@lolgear lolgear commented Mar 6, 2014

I can't understand how to use them.
I found a 'remove_from_project' object's function, but If I try to use it on '.m' file, I catch error:
can't remove file, because PBXBuildFile reference to it.

@lolgear
Copy link
Author

@lolgear lolgear commented Mar 6, 2014

I try to use something like this:

'open xcode project
xcodeproj_object = Xcodeproj::Project.open(path_to_project)

'find files that I want to remove and put them in array:

files_to_be_removed = ... # Array

files_to_be_removed.each{ |file|
xcodeproj_object.files.delete(file)
'or file.remove_from_project() - fails on .m file type
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants