Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Các tập tin trong danh sách tập tin đầu vào không được thông qua cho kịch bản như các thông số, hay là các đường ống để nó thông qua stdin. Chúng được sử dụng bởi Xcode chỉ duy nhất để xác định nếu kịch bản được chạy. Đó là vào các kịch bản để đọc tập tin được liệt kê đầu vào và sản xuất tất cả các file đã hứa trong các tập tin đầu ra. | Build Rules 359 f The files in the Input Files list are not passed to the script as parameters nor are they piped to it via stdin. They are used by Xcode solely to determine if the script should be run. It is up to the shell script to read the listed Input Files and produce all of the files promised in the Output Files. If you want to reuse a script in multiple targets and need a variable list of input or output files define them in a custom build setting. BUILD RULES Build rules define the transformation of source files into their compiled results. The compiler phase uses the target s build rules to determine which compiler should be used to compile each source file. For example a build rule might specify that all C source files C C and Objective-C are compiled using the gcc compiler. A build rule applies to all the files of a specific type. The type of a file is determined by its extension or the file type assigned to that source file. A file s type is typically in agreement with the filename extensions but it doesn t have to be. You can change the file type of a . java source file to sourcecode. cpp. The Compile Sources phase will then apply the sourcecode. cpp rule to that file as if it were a C source file probably without much success. You ll probably never need to alter the build rules in Xcode. However there are several reasons why you might want to Force Xcode to use an older newer or custom compiler. Add a rule to compile a source type that is not normally compiled by Xcode. Add a pre- or post-processing script to every compilation. Define your own transformation. You can examine and alter the build rules previously shown in Figure 16-4 for a target in the target s Info window. When it comes time to compile an input file the file is tested against each rule starting from the top of the list. The first rule that matches a particular input file is the rule used to compile that file. Each target has one set of build rules shared by all of the build phases n