org.apache.maven.dotnet.executable.impl
Class CompilerContextImpl

java.lang.Object
  extended by org.apache.maven.dotnet.executable.impl.CompilerContextImpl
All Implemented Interfaces:
CompilerContext, NMavenContext, org.codehaus.plexus.logging.LogEnabled

public final class CompilerContextImpl
extends java.lang.Object
implements CompilerContext, org.codehaus.plexus.logging.LogEnabled

Provides an implementation of the Compiler Context.

Author:
Shane Isbell

Field Summary
 
Fields inherited from interface org.apache.maven.dotnet.executable.compiler.CompilerContext
ROLE
 
Constructor Summary
CompilerContextImpl()
           
 
Method Summary
 void enableLogging(org.codehaus.plexus.logging.Logger logger)
           
 Repository find(java.lang.String repositoryName)
          This method is used to obtain an instance of a Repository specified within the registry-config.xml file.
 java.io.File getArtifact()
          This method will return a File where File.isExist() returns false, if NetCompile.compile has not been invoked.
 CommandFilter getCommandFilter()
          Creates a command filter.
 CompilerCapability getCompilerCapability()
          Return the CompilerCapability associated with this context.
 CompilerExecutable getCompilerExecutable()
          Returns an instance of the NetExecutable appropriate for given language/vendor/OS.
 CompilerRequirement getCompilerRequirement()
          Requirements used to match the compiler plugin associated with this context.
 java.util.List<java.lang.String> getCoreAssemblyNames()
          Returns assembly names that should be referenced by the compiler.
 java.util.List<org.apache.maven.artifact.Artifact> getDirectModuleDependencies()
          Returns a list of module (netmodule) dependencies that exist directly within the invoking projects pom (no transitive module dependencies).
 java.util.List<java.io.File> getEmbeddedResources()
          Returns a list of resources that the compiler should embed in the compiled assembly.
 KeyInfo getKeyInfo()
           
 java.util.List<org.apache.maven.artifact.Artifact> getLibraryDependencies()
          Returns a list of library (dll) dependencies of the class files.
 java.util.List<java.io.File> getLinkedResources()
          Returns a list of resources that the compiler should link to the compiled assembly
 org.codehaus.plexus.logging.Logger getLogger()
          Returns Maven Plexus logger: Log.
 java.util.List<org.apache.maven.artifact.Artifact> getModuleDependencies()
          Returns a list of module (netmodule) dependencies of the class files.
 CompilerConfig getNetCompilerConfig()
          Returns the user provided configuration associated to this context.
 java.lang.String getSourceDirectoryName()
          Returns the source directory (or test source directory) path of the class files.
 java.io.File getTargetDirectory()
           
 java.io.File getWin32Icon()
          Returns the icon that the assembly should display when viewed.
 java.util.List<java.io.File> getWin32Resources()
          Returns a list of win32 resources.
 void init(CompilerRequirement compilerRequirement, CompilerConfig config, org.apache.maven.project.MavenProject project, CapabilityMatcher capabilityMatcher)
          Initializes the context
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompilerContextImpl

public CompilerContextImpl()
Method Detail

getLinkedResources

public java.util.List<java.io.File> getLinkedResources()
Description copied from interface: CompilerContext
Returns a list of resources that the compiler should link to the compiled assembly

Specified by:
getLinkedResources in interface CompilerContext
Returns:
a list of resources that the compiler should link to the compiled assembly

getEmbeddedResources

public java.util.List<java.io.File> getEmbeddedResources()
Description copied from interface: CompilerContext
Returns a list of resources that the compiler should embed in the compiled assembly. These may of any mime-type or it may be a generated .resource file.

Specified by:
getEmbeddedResources in interface CompilerContext
Returns:
a list of resources that the compiler should embed in the compiled assembly.

getWin32Icon

public java.io.File getWin32Icon()
Description copied from interface: CompilerContext
Returns the icon that the assembly should display when viewed. Should not be used in conjunction with win32res.

Specified by:
getWin32Icon in interface CompilerContext
Returns:
the icon that the assembly should display when viewed.

getWin32Resources

public java.util.List<java.io.File> getWin32Resources()
Description copied from interface: CompilerContext
Returns a list of win32 resources. Should not be used in conjunction with win32icon.

Specified by:
getWin32Resources in interface CompilerContext
Returns:
a list of win32 resources.

enableLogging

public void enableLogging(org.codehaus.plexus.logging.Logger logger)
Specified by:
enableLogging in interface org.codehaus.plexus.logging.LogEnabled

getCompilerRequirement

public CompilerRequirement getCompilerRequirement()
Description copied from interface: CompilerContext
Requirements used to match the compiler plugin associated with this context.

Specified by:
getCompilerRequirement in interface CompilerContext
Returns:
Requirements used to match the compiler plugin associated with this context.

getCoreAssemblyNames

public java.util.List<java.lang.String> getCoreAssemblyNames()
Description copied from interface: CompilerContext
Returns assembly names that should be referenced by the compiler. If the List is emtpy, then all core assemblies should be includes. These are assemblies that are not standard dependencies, but are system assemblies that replace the core .NET framework assemblies (used to create profiles)

Specified by:
getCoreAssemblyNames in interface CompilerContext
Returns:
assembly names that should be referenced by the compiler.

getModuleDependencies

public java.util.List<org.apache.maven.artifact.Artifact> getModuleDependencies()
Description copied from interface: CompilerContext
Returns a list of module (netmodule) dependencies of the class files.

Specified by:
getModuleDependencies in interface CompilerContext
Returns:
a list of module (netmodule) dependencies of the class files.

getDirectModuleDependencies

public java.util.List<org.apache.maven.artifact.Artifact> getDirectModuleDependencies()
Description copied from interface: CompilerContext
Returns a list of module (netmodule) dependencies that exist directly within the invoking projects pom (no transitive module dependencies).

Specified by:
getDirectModuleDependencies in interface CompilerContext
Returns:
a list of module (netmodule) dependencies of the class files.

getKeyInfo

public KeyInfo getKeyInfo()
Specified by:
getKeyInfo in interface CompilerContext

getLibraryDependencies

public java.util.List<org.apache.maven.artifact.Artifact> getLibraryDependencies()
Description copied from interface: CompilerContext
Returns a list of library (dll) dependencies of the class files.

Specified by:
getLibraryDependencies in interface CompilerContext
Returns:
a list of library (dll) dependencies of the class files.

getLogger

public org.codehaus.plexus.logging.Logger getLogger()
Description copied from interface: NMavenContext
Returns Maven Plexus logger: Log.

Specified by:
getLogger in interface NMavenContext
Returns:
the plugin logger

getNetCompilerConfig

public CompilerConfig getNetCompilerConfig()
Description copied from interface: CompilerContext
Returns the user provided configuration associated to this context. This is a live copy, so any changes to the config will be reflected during compilation.

Specified by:
getNetCompilerConfig in interface CompilerContext
Returns:
the user provided configuration associated to this context

getCompilerCapability

public CompilerCapability getCompilerCapability()
Description copied from interface: CompilerContext
Return the CompilerCapability associated with this context.

Specified by:
getCompilerCapability in interface CompilerContext
Returns:
the CompilerCapability associated with this context.

getSourceDirectoryName

public java.lang.String getSourceDirectoryName()
Description copied from interface: CompilerContext
Returns the source directory (or test source directory) path of the class files. These are defined in the pom.xml by the properties ${build.sourceDirectory} or ${build.testSourceDirectory}.

Specified by:
getSourceDirectoryName in interface CompilerContext
Returns:
Returns the source directory (or test source directory) path of the class files.

getTargetDirectory

public java.io.File getTargetDirectory()
Specified by:
getTargetDirectory in interface CompilerContext

getArtifact

public java.io.File getArtifact()
                         throws InvalidArtifactException
This method will return a File where File.isExist() returns false, if NetCompile.compile has not been invoked.

Specified by:
getArtifact in interface CompilerContext
Returns:
Throws:
InvalidArtifactException

getCompilerExecutable

public CompilerExecutable getCompilerExecutable()
                                         throws ExecutionException
Description copied from interface: CompilerContext
Returns an instance of the NetExecutable appropriate for given language/vendor/OS.

Specified by:
getCompilerExecutable in interface CompilerContext
Returns:
an instance of the NetExecutable appropriate for given language/vendor/OS.
Throws:
ExecutionException - if there is a problem finding an appropriate executable.

getCommandFilter

public CommandFilter getCommandFilter()
Description copied from interface: CompilerContext
Creates a command filter. If the includes parameter is null, then the filter will return all commands that are not in the exlude filters. If the excludes parameter is null, then the filter will only return what is in the includes list. If both parameters are null...

Specified by:
getCommandFilter in interface CompilerContext

find

public Repository find(java.lang.String repositoryName)
                throws RepositoryNotFoundException
Description copied from interface: NMavenContext
This method is used to obtain an instance of a Repository specified within the registry-config.xml file. This method allows the application developer to create configuration files and have them accessible through the NMaven Context. For more information on how the registry/repository works, go to http://jvending.sourceforge.net/registry-cdc/

Specified by:
find in interface NMavenContext
Parameters:
repositoryName - the name of the repository. This name should match the / field within the registry-config.xml file.
Returns:
repository for the specified repository name
Throws:
RepositoryNotFoundException - if repository is not found.

init

public void init(CompilerRequirement compilerRequirement,
                 CompilerConfig config,
                 org.apache.maven.project.MavenProject project,
                 CapabilityMatcher capabilityMatcher)
          throws PlatformUnsupportedException
Description copied from interface: CompilerContext
Initializes the context

Specified by:
init in interface CompilerContext
Throws:
PlatformUnsupportedException


Copyright © 2007 NMaven. All Rights Reserved.