Class DevStudioProjectWriter

java.lang.Object
net.sf.antcontrib.cpptasks.devstudio.DevStudioProjectWriter
All Implemented Interfaces:
ProjectWriter

public final class DevStudioProjectWriter extends Object implements ProjectWriter
Writes a Microsoft Visual Studio 97 or Visual Studio 6 project file. Status: Collects file list but does not pick up libraries and settings from project.
  • Field Details

    • version

      private String version
      Visual Studio version.
  • Constructor Details

    • DevStudioProjectWriter

      public DevStudioProjectWriter(String versionArg)
      Constructor.
      Parameters:
      versionArg - String Visual Studio version.
  • Method Details

    • toProjectName

      private static String toProjectName(String name)
    • writeProject

      public void writeProject(File fileName, CCTask task, ProjectDef projectDef, List files, Hashtable targets, TargetInfo linkTarget) throws IOException
      Writes a project definition file.
      Specified by:
      writeProject in interface ProjectWriter
      Parameters:
      fileName - File name base, writer may append appropriate extension
      task - cc task for which to write project
      projectDef - project element
      files - source files
      targets - compilation targets
      linkTarget - link target
      Throws:
      IOException - if error writing project file
    • writeConfig

      private void writeConfig(Writer writer, boolean isDebug, List dependencies, String basePath, CommandLineCompilerConfiguration compilerConfig, TargetInfo linkTarget, Hashtable targets) throws IOException
      Throws:
      IOException
    • writeWorkspaceProject

      private static void writeWorkspaceProject(Writer writer, String projectName, String projectFile, List dependsOn) throws IOException
      Throws:
      IOException
    • writeWorkspace

      private void writeWorkspace(Writer writer, ProjectDef project, String projectName, File dspFile) throws IOException
      Throws:
      IOException
    • isGroupMember

      private boolean isGroupMember(String filter, File candidate)
      Returns true if the file has an extension that appears in the group filter.
      Parameters:
      filter - String group filter
      candidate - File file
      Returns:
      boolean true if member of group
    • writeSource

      private void writeSource(Writer writer, String basePath, File groupMember) throws IOException
      Writes the entry for one source file in the project.
      Parameters:
      writer - Writer writer
      basePath - String base path for project
      groupMember - File project source file
      Throws:
      IOException - if error writing project file
    • getSources

      private File[] getSources(List sourceList)
      Get alphabetized array of source files.
      Parameters:
      sourceList - list of source files
      Returns:
      File[] source files
    • writeMessage

      private void writeMessage(Writer writer, String projectName, String targtype) throws IOException
      Writes "This is not a makefile" warning.
      Parameters:
      writer - Writer writer
      projectName - String project name
      targtype - String target type
      Throws:
      IOException - if error writing project
    • 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(Writer writer, boolean isDebug, String baseDir, CommandLineCompilerConfiguration compilerConfig) throws IOException
      Writes compiler options.
      Parameters:
      writer - Writer writer
      isDebug - true if debug.
      baseDir - String base directory
      compilerConfig - compiler configuration
      Throws:
      IOException - if error on writing project
    • writeLinkOptions

      private void writeLinkOptions(Writer writer, boolean isDebug, List dependencies, String basePath, TargetInfo linkTarget, Hashtable targets) throws IOException
      Writes link options.
      Parameters:
      writer - Writer writer
      dependencies - project dependencies, used to suppress explicit linking.
      basePath - String base path
      linkTarget - TargetInfo link target
      targets - Hashtable all targets
      Throws:
      IOException - if unable to write to project file
    • writeComments

      private static void writeComments(Writer writer, List comments) throws IOException
      Throws:
      IOException