Class DevStudioProjectWriter
java.lang.Object
net.sf.antcontrib.cpptasks.devstudio.DevStudioProjectWriter
- All Implemented Interfaces:
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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate CommandLineCompilerConfiguration
getBaseCompilerConfiguration
(Hashtable targets) Gets the first recognized compiler from the compilation targets.private File[]
getSources
(List sourceList) Get alphabetized array of source files.private boolean
isGroupMember
(String filter, File candidate) Returns true if the file has an extension that appears in the group filter.private static String
toProjectName
(String name) private static void
writeComments
(Writer writer, List comments) private void
writeCompileOptions
(Writer writer, boolean isDebug, String baseDir, CommandLineCompilerConfiguration compilerConfig) Writes compiler options.private void
writeConfig
(Writer writer, boolean isDebug, List dependencies, String basePath, CommandLineCompilerConfiguration compilerConfig, TargetInfo linkTarget, Hashtable targets) private void
writeLinkOptions
(Writer writer, boolean isDebug, List dependencies, String basePath, TargetInfo linkTarget, Hashtable targets) Writes link options.private void
writeMessage
(Writer writer, String projectName, String targtype) Writes "This is not a makefile" warning.void
writeProject
(File fileName, CCTask task, ProjectDef projectDef, List files, Hashtable targets, TargetInfo linkTarget) Writes a project definition file.private void
writeSource
(Writer writer, String basePath, File groupMember) Writes the entry for one source file in the project.private void
writeWorkspace
(Writer writer, ProjectDef project, String projectName, File dspFile) private static void
writeWorkspaceProject
(Writer writer, String projectName, String projectFile, List dependsOn)
-
Field Details
-
version
Visual Studio version.
-
-
Constructor Details
-
DevStudioProjectWriter
Constructor.- Parameters:
versionArg
- String Visual Studio version.
-
-
Method Details
-
toProjectName
-
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 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:
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
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
Writes the entry for one source file in the project.- Parameters:
writer
- Writer writerbasePath
- String base path for projectgroupMember
- File project source file- Throws:
IOException
- if error writing project file
-
getSources
Get alphabetized array of source files.- Parameters:
sourceList
- list of source files- Returns:
- File[] source files
-
writeMessage
Writes "This is not a makefile" warning.- Parameters:
writer
- Writer writerprojectName
- String project nametargtype
- String target type- Throws:
IOException
- if error writing project
-
getBaseCompilerConfiguration
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 writerisDebug
- true if debug.baseDir
- String base directorycompilerConfig
- 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 writerdependencies
- project dependencies, used to suppress explicit linking.basePath
- String base pathlinkTarget
- TargetInfo link targettargets
- Hashtable all targets- Throws:
IOException
- if unable to write to project file
-
writeComments
- Throws:
IOException
-