Class DevStudioProjectWriter
- java.lang.Object
-
- net.sf.antcontrib.cpptasks.devstudio.DevStudioProjectWriter
-
- All Implemented Interfaces:
ProjectWriter
public final class DevStudioProjectWriter extends java.lang.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 Summary
Fields Modifier and Type Field Description private java.lang.StringversionVisual Studio version.
-
Constructor Summary
Constructors Constructor Description DevStudioProjectWriter(java.lang.String versionArg)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private CommandLineCompilerConfigurationgetBaseCompilerConfiguration(java.util.Hashtable targets)Gets the first recognized compiler from the compilation targets.private java.io.File[]getSources(java.util.List sourceList)Get alphabetized array of source files.private booleanisGroupMember(java.lang.String filter, java.io.File candidate)Returns true if the file has an extension that appears in the group filter.private static java.lang.StringtoProjectName(java.lang.String name)private static voidwriteComments(java.io.Writer writer, java.util.List comments)private voidwriteCompileOptions(java.io.Writer writer, boolean isDebug, java.lang.String baseDir, CommandLineCompilerConfiguration compilerConfig)Writes compiler options.private voidwriteConfig(java.io.Writer writer, boolean isDebug, java.util.List dependencies, java.lang.String basePath, CommandLineCompilerConfiguration compilerConfig, TargetInfo linkTarget, java.util.Hashtable targets)private voidwriteLinkOptions(java.io.Writer writer, boolean isDebug, java.util.List dependencies, java.lang.String basePath, TargetInfo linkTarget, java.util.Hashtable targets)Writes link options.private voidwriteMessage(java.io.Writer writer, java.lang.String projectName, java.lang.String targtype)Writes "This is not a makefile" warning.voidwriteProject(java.io.File fileName, CCTask task, ProjectDef projectDef, java.util.List files, java.util.Hashtable targets, TargetInfo linkTarget)Writes a project definition file.private voidwriteSource(java.io.Writer writer, java.lang.String basePath, java.io.File groupMember)Writes the entry for one source file in the project.private voidwriteWorkspace(java.io.Writer writer, ProjectDef project, java.lang.String projectName, java.io.File dspFile)private static voidwriteWorkspaceProject(java.io.Writer writer, java.lang.String projectName, java.lang.String projectFile, java.util.List dependsOn)
-
-
-
Method Detail
-
toProjectName
private static java.lang.String toProjectName(java.lang.String name)
-
writeProject
public void writeProject(java.io.File fileName, CCTask task, ProjectDef projectDef, java.util.List files, java.util.Hashtable targets, TargetInfo linkTarget) throws java.io.IOExceptionWrites a project definition file.- Specified by:
writeProjectin interfaceProjectWriter- Parameters:
fileName- File name base, writer may append appropriate extensiontask- cc task for which to write projectprojectDef- project elementfiles- source filestargets- compilation targetslinkTarget- link target- Throws:
java.io.IOException- if error writing project file
-
writeConfig
private void writeConfig(java.io.Writer writer, boolean isDebug, java.util.List dependencies, java.lang.String basePath, CommandLineCompilerConfiguration compilerConfig, TargetInfo linkTarget, java.util.Hashtable targets) throws java.io.IOException- Throws:
java.io.IOException
-
writeWorkspaceProject
private static void writeWorkspaceProject(java.io.Writer writer, java.lang.String projectName, java.lang.String projectFile, java.util.List dependsOn) throws java.io.IOException- Throws:
java.io.IOException
-
writeWorkspace
private void writeWorkspace(java.io.Writer writer, ProjectDef project, java.lang.String projectName, java.io.File dspFile) throws java.io.IOException- Throws:
java.io.IOException
-
isGroupMember
private boolean isGroupMember(java.lang.String filter, java.io.File candidate)Returns true if the file has an extension that appears in the group filter.- Parameters:
filter- String group filtercandidate- File file- Returns:
- boolean true if member of group
-
writeSource
private void writeSource(java.io.Writer writer, java.lang.String basePath, java.io.File groupMember) throws java.io.IOExceptionWrites the entry for one source file in the project.- Parameters:
writer- Writer writerbasePath- String base path for projectgroupMember- File project source file- Throws:
java.io.IOException- if error writing project file
-
getSources
private java.io.File[] getSources(java.util.List sourceList)
Get alphabetized array of source files.- Parameters:
sourceList- list of source files- Returns:
- File[] source files
-
writeMessage
private void writeMessage(java.io.Writer writer, java.lang.String projectName, java.lang.String targtype) throws java.io.IOExceptionWrites "This is not a makefile" warning.- Parameters:
writer- Writer writerprojectName- String project nametargtype- String target type- Throws:
java.io.IOException- if error writing project
-
getBaseCompilerConfiguration
private CommandLineCompilerConfiguration getBaseCompilerConfiguration(java.util.Hashtable targets)
Gets the first recognized compiler from the compilation targets.- Parameters:
targets- compilation targets- Returns:
- representative (hopefully) compiler configuration
-
writeCompileOptions
private void writeCompileOptions(java.io.Writer writer, boolean isDebug, java.lang.String baseDir, CommandLineCompilerConfiguration compilerConfig) throws java.io.IOExceptionWrites compiler options.- Parameters:
writer- Writer writerisDebug- true if debug.baseDir- String base directorycompilerConfig- compiler configuration- Throws:
java.io.IOException- if error on writing project
-
writeLinkOptions
private void writeLinkOptions(java.io.Writer writer, boolean isDebug, java.util.List dependencies, java.lang.String basePath, TargetInfo linkTarget, java.util.Hashtable targets) throws java.io.IOExceptionWrites link options.- Parameters:
writer- Writer writerbasePath- String base pathdependencies- project dependencies, used to suppress explicit linking.linkTarget- TargetInfo link targettargets- Hashtable all targets- Throws:
java.io.IOException- if unable to write to project file
-
writeComments
private static void writeComments(java.io.Writer writer, java.util.List comments) throws java.io.IOException- Throws:
java.io.IOException
-
-