terp - the ANT Tasks
v1.3.309

com.codemesh.terp.ant.compiler.cpp
Class VsProjectOption

java.lang.Object
  extended by com.codemesh.terp.ant.compiler.AbstractCompilerOption<C>
      extended by com.codemesh.terp.ant.compiler.BooleanCompilerOption<CppCompiler>
          extended by com.codemesh.terp.ant.compiler.cpp.VsProjectOption
All Implemented Interfaces:
CompilerOption<CppCompiler>, FileCreating<CppCompiler>

public class VsProjectOption
extends BooleanCompilerOption<CppCompiler>
implements FileCreating<CppCompiler>

An option that generates a VisualStudio project file representing the settings in the compiler task.


Constructor Summary
VsProjectOption()
           
 
Method Summary
 void addCommands(java.util.List<java.lang.String> commandList, CppCompiler compiler, CompilerPhase phase)
          Adds the compiler switches repreesnted by this option to the list of switches.
 boolean appliesTo(CppCompiler compiler, CompilerPhase phase)
          Returns true if this compiler option applies to the given compiler and compiler phase.
 java.lang.Boolean calculateBuiltinWchart(java.lang.String commandLine)
           
 java.lang.Integer calculateCharacterSet(java.lang.String commandLine)
           
 java.lang.Integer calculateConfigurationType(CppCompiler compiler)
           
 java.lang.Integer calculateDebugStyle(java.lang.String commandLine)
          Returns the value of debug style option.
 java.util.List<java.lang.String> calculateDefines(java.lang.String commandLine)
           
 java.lang.String calculateDefinitionFile(java.lang.String commandLine)
           
 java.util.List<java.lang.String> calculateIncludePath(java.lang.String commandLine, CppCompiler compiler)
           
 java.lang.Boolean calculateIncrementalLink(java.lang.String commandLine)
           
 java.util.List<java.lang.String> calculateLibPath(java.lang.String commandLine, CppCompiler compiler)
           
 java.util.List<java.lang.String> calculateLibraries(java.lang.String commandLine, CppCompiler compiler)
           
 java.lang.Boolean calculateMinimalRebuild(java.lang.String commandLine)
           
 java.lang.String calculateName(CppCompiler compiler)
           
 java.lang.Integer calculateOptimization(java.lang.String commandLine)
          Returns the optimization level as used by VisualStudio project files.
 java.lang.Boolean calculatePortabilityWarnings(java.lang.String commandLine)
           
 java.lang.String calculateProjectFile(CppCompiler compiler)
           
 java.lang.Integer calculateRuntimeLibraryNumeric(java.lang.String commandLine)
          Returns the value of the runtime library switch.
 java.lang.String calculateRuntimeLibraryOption(java.lang.String commandLine)
          Returns the value of the runtime library switch.
 java.lang.Integer calculateSubsystem(java.lang.String commandLine)
           
 java.lang.Integer calculateTargetMachine(java.lang.String commandLine, CppCompiler compiler)
           
 java.lang.String calculateTargetName(CppCompiler compiler)
           
 java.lang.Integer calculateWarningLevel(java.lang.String commandLine)
          Returns the warning level as used by VisualStudio project files.
 java.util.List<java.lang.String> creates(CppCompiler compiler, CompilerPhase phase)
          Returns a list of filenames representing the files that are created due to the presence of this compiler option.
 void execute(CppCompiler compiler)
           
 Guid getGuid()
          Returns the GUID configured for this project.
 java.lang.String getName()
           
 java.lang.String getTemplate()
           
 java.lang.String getVersion()
           
 void setGuid(java.lang.String guid)
          Sets the globally unique identifier used to identify the generated VisualStudio project.
 void setName(java.lang.String name)
          Set the project file name.
 void setTemplate(java.lang.String template)
          Set the resource identifier of the project file template to use.
 void setVersion(java.lang.String version)
          Set the Visual C++ compiler version for which the project file should be generated.
 
Methods inherited from class com.codemesh.terp.ant.compiler.BooleanCompilerOption
getValue, isEnabled, setValue
 
Methods inherited from class com.codemesh.terp.ant.compiler.AbstractCompilerOption
expand, expand, getIf, getProject, getUnless, quoteIfNecessary, satisfies, setIf, setProject, setUnless
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.codemesh.terp.ant.compiler.CompilerOption
getIf, getUnless, satisfies, setIf, setUnless
 

Constructor Detail

VsProjectOption

public VsProjectOption()
Method Detail

getName

public java.lang.String getName()

setName

public void setName(java.lang.String name)
Set the project file name. If this attribute is not set, the project name is derived from the configured target.

Parameters:
name - the project name.

getVersion

public java.lang.String getVersion()

setVersion

public void setVersion(java.lang.String version)
Set the Visual C++ compiler version for which the project file should be generated. If not specified, the project file version will be derived from the configured compiler.

Parameters:
version - the compiler version.

getTemplate

public java.lang.String getTemplate()

setTemplate

public void setTemplate(java.lang.String template)
Set the resource identifier of the project file template to use. If not specified, the project file template will be derived from the compiler.

Parameters:
template - the project file template to use.

setGuid

public void setGuid(java.lang.String guid)
Sets the globally unique identifier used to identify the generated VisualStudio project.

Parameters:
guid - the GUID, may be null in which case a new GUID is generated.

getGuid

public Guid getGuid()
Returns the GUID configured for this project.

Returns:
a globally unique identifier.

addCommands

public void addCommands(java.util.List<java.lang.String> commandList,
                        CppCompiler compiler,
                        CompilerPhase phase)
Description copied from interface: CompilerOption
Adds the compiler switches repreesnted by this option to the list of switches. Some compiler options may result in more than one switch being added to a compiler invocation. Other compiler options may result in different options being added in different phases (compilation vs. linking) of the build.

This method is called by the compiler repeatedly with different values for the compiler phase to account for these possibilities.

Specified by:
addCommands in interface CompilerOption<CppCompiler>
Parameters:
commandList - the list to which the compiler switches represented by this option (if any) are added.
compiler - the compiler for which we're doing this.
phase - the compiler phase in wihch we're doing this.

appliesTo

public boolean appliesTo(CppCompiler compiler,
                         CompilerPhase phase)
Description copied from interface: CompilerOption
Returns true if this compiler option applies to the given compiler and compiler phase. Not every option has switches to contribute for every compiler and every compilation phase. This method allows a quick, inexpensive check to filter out potentially more expensive calls later on.

Specified by:
appliesTo in interface CompilerOption<CppCompiler>
Parameters:
compiler - the compiler for which we're asking.
phase - the compiler phase we're executing.
Returns:

creates

public java.util.List<java.lang.String> creates(CppCompiler compiler,
                                                CompilerPhase phase)
Description copied from interface: FileCreating
Returns a list of filenames representing the files that are created due to the presence of this compiler option.

Specified by:
creates in interface FileCreating<CppCompiler>
Parameters:
compiler - the compiler.
phase - the compilation phase.
Returns:
a list of files, possibly empty.

execute

public void execute(CppCompiler compiler)

calculateName

public java.lang.String calculateName(CppCompiler compiler)

calculateDefinitionFile

public java.lang.String calculateDefinitionFile(java.lang.String commandLine)

calculateTargetName

public java.lang.String calculateTargetName(CppCompiler compiler)

calculateConfigurationType

public java.lang.Integer calculateConfigurationType(CppCompiler compiler)

calculateProjectFile

public java.lang.String calculateProjectFile(CppCompiler compiler)

calculateDefines

public java.util.List<java.lang.String> calculateDefines(java.lang.String commandLine)

calculateCharacterSet

public java.lang.Integer calculateCharacterSet(java.lang.String commandLine)

calculateDebugStyle

public java.lang.Integer calculateDebugStyle(java.lang.String commandLine)
Returns the value of debug style option.


calculateOptimization

public java.lang.Integer calculateOptimization(java.lang.String commandLine)
Returns the optimization level as used by VisualStudio project files.

Parameters:
commandLine - the commandline that's used for compilation.
Returns:
an optimization level.

calculateWarningLevel

public java.lang.Integer calculateWarningLevel(java.lang.String commandLine)
Returns the warning level as used by VisualStudio project files.

Parameters:
commandLine - the commandline that's used for compilation.
Returns:
an warning level.

calculateIncludePath

public java.util.List<java.lang.String> calculateIncludePath(java.lang.String commandLine,
                                                             CppCompiler compiler)

calculateLibPath

public java.util.List<java.lang.String> calculateLibPath(java.lang.String commandLine,
                                                         CppCompiler compiler)

calculateLibraries

public java.util.List<java.lang.String> calculateLibraries(java.lang.String commandLine,
                                                           CppCompiler compiler)

calculateRuntimeLibraryNumeric

public java.lang.Integer calculateRuntimeLibraryNumeric(java.lang.String commandLine)
Returns the value of the runtime library switch.


calculateRuntimeLibraryOption

public java.lang.String calculateRuntimeLibraryOption(java.lang.String commandLine)
Returns the value of the runtime library switch.


calculateBuiltinWchart

public java.lang.Boolean calculateBuiltinWchart(java.lang.String commandLine)

calculateIncrementalLink

public java.lang.Boolean calculateIncrementalLink(java.lang.String commandLine)

calculatePortabilityWarnings

public java.lang.Boolean calculatePortabilityWarnings(java.lang.String commandLine)

calculateMinimalRebuild

public java.lang.Boolean calculateMinimalRebuild(java.lang.String commandLine)

calculateSubsystem

public java.lang.Integer calculateSubsystem(java.lang.String commandLine)

calculateTargetMachine

public java.lang.Integer calculateTargetMachine(java.lang.String commandLine,
                                                CppCompiler compiler)

terp - the ANT Tasks
v1.3.309

Copyright © 2008-2012 by Codemesh, Inc. All Rights Reserved.