public class XCodeProject extends Object
| Constructor and Description |
|---|
XCodeProject(String projectPath)
The constructor to construct a representation of the .pbxproj file of the .xcodeproj file
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAppleScriptBuildPhase(String targetIdentifier,
PBXBuildPhase buildPhase)
Add an apple script build phase to the project.
|
void |
addCopyFilesBuildPhase(String targetIdentifier,
PBXBuildPhase buildPhase)
Add a copy files build phase to the project.
|
void |
addFrameworksBuildPhase(String targetIdentifier,
PBXBuildPhase buildPhase)
Add a frameworks build phase to the project.
|
void |
addHeadersBuildPhase(String targetIdentifier,
PBXBuildPhase buildPhase)
Add a headers build phase to the project.
|
void |
addResourcesBuildPhase(String targetIdentifier,
PBXBuildPhase buildPhase)
Add a resources build phase to the project.
|
void |
addShellScriptBuildPhase(String targetIdentifier,
PBXBuildPhase buildPhase)
Add a shell script build phase to the project.
|
void |
addSourcesBuildPhase(String targetIdentifier,
PBXBuildPhase buildPhase)
Add a sources build phase to the project.
|
PBXBuildFile |
createBuildFileFromFileReferencePath(String filePath)
This will create a build file from the file reference that is specified by the file references file path.
|
PBXBuildFile |
createBuildFileFromFileReferencePath(String filePath,
String buildFileName)
This will create a build file from the file reference that is specified by the file references file path.
|
PBXFileElement |
createFileReference(String filePath)
Method to add a file reference to the project file.
|
PBXFileElement |
createFileReference(String filePath,
String sourceTree)
Method to add a file reference to the project file.
|
PBXFileElement |
createGroup(String groupName)
This will create an empty group in the project file.
|
PBXFileElement |
createGroup(String groupName,
List<CommentedIdentifier> groupChildren,
String parentGroup)
This will create a group in the project file.
|
PBXFileElement |
createGroup(String groupName,
String parentGroup)
This will create an empty group in the project file.
|
PBXTarget |
getAggregateTargetWithIdentifier(String identifier)
Gets the aggregate target with a matching identifier from the PBXAggregateTarget section.
|
PBXBuildPhase |
getAppleScriptBuildPhaseWithIdentifier(String identifier)
Get the apple script build phase for the provided identifier.
|
String |
getBuildConfigurationProperty(String buildConfigurationIdentifier,
String key)
Get the value for 'key' in the build configuration specified by the identifier.
|
List<String> |
getBuildConfigurationPropertyAsList(String buildConfigurationIdentifier,
String key)
Get the value for 'key' in the build configuration specified by the identifier as a list.
|
XCBuildConfiguration |
getBuildConfigurationWithIdentifier(String identifier)
Gets the build configuration with a matching identifier from the XCBuildConfiguration section.
|
List<PBXBuildFile> |
getBuildFileWithFileRef(String fileRef)
Gets the build file with a matching file reference from the PBXBuildFile section.
|
List<PBXBuildFile> |
getBuildFileWithFileRefPath(String fileRefPath)
Gets the build file that matches the file reference with the specified path.
|
PBXBuildFile |
getBuildFileWithIdentifier(String identifier)
Gets the build file with a matching identifier from the PBXBuildFile section.
|
XCConfigurationList |
getConfigurationListWithIdentifier(String identifier)
Gets the configuration list with a matching identifier from the XCConfigurationList section.
|
PBXBuildPhase |
getCopyFilesBuildPhaseWithIdentifier(String identifier)
Get the copy files build phase for the provided identifier.
|
PBXFileElement |
getFileReferenceWithPath(String fileRefPath)
Gets the file references that matches the path in the PBXFileReference section.
|
PBXBuildPhase |
getFrameworksBuildPhaseWithIdentifier(String identifier)
Get the frameworks build phase for the provided identifier.
|
PBXFileElement |
getGroupWithIdentifier(String identifier)
Gets the group with a matching identifier from the PBXGroup section.
|
PBXBuildPhase |
getHeadersBuildPhaseWithIdentifier(String identifier)
Get the headers build phase for the provided identifier.
|
PBXTarget |
getLegacyTargetWithIdentifier(String identifier)
Gets the legacy taget with a matching identifier from the PBXLegacyTarget section.
|
PBXTarget |
getNativeTargetWithIdentifier(String identifier)
Gets the native target with a matching identifier from the PBXNativeTarget section.
|
PBXBuildPhase |
getResourcesBuildPhaseWithIdentifier(String identifier)
Get the resources build phase for the provided identifier.
|
PBXBuildPhase |
getShellScriptBuildPhaseWithIdentifier(String identifier)
Get the shell script build phase for the provided identifier.
|
PBXBuildPhase |
getSourcesBuildPhaseWithIdentifier(String identifier)
Get the sources build phase for the provided identifier.
|
PBXFileElement |
getVariantGroupWithIdentifier(String identifier)
Gets the variant group with a matching identifier from the PBXVariantGroup section.
|
void |
removeAppleScriptBuildPhaseWithIdentifier(String identifier)
Remove the build phase with the provided identifier from the apple scripts build phase section
|
void |
removeCopyFilesBuildPhaseWithIdentifier(String identifier)
Remove the build phase with the provided identifier from the copy files build phase section
|
void |
removeFrameworksBuildPhaseWithIdentifier(String identifier)
Remove the build phase with the provided identifier from the frameworks build phase section
|
void |
removeHeadersBuildPhaseWithIdentifier(String identifier)
Remove the build phase with the provided identifier from the headers build phase section
|
void |
removeResourcesBuildPhaseWithIdentifier(String identifier)
Remove the build phase with the provided identifier from the resources build phase section
|
void |
removeShellScriptBuildPhaseWithIdentifier(String identifier)
Remove the build phase with the provided identifier from the shell scripts build phase section
|
void |
removeSourcesBuildPhaseWithIdentifier(String identifier)
Remove the build phase with the provided identifier from the sources build phase section
|
void |
setBuildConfigurationProperty(String buildConfigurationIdentifier,
String key,
List<String> values)
Adds or updates the value of 'key' to 'value' in the build configuration specified by the identifier.
|
void |
setBuildConfigurationProperty(String buildConfigurationIdentifier,
String key,
String value)
Adds or updates the value of 'key' to 'value' in the build configuration specified by the identifier.
|
String |
toString() |
public Integer archiveVersion
public Integer objectVersion
public List<PBXBuildFile> buildFiles
public PBXContainerItemProxy containerItemProxy
public List<PBXFileElement> fileReferences
public List<PBXBuildPhase> frameworksBuildPhases
public List<PBXFileElement> groups
public PBXProject project
public List<PBXBuildPhase> resourcesBuildPhases
public List<PBXBuildPhase> sourcesBuildPhases
public PBXTargetDependency targetDependency
public List<PBXFileElement> variantGroups
public List<XCBuildConfiguration> buildConfigurations
public List<XCConfigurationList> configurationLists
public List<PBXBuildPhase> appleScriptBuildPhases
public List<PBXBuildPhase> copyFilesBuildPhases
public List<PBXBuildPhase> headersBuildPhases
public List<PBXBuildPhase> shellScriptBuildPhases
public CommentedIdentifier rootObject
public XCodeProject(String projectPath) throws InvalidObjectFormatException
projectPath - A path to your .xcodeproj or .pbxproj file.InvalidObjectFormatException - If something in the project file isn't formatted correctly.public PBXFileElement createFileReference(String filePath)
filePath - The path to the file you want to add (including the file name).public PBXFileElement createFileReference(String filePath, String sourceTree)
filePath - The path to the file you want to add (including the file name).sourceTree - The source tree where the file is located. Usually will be "public PBXBuildFile createBuildFileFromFileReferencePath(String filePath) throws FileReferenceDoesNotExistException
filePath - The file path of the file reference.FileReferenceDoesNotExistException - If there is no file reference for the file path.public PBXBuildFile createBuildFileFromFileReferencePath(String filePath, String buildFileName) throws FileReferenceDoesNotExistException
filePath - The file path of the file reference.buildFileName - The name that will be in the comments for the build file.FileReferenceDoesNotExistException - If there is no file reference for the file path.public PBXFileElement createGroup(String groupName)
groupName - The name of the group.public PBXFileElement createGroup(String groupName, String parentGroup)
groupName - The name of the group.parentGroup - The base group that the group will be included in.public PBXFileElement createGroup(String groupName, List<CommentedIdentifier> groupChildren, String parentGroup)
groupName - The name of the group.groupChildren - The identifiers and comments that will be in the group.parentGroup - The base group that the group will be included in.public void addAppleScriptBuildPhase(String targetIdentifier, PBXBuildPhase buildPhase)
targetIdentifier - The identifier of the target you want to add the build phase to.buildPhase - The object representing the build phase.public void addCopyFilesBuildPhase(String targetIdentifier, PBXBuildPhase buildPhase)
targetIdentifier - The identifier of the target you want to add the build phase to.buildPhase - The object representing the build phase.public void addFrameworksBuildPhase(String targetIdentifier, PBXBuildPhase buildPhase)
targetIdentifier - The identifier of the target you want to add the build phase to.buildPhase - The object representing the build phase.public void addHeadersBuildPhase(String targetIdentifier, PBXBuildPhase buildPhase)
targetIdentifier - The identifier of the target you want to add the build phase to.buildPhase - The object representing the build phase.public void addResourcesBuildPhase(String targetIdentifier, PBXBuildPhase buildPhase)
targetIdentifier - The identifier of the target you want to add the build phase to.buildPhase - The object representing the build phase.public void addShellScriptBuildPhase(String targetIdentifier, PBXBuildPhase buildPhase)
targetIdentifier - The identifier of the target you want to add the build phase to.buildPhase - The object representing the build phase.public void addSourcesBuildPhase(String targetIdentifier, PBXBuildPhase buildPhase)
targetIdentifier - The identifier of the target you want to add the build phase to.buildPhase - The object representing the build phase.public PBXBuildPhase getAppleScriptBuildPhaseWithIdentifier(String identifier)
identifier - The identifier that is used to identify the build phase.public PBXBuildPhase getCopyFilesBuildPhaseWithIdentifier(String identifier)
identifier - The identifier that is used to identify the build phase.public PBXBuildPhase getFrameworksBuildPhaseWithIdentifier(String identifier)
identifier - The identifier that is used to identify the build phase.public PBXBuildPhase getHeadersBuildPhaseWithIdentifier(String identifier)
identifier - The identifier that is used to identify the build phase.public PBXBuildPhase getResourcesBuildPhaseWithIdentifier(String identifier)
identifier - The identifier that is used to identify the build phase.public PBXBuildPhase getShellScriptBuildPhaseWithIdentifier(String identifier)
identifier - The identifier that is used to identify the build phase.public PBXBuildPhase getSourcesBuildPhaseWithIdentifier(String identifier)
identifier - The identifier that is used to identify the build phase.public void removeAppleScriptBuildPhaseWithIdentifier(String identifier)
identifier - The identifier that is used to identify the build phase.public void removeCopyFilesBuildPhaseWithIdentifier(String identifier)
identifier - The identifier that is used to identify the build phase.public void removeFrameworksBuildPhaseWithIdentifier(String identifier)
identifier - The identifier that is used to identify the build phase.public void removeHeadersBuildPhaseWithIdentifier(String identifier)
identifier - The identifier that is used to identify the build phase.public void removeResourcesBuildPhaseWithIdentifier(String identifier)
identifier - The identifier that is used to identify the build phase.public void removeShellScriptBuildPhaseWithIdentifier(String identifier)
identifier - The identifier that is used to identify the build phase.public void removeSourcesBuildPhaseWithIdentifier(String identifier)
identifier - The identifier that is used to identify the build phase.public void setBuildConfigurationProperty(String buildConfigurationIdentifier, String key, String value)
buildConfigurationIdentifier - The identifier for the configuration.key - The key of the build setting you want to add/update.value - The value of the build setting you want to add/update.public void setBuildConfigurationProperty(String buildConfigurationIdentifier, String key, List<String> values)
buildConfigurationIdentifier - The identifier for the configuration.key - The key of the build setting you want to add/update.values - The value of the build setting you want to add/update as a list.public String getBuildConfigurationProperty(String buildConfigurationIdentifier, String key)
buildConfigurationIdentifier - The identifier for the build configuration.key - The key of the build property you want the value of.public List<String> getBuildConfigurationPropertyAsList(String buildConfigurationIdentifier, String key)
buildConfigurationIdentifier - The identifier for the build configuration.key - The key of the build property you want the value of.public PBXFileElement getGroupWithIdentifier(String identifier)
identifier - The identifier of the group.public PBXFileElement getVariantGroupWithIdentifier(String identifier)
identifier - The identifier of the variant group.public PBXBuildFile getBuildFileWithIdentifier(String identifier)
identifier - The identifier of the build file.public List<PBXBuildFile> getBuildFileWithFileRef(String fileRef)
fileRef - The file reference of the build file.public List<PBXBuildFile> getBuildFileWithFileRefPath(String fileRefPath)
fileRefPath - The path of the file reference that the build file references.public PBXFileElement getFileReferenceWithPath(String fileRefPath)
fileRefPath - The path of the file reference.public PBXTarget getNativeTargetWithIdentifier(String identifier)
identifier - The identifier of the native target.public PBXTarget getLegacyTargetWithIdentifier(String identifier)
identifier - The identifier of the legacy target.public PBXTarget getAggregateTargetWithIdentifier(String identifier)
identifier - The identifier of the aggregate target.public XCBuildConfiguration getBuildConfigurationWithIdentifier(String identifier)
identifier - The identifier of the build configuration.public XCConfigurationList getConfigurationListWithIdentifier(String identifier)
identifier - The identifier of the configuration list.Copyright © 2014. All rights reserved.