Comments (6)
The answer is
result = XCodeProject.add_file(...)
for item in result:
``if isinstance(item, PBXBuildFile): item.add_compiler_flag(...)
from mod-pbxproj.
Thanks, i didn't have time to check this in detail.
I'll update the Readme to include this kind of common tasks.
from mod-pbxproj.
I'm still not sure how to do this for files that are already in the project rather than ones I'm trying to add. Also, this was never added to the readme. :)
from mod-pbxproj.
OK I figured it out, here's an example for others:
def disableArc(filePath):
fileId = project.get_file_id_by_path(filePath)
files = project.get_build_files(fileId)
for f in files:
f.add_compiler_flag('-fno-objc-arc')
disableArc('Libraries/Plugins/iOS/JSONKit.m')
from mod-pbxproj.
Cool you figure it out! Could i ask you to make a PR with the snippet on
the readme? XD
On Dec 16, 2015 8:12 PM, "Eliot Lash" [email protected] wrote:
OK I figured it out, here's an example for others:
def disableArc(filePath):
fileId = project.get_file_id_by_path(filePath)
files = project.get_build_files(fileId)
for f in files:
f.add_compiler_flag('-fno-objc-arc')disableArc('Libraries/Plugins/iOS/JSONKit.m')
—
Reply to this email directly or view it on GitHub
#27 (comment)
.
from mod-pbxproj.
Done: #82
from mod-pbxproj.
Related Issues (20)
- again How to add one framework just want to build it output as a framework with my main proj HOT 2
- [BUG]When I use setup.py to install pbxproj module syntax error occured. HOT 1
- conda forge package HOT 2
- [FEAT] How to add sub-project into current project, but sub-project has two kinds of target type
- [BUG] This one project loads but doesn't save HOT 2
- Moving an existing group to another group HOT 2
- update flag HOT 1
- [BUG] Update multible Flags HOT 2
- [FEAT] Can I change setting on Build Settings > Signing HOT 1
- [FEAT] How do you get a flag value ? HOT 1
- [FEAT]Can I find my favorite books at will?
- Referencing files into UnityFramework
- File or folder association settings
- add_package [BUG]
- remove a file with fileID HOT 1
- [BUG] Local package XCLocalSwiftPackageReference is not getting parsed properly HOT 1
- [BUG] Build steps that have shell commands lose formatting when project is saved
- [FEAT] add flag with null value
- Cannot create subfolders HOT 2
- [BUG] Exception is thrown when finding `productRef` instead of `fileRef`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mod-pbxproj.