|
terp - the ANT Tasks v1.3.304 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.tools.ant.taskdefs.Echo
com.codemesh.terp.ant.TerpEcho
com.codemesh.terp.ant.compiler.cpp.GenerateVsProject
public class GenerateVsProject
An option that causes a VisualStudio project file to be generated. You can add this option to a compiler invocation to generate a VisualStudio project file that mirrors the compiler settings.
This options is really one of the FileCreating tasks (also
see ResourceOption) that can be nested in the compiler task.
Rather than adding compiler switches to the commandline, they generate
one or more files that may play a role during or after the compilation.
In this case, the generated file is mostly useful for people who might
wish to debug the built project in Microsoft VisualStudio. Having a
project that can be double-clicked makes live a lot easier.
This options extends TerpEcho to take advantage of its template
expanding capabilities. If no file or template attributes
are specified, this task will calculate both the template and the output
filenames.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.apache.tools.ant.taskdefs.Echo |
|---|
org.apache.tools.ant.taskdefs.Echo.EchoLevel |
| Nested classes/interfaces inherited from interface com.codemesh.terp.ant.TerpAware |
|---|
TerpAware.Delegate |
| Field Summary |
|---|
| Fields inherited from class org.apache.tools.ant.taskdefs.Echo |
|---|
append, file, logLevel, message |
| Fields inherited from class org.apache.tools.ant.Task |
|---|
target, taskName, taskType, wrapper |
| Fields inherited from class org.apache.tools.ant.ProjectComponent |
|---|
description, location, project |
| Constructor Summary | |
|---|---|
GenerateVsProject()
|
|
| 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. |
protected java.io.File |
calculateProjectFile(CppCompiler compiler)
Calculates the project file based on the settings. |
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()
Emits the project file. |
java.lang.String |
getCharset()
Returns the configured charset (unicode, mbcs). |
static int |
getConfigurationCharset(java.lang.String charset)
Returns the integer representing Unicode or MBCS strings. |
static int |
getConfigurationType(TargetType targetType)
Returns the VisualStudio enumeration values for the given target type. |
static java.util.List<java.lang.String> |
getIncludePath(java.lang.String commandLine)
|
static java.lang.Integer |
getOptimization(java.lang.String commandLine)
Returns the optimization level as used by VisualStudio project files. |
static java.lang.Boolean |
getPortabilityWarnings(java.lang.String commandLine)
|
static java.lang.Integer |
getProcessorOptimization(java.lang.String commandLine)
Returns the processor optimization as used by VisualStudio project files. |
static java.lang.String |
getProjectFileExtension(Version vers)
Returns the project file extension that's appropriate for the compiler version. |
static java.lang.Integer |
getRuntimeLibraryNumeric(java.lang.String commandLine)
Returns the value of the runtime library switch. |
static java.lang.String |
getRuntimeLibraryOption(java.lang.String commandLine)
Returns the value of the runtime library switch. |
Version |
getVersion()
Returns the configured compiler version. |
static java.lang.Integer |
getWarningLevel(java.lang.String commandLine)
Returns the warning level as used by VisualStudio project files. |
boolean |
satisfies(TerpContext ctx)
Returns true if both conditions are met within the given terp context. |
void |
setCharset(java.lang.String charset)
Sets the charset used in this project (unicode, mbcs). |
void |
setVersion(java.lang.String version)
Sets the MSVC++ version number for which we're generating a VisualStudio project file. |
| Methods inherited from class com.codemesh.terp.ant.TerpEcho |
|---|
getContext, getFile, getIf, getTemplate, getUnless, satisfiesConditions, setContext, setIf, setProject, setTemplate, setUnless |
| Methods inherited from class org.apache.tools.ant.taskdefs.Echo |
|---|
addText, setAppend, setEncoding, setFile, setLevel, setMessage, setOutput |
| Methods inherited from class org.apache.tools.ant.Task |
|---|
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType |
| Methods inherited from class org.apache.tools.ant.ProjectComponent |
|---|
clone, getDescription, getLocation, getProject, setDescription, setLocation |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.codemesh.terp.ant.compiler.CompilerOption |
|---|
getIf, getUnless, setIf, setUnless |
| Constructor Detail |
|---|
public GenerateVsProject()
| Method Detail |
|---|
public void setCharset(java.lang.String charset)
charset - the charset used.public java.lang.String getCharset()
public void setVersion(java.lang.String version)
version - the compiler version.public Version getVersion()
public void addCommands(java.util.List<java.lang.String> commandList,
CppCompiler compiler,
CompilerPhase phase)
This method is called by the compiler repeatedly with different values for the compiler phase to account for these possibilities. Does not do anything because the file generation is outside the scope of the invoked compiler.
addCommands in interface CompilerOption<CppCompiler>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.public boolean satisfies(TerpContext ctx)
satisfies in interface CompilerOption<CppCompiler>ctx - the terp context in which the logical expressions are evaluated.
public boolean appliesTo(CppCompiler compiler,
CompilerPhase phase)
appliesTo in interface CompilerOption<CppCompiler>compiler - the compiler for which we're asking.phase - the compiler phase we're executing.
public java.util.List<java.lang.String> creates(CppCompiler compiler,
CompilerPhase phase)
creates in interface FileCreating<CppCompiler>compiler - the compiler.phase - the compilation phase.
public static int getConfigurationType(TargetType targetType)
targetType - the target type.
public static int getConfigurationCharset(java.lang.String charset)
charset - a name, either "unicode" or "mbcs" or null.
public static java.lang.String getProjectFileExtension(Version vers)
vers - the compiler version.
public static java.lang.Integer getOptimization(java.lang.String commandLine)
commandLine - the commandline that's used for compilation.
public static java.lang.Integer getWarningLevel(java.lang.String commandLine)
commandLine - the commandline that's used for compilation.
public static java.util.List<java.lang.String> getIncludePath(java.lang.String commandLine)
public static java.lang.Integer getRuntimeLibraryNumeric(java.lang.String commandLine)
public static java.lang.String getRuntimeLibraryOption(java.lang.String commandLine)
public static java.lang.Boolean getPortabilityWarnings(java.lang.String commandLine)
public static java.lang.Integer getProcessorOptimization(java.lang.String commandLine)
commandLine - the commandline that's used for compilation.
protected java.io.File calculateProjectFile(CppCompiler compiler)
compiler - the compiler task.
public void execute()
throws org.apache.tools.ant.BuildException
execute in class TerpEchoorg.apache.tools.ant.BuildException
|
terp - the ANT Tasks v1.3.304 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||