ios项目,都会有一个名为project.pbxproj的文件,这里面保存了项目的基本配置,例如你的项目有几个target,用什么证书之类。
笔者之前因项目需要,需要从这个文件中读取target、configuration等信息,本来想自己写程序实现。后来发现在github上面,已经有人实现了。用起来比较方便,不敢独享,在此分享。
一、用途(示例代码)
/*
* #%L
* xcode-project-reader
* %%
* Copyright (C) 2012 SAP AG
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
package com.sap.prd