com.codemesh.terp.ant.compiler.cpp
Class ResourceOption
java.lang.Object
org.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.ResourceOption
- All Implemented Interfaces:
- CompilerOption<CppCompiler>, CppFileCreating, FileCreating<CppCompiler>, TerpAware, TerpContextHolder, java.lang.Cloneable
public class ResourceOption
- extends TerpEcho
- implements CppFileCreating
An option that allows the programmatic specification of
commonly used resource data.
This option will cause the invocation of a resource compiler
with the following definitions:
- _DEBUG if we're performing a debug build.
- _M_AMD64 if we're building for the AMD64 processor architecture.
- _M_IA64 if we're building for the IA64 processor architecture.
- _M_IX86 if we're building for the x86 processor architecture.
- VS2003 if we're building with VisualStudio 2003.
- VS2005 if we're building with VisualStudio 2005.
- VS2008 if we're building with VisualStudio 2008.
- VS2010 if we're building with VisualStudio 2010.
You can use these constants in your rc file to compose conditional string values
that indicate the VisualStudio version, processor architecture, and debug nature
of your binary.
| Nested classes/interfaces inherited from class org.apache.tools.ant.taskdefs.Echo |
org.apache.tools.ant.taskdefs.Echo.EchoLevel |
| 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 |
| 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 |
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 |
iconFile
protected java.io.File iconFile
comments
protected java.lang.String comments
companyName
protected java.lang.String companyName
fileDescription
protected java.lang.String fileDescription
fileVersion
protected Version fileVersion
internalName
protected java.lang.String internalName
legalCopyright
protected java.lang.String legalCopyright
legalTradeMarks
protected java.lang.String legalTradeMarks
originalFileName
protected java.lang.String originalFileName
productName
protected java.lang.String productName
productVersion
protected Version productVersion
specialBuild
protected java.lang.String specialBuild
targetType
protected TargetType targetType
charSetId
protected java.lang.String charSetId
languageId
protected java.lang.String languageId
theMessage
protected java.lang.String theMessage
ResourceOption
public ResourceOption()
setIcon
public void setIcon(java.io.File icon)
getIcon
public java.io.File getIcon()
setComments
public void setComments(java.lang.String comments)
getComments
public java.lang.String getComments()
getCompanyName
public java.lang.String getCompanyName()
setCompanyName
public void setCompanyName(java.lang.String companyName)
getFileDescription
public java.lang.String getFileDescription()
setFileDescription
public void setFileDescription(java.lang.String fileDescription)
getFileVersion
public Version getFileVersion()
setFileVersion
public void setFileVersion(java.lang.String fileVersion)
getIconFile
public java.io.File getIconFile()
setIconFile
public void setIconFile(java.io.File iconFile)
getInternalName
public java.lang.String getInternalName()
setInternalName
public void setInternalName(java.lang.String internalName)
getLanguageId
public java.lang.String getLanguageId()
setLanguageId
public void setLanguageId(java.lang.String languageId)
getLegalCopyright
public java.lang.String getLegalCopyright()
setLegalCopyright
public void setLegalCopyright(java.lang.String legalCopyright)
getLegalTradeMarks
public java.lang.String getLegalTradeMarks()
setLegalTradeMarks
public void setLegalTradeMarks(java.lang.String legalTradeMarks)
getOriginalFileName
public java.lang.String getOriginalFileName()
setOriginalFileName
public void setOriginalFileName(java.lang.String originalFileName)
getProductName
public java.lang.String getProductName()
setProductName
public void setProductName(java.lang.String productName)
getProductVersion
public Version getProductVersion()
setProductVersion
public void setProductVersion(java.lang.String productVersion)
getSpecialBuild
public java.lang.String getSpecialBuild()
setSpecialBuild
public void setSpecialBuild(java.lang.String specialBuild)
setTargetType
public void setTargetType(java.lang.String type)
getCharSetId
public java.lang.String getCharSetId()
setCharSetId
public void setCharSetId(java.lang.String charSetId)
addCommands
public 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.
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.
This method does not add any commands to the commandline. Its functionality is outside
the scope of the C++ compiler.
- 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)
- 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.
This option is limited to Microsoft and INTEL compilers on Windows. The file is generated
in the Link phase.
- Specified by:
appliesTo in interface CompilerOption<CppCompiler>
- Parameters:
compiler - the compiler for which we're asking.phase - the compiler phase we're executing.
- Returns:
calculateRcFile
public java.io.File calculateRcFile(CppCompiler compiler)
creates
public 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.
- Specified by:
creates in interface FileCreating<CppCompiler>
- Parameters:
compiler - the compiler.phase - the compilation phase.
- Returns:
- a list of files, possibly empty.
satisfies
public boolean satisfies(TerpContext ctx)
- Description copied from interface:
CompilerOption
- Returns true if both conditions are met within the given terp context.
- Specified by:
satisfies in interface CompilerOption<CppCompiler>
- Parameters:
ctx - the terp context in which the logical expressions are evaluated.
- Returns:
- true or false.
addText
public void addText(java.lang.String msg)
- Overrides:
addText in class org.apache.tools.ant.taskdefs.Echo
execute
public void execute()
throws org.apache.tools.ant.BuildException
- Overrides:
execute in class TerpEcho
- Throws:
org.apache.tools.ant.BuildException
Copyright © 2008-2012 by Codemesh, Inc. All Rights Reserved.