public final class XcodeProjectWriter extends java.lang.Object implements ProjectWriter
Modifier and Type | Class and Description |
---|---|
private static class |
XcodeProjectWriter.PBXObjectRef
Represents a property map with an 96 bit identity.
|
Constructor and Description |
---|
XcodeProjectWriter()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
private XcodeProjectWriter.PBXObjectRef |
addDependency(java.util.Map objects,
XcodeProjectWriter.PBXObjectRef project,
java.util.List mainGroupChildren,
java.lang.String baseDir,
DependencyDef dependency)
Adds a dependency to the object graph.
|
private XcodeProjectWriter.PBXObjectRef |
addDocumentationGroup(java.util.Map objects,
java.lang.String sourceTree)
Add documentation group to map of objects.
|
private XcodeProjectWriter.PBXObjectRef |
addNativeTarget(java.util.Map objects,
TargetInfo linkTarget,
XcodeProjectWriter.PBXObjectRef product,
java.lang.String projectName,
java.util.List sourceGroupChildren,
java.util.List frameworkBuildFiles)
Add native target to map of objects.
|
private XcodeProjectWriter.PBXObjectRef |
addNativeTargetConfigurationList(java.util.Map objects,
java.lang.String projectName)
Add native target configuration list.
|
private XcodeProjectWriter.PBXObjectRef |
addProduct(java.util.Map objects,
TargetInfo linkTarget)
Add file reference of product to map of objects.
|
private XcodeProjectWriter.PBXObjectRef |
addProjectConfigurationList(java.util.Map objects,
java.lang.String baseDir,
java.util.List dependencies,
CommandLineCompilerConfiguration compilerConfig,
CommandLineLinkerConfiguration linkerConfig)
Add project configuration list.
|
private java.util.List |
addSources(java.util.Map objects,
java.lang.String sourceTree,
java.lang.String basePath,
java.util.Hashtable targets)
Add file references for all source files to map of objects.
|
private static XcodeProjectWriter.PBXObjectRef |
createPBXBuildFile(XcodeProjectWriter.PBXObjectRef fileRef,
java.util.Map settings)
Create PBXBuildFile.
|
private static XcodeProjectWriter.PBXObjectRef |
createPBXContainerItemProxy(XcodeProjectWriter.PBXObjectRef containerPortal,
int proxyType,
java.lang.String remoteInfo)
Create a proxy for a file in a different project.
|
private static XcodeProjectWriter.PBXObjectRef |
createPBXCopyFilesBuildPhase(int buildActionMask,
java.lang.String dstPath,
java.lang.String dstSubfolderSpec,
java.util.List files,
boolean runOnly)
Create a build phase that copies files to a destination.
|
private static XcodeProjectWriter.PBXObjectRef |
createPBXFileReference(java.lang.String sourceTree,
java.lang.String baseDir,
java.io.File file)
Create PBXFileReference.
|
private static XcodeProjectWriter.PBXObjectRef |
createPBXFrameworksBuildPhase(int buildActionMask,
java.util.List files,
boolean runOnly)
Create PBXFrameworksBuildPhase.
|
private static XcodeProjectWriter.PBXObjectRef |
createPBXGroup(java.lang.String name,
java.lang.String sourceTree,
java.util.List children)
Create PBXGroup.
|
private static XcodeProjectWriter.PBXObjectRef |
createPBXNativeTarget(java.lang.String name,
XcodeProjectWriter.PBXObjectRef buildConfigurationList,
java.util.List buildPhases,
java.util.List buildRules,
java.util.List dependencies,
java.lang.String productInstallPath,
java.lang.String productName,
XcodeProjectWriter.PBXObjectRef productReference,
java.lang.String productType)
Create PBXNativeTarget.
|
private static XcodeProjectWriter.PBXObjectRef |
createPBXProject(XcodeProjectWriter.PBXObjectRef buildConfigurationList,
XcodeProjectWriter.PBXObjectRef mainGroup,
java.lang.String projectDirPath,
java.lang.String projectRoot,
java.util.List targets)
Create PBXProject.
|
private static XcodeProjectWriter.PBXObjectRef |
createPBXReferenceProxy(XcodeProjectWriter.PBXObjectRef remoteRef,
DependencyDef dependency)
Create a proxy for a file in a different project.
|
private static XcodeProjectWriter.PBXObjectRef |
createPBXSourcesBuildPhase(int buildActionMask,
java.util.List files,
boolean runOnly)
Create PBXSourcesBuildPhase.
|
private static XcodeProjectWriter.PBXObjectRef |
createXCBuildConfiguration(java.lang.String name,
java.util.Map buildSettings)
Create XCBuildConfiguration.
|
private static XcodeProjectWriter.PBXObjectRef |
createXCConfigurationList(java.util.List buildConfigurations)
Create XCConfigurationList.
|
private CommandLineCompilerConfiguration |
getBaseCompilerConfiguration(java.util.Hashtable targets)
Gets the first recognized compiler from the
compilation targets.
|
private java.lang.String |
getFileType(TargetInfo linkTarget) |
private java.lang.String |
getProductType(TargetInfo linkTarget) |
private int |
getProductTypeIndex(TargetInfo linkTarget) |
private static java.lang.String |
toString(boolean b)
Method returns "1" for true, "0" for false.
|
void |
writeProject(java.io.File fileName,
CCTask task,
ProjectDef projectDef,
java.util.List sources,
java.util.Hashtable targets,
TargetInfo linkTarget)
Writes a project definition file.
|
public void writeProject(java.io.File fileName, CCTask task, ProjectDef projectDef, java.util.List sources, java.util.Hashtable targets, TargetInfo linkTarget) throws java.io.IOException
writeProject
in interface ProjectWriter
fileName
- File name base, writer may append appropriate extensiontask
- cc task for which to write projectprojectDef
- project elementtargets
- compilation targetslinkTarget
- link targetsources
- source and header filesjava.io.IOException
- if error writing project fileprivate XcodeProjectWriter.PBXObjectRef addDependency(java.util.Map objects, XcodeProjectWriter.PBXObjectRef project, java.util.List mainGroupChildren, java.lang.String baseDir, DependencyDef dependency)
objects
- project
- mainGroupChildren
- baseDir
- dependency
- private XcodeProjectWriter.PBXObjectRef addDocumentationGroup(java.util.Map objects, java.lang.String sourceTree)
objects
- object map.sourceTree
- source tree description.private XcodeProjectWriter.PBXObjectRef addProduct(java.util.Map objects, TargetInfo linkTarget)
objects
- object map.linkTarget
- build description for executable or shared library.private java.util.List addSources(java.util.Map objects, java.lang.String sourceTree, java.lang.String basePath, java.util.Hashtable targets)
objects
- map of objects.sourceTree
- source tree.basePath
- parent of XCode project dirtargets
- build targets.private XcodeProjectWriter.PBXObjectRef addNativeTargetConfigurationList(java.util.Map objects, java.lang.String projectName)
objects
- map of objects.projectName
- project name.private XcodeProjectWriter.PBXObjectRef addProjectConfigurationList(java.util.Map objects, java.lang.String baseDir, java.util.List dependencies, CommandLineCompilerConfiguration compilerConfig, CommandLineLinkerConfiguration linkerConfig)
objects
- map of objects.baseDir
- base directory.compilerConfig
- compiler configuration.private XcodeProjectWriter.PBXObjectRef addNativeTarget(java.util.Map objects, TargetInfo linkTarget, XcodeProjectWriter.PBXObjectRef product, java.lang.String projectName, java.util.List sourceGroupChildren, java.util.List frameworkBuildFiles)
objects
- map of objects.linkTarget
- description of executable or shared library.product
- product.projectName
- project name.sourceGroupChildren
- source files needed to build product.private int getProductTypeIndex(TargetInfo linkTarget)
private java.lang.String getProductType(TargetInfo linkTarget)
private java.lang.String getFileType(TargetInfo linkTarget)
private static XcodeProjectWriter.PBXObjectRef createPBXFileReference(java.lang.String sourceTree, java.lang.String baseDir, java.io.File file)
sourceTree
- source tree.baseDir
- base directory.file
- file.private static XcodeProjectWriter.PBXObjectRef createPBXGroup(java.lang.String name, java.lang.String sourceTree, java.util.List children)
name
- group name.sourceTree
- source tree.children
- list of PBXFileReferences.private static XcodeProjectWriter.PBXObjectRef createPBXProject(XcodeProjectWriter.PBXObjectRef buildConfigurationList, XcodeProjectWriter.PBXObjectRef mainGroup, java.lang.String projectDirPath, java.lang.String projectRoot, java.util.List targets)
buildConfigurationList
- build configuration list.mainGroup
- main group.projectDirPath
- project directory path.targets
- targets.projectRoot
- projectRoot directory relative toprivate static XcodeProjectWriter.PBXObjectRef createXCConfigurationList(java.util.List buildConfigurations)
buildConfigurations
- build configurations.private static XcodeProjectWriter.PBXObjectRef createXCBuildConfiguration(java.lang.String name, java.util.Map buildSettings)
name
- name.buildSettings
- build settings.private static XcodeProjectWriter.PBXObjectRef createPBXNativeTarget(java.lang.String name, XcodeProjectWriter.PBXObjectRef buildConfigurationList, java.util.List buildPhases, java.util.List buildRules, java.util.List dependencies, java.lang.String productInstallPath, java.lang.String productName, XcodeProjectWriter.PBXObjectRef productReference, java.lang.String productType)
name
- name.buildConfigurationList
- build configuration list.buildPhases
- build phases.buildRules
- build rules.dependencies
- dependencies.productInstallPath
- product install path.productName
- product name.productReference
- file reference for product.productType
- product type.private static XcodeProjectWriter.PBXObjectRef createPBXSourcesBuildPhase(int buildActionMask, java.util.List files, boolean runOnly)
buildActionMask
- build action mask.files
- source files.runOnly
- if true, phase should only be run on deployment.private static XcodeProjectWriter.PBXObjectRef createPBXBuildFile(XcodeProjectWriter.PBXObjectRef fileRef, java.util.Map settings)
fileRef
- source file.settings
- build settings.private static XcodeProjectWriter.PBXObjectRef createPBXFrameworksBuildPhase(int buildActionMask, java.util.List files, boolean runOnly)
buildActionMask
- build action mask.files
- files.runOnly
- if true, phase should only be run on deployment.private static XcodeProjectWriter.PBXObjectRef createPBXCopyFilesBuildPhase(int buildActionMask, java.lang.String dstPath, java.lang.String dstSubfolderSpec, java.util.List files, boolean runOnly)
buildActionMask
- build action mask.dstPath
- destination path.dstSubfolderSpec
- subfolder spec.files
- files.runOnly
- if true, phase should only be run on deployment.private static XcodeProjectWriter.PBXObjectRef createPBXContainerItemProxy(XcodeProjectWriter.PBXObjectRef containerPortal, int proxyType, java.lang.String remoteInfo)
containerPortal
- XcodeProject containing file.proxyType
- proxy type.private static XcodeProjectWriter.PBXObjectRef createPBXReferenceProxy(XcodeProjectWriter.PBXObjectRef remoteRef, DependencyDef dependency)
remoteRef
- PBXContainerItemProxy for reference.dependency
- dependency.private static java.lang.String toString(boolean b)
b
- boolean value.private CommandLineCompilerConfiguration getBaseCompilerConfiguration(java.util.Hashtable targets)
targets
- compilation targets