How to add a build phase in a project template?

后端 未结 2 995
自闭症患者
自闭症患者 2021-02-01 10:54

I\'m trying to add a Run Script Build Phase to a target in a custom Project Template for Xcode 4.

Does anyone have any examples, tutorials, or tips on how to do this?

2条回答
  •  渐次进展
    2021-02-01 11:32

    To answer to @Paulo Faria question, I found a way to add input and output files to a Run script phase (My template uses R.swift, which requires input and output files):

    Targets
    
        
            BuildPhases
            
                
                    Class
                    ShellScript
                    ShellPath
                    /bin/sh
                    Name
                    R.swift
                    ShellScript
                    "$PODS_ROOT/R.swift/rswift" generate "$SRCROOT/R.generated.swift"
                    InputFiles
                    
                        $TEMP_DIR/rswift-lastrun
                    
                    OutputFiles
                    
                        $SRCROOT/R.generated.swift
                    
                
            
        
    
    

提交回复
热议问题