Class CBuilderXProjectWriter

java.lang.Object
net.sf.antcontrib.cpptasks.borland.CBuilderXProjectWriter
All Implemented Interfaces:
ProjectWriter

public final class CBuilderXProjectWriter extends Object implements ProjectWriter
Writes a CBuilderX 1.0 project 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:
      writeProject in interface ProjectWriter
      Parameters:
      fileName - project name for file, should has .cbx extension
      task - cc task for which to write project
      projectDef - project element
      sources - source files
      targets - compilation targets
      linkTarget - link target
      Throws:
      IOException - if I/O error
      SAXException - if XML serialization error
    • getBuildType

      private String getBuildType(CCTask task)
      Gets build type from link target.
      Parameters:
      task - CCTask current task
      Returns:
      String build type
    • getActivePlatform

      private String getActivePlatform(CCTask task)
      Gets active platform.
      Parameters:
      task - CCTask cc task
      Returns:
      String platform identifier
    • getWin32Toolset

      private String getWin32Toolset(CommandLineCompilerConfiguration compilerConfig)
    • getBaseCompilerConfiguration

      private CommandLineCompilerConfiguration getBaseCompilerConfiguration(Hashtable targets)
      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 directory
      writer - PropertyWriter property writer
      compilerConfig - 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 directory
      writer - PropertyWriter property writer
      linkTarget - 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 writer
      linkID - String linker identifier
      preArgs - 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 writer
      linkID - String linker identifier
      preArgs - String[] linker arguments
      Throws:
      SAXException - thrown if unable to write option