Class CBuilderXProjectWriter
java.lang.Object
net.sf.antcontrib.cpptasks.borland.CBuilderXProjectWriter
- All Implemented Interfaces:
ProjectWriter
Writes a CBuilderX 1.0 project file.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classUtility class to generate property elements. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate StringgetActivePlatform(CCTask task) Gets active platform.private CommandLineCompilerConfigurationgetBaseCompilerConfiguration(Hashtable targets) Gets the first recognized compiler from the compilation targets.private StringgetBuildType(CCTask task) Gets build type from link target.private StringgetWin32Toolset(CommandLineCompilerConfiguration compilerConfig) private voidwriteCompileOptions(String baseDir, CBuilderXProjectWriter.PropertyWriter writer, CommandLineCompilerConfiguration compilerConfig) Writes elements corresponding to compilation options.private voidwriteIlinkArgs(CBuilderXProjectWriter.PropertyWriter writer, String linkID, String[] args) Writes ilink32 linker options to project file.private voidwriteLdArgs(CBuilderXProjectWriter.PropertyWriter writer, String linkID, String[] preArgs) Writes ld linker options to project file.private voidwriteLinkOptions(String baseDir, CBuilderXProjectWriter.PropertyWriter writer, TargetInfo linkTarget) Writes elements corresponding to link options.voidwriteProject(File fileName, CCTask task, ProjectDef projectDef, List sources, Hashtable targets, TargetInfo linkTarget) Writes a project definition file.
-
Constructor Details
-
CBuilderXProjectWriter
public CBuilderXProjectWriter()Constructor.
-
-
Method Details
-
writeProject
public void writeProject(File fileName, CCTask task, ProjectDef projectDef, List sources, Hashtable targets, TargetInfo linkTarget) throws IOException, SAXException Writes a project definition file.- Specified by:
writeProjectin interfaceProjectWriter- Parameters:
fileName- project name for file, should has .cbx extensiontask- cc task for which to write projectprojectDef- project elementsources- source filestargets- compilation targetslinkTarget- link target- Throws:
IOException- if I/O errorSAXException- if XML serialization error
-
getBuildType
Gets build type from link target.- Parameters:
task- CCTask current task- Returns:
- String build type
-
getActivePlatform
Gets active platform.- Parameters:
task- CCTask cc task- Returns:
- String platform identifier
-
getWin32Toolset
-
getBaseCompilerConfiguration
Gets the first recognized compiler from the compilation targets.- Parameters:
targets- compilation targets- Returns:
- representative (hopefully) compiler configuration
-
writeCompileOptions
private void writeCompileOptions(String baseDir, CBuilderXProjectWriter.PropertyWriter writer, CommandLineCompilerConfiguration compilerConfig) throws SAXException Writes elements corresponding to compilation options.- Parameters:
baseDir- String base directorywriter- PropertyWriter property writercompilerConfig- representative configuration- Throws:
SAXException- if I/O error or illegal content
-
writeLinkOptions
private void writeLinkOptions(String baseDir, CBuilderXProjectWriter.PropertyWriter writer, TargetInfo linkTarget) throws SAXException Writes elements corresponding to link options.- Parameters:
baseDir- String base directorywriter- PropertyWriter property writerlinkTarget- TargetInfo link target- Throws:
SAXException- if I/O error or illegal content
-
writeLdArgs
private void writeLdArgs(CBuilderXProjectWriter.PropertyWriter writer, String linkID, String[] preArgs) throws SAXException Writes ld linker options to project file.- Parameters:
writer- PropertyWriter property writerlinkID- String linker identifierpreArgs- String[] linker arguments- Throws:
SAXException- thrown if unable to write option
-
writeIlinkArgs
private void writeIlinkArgs(CBuilderXProjectWriter.PropertyWriter writer, String linkID, String[] args) throws SAXException Writes ilink32 linker options to project file.- Parameters:
writer- PropertyWriter property writerlinkID- String linker identifierpreArgs- String[] linker arguments- Throws:
SAXException- thrown if unable to write option
-