Package: org.codehaus.groovy.grails.project.compiler

## [Groovy] Class GrailsProjectCompiler

- org.codehaus.groovy.grails.project.compiler.GrailsProjectCompiler

- Encapsulates the compilation logic required for a Grails application.

  Authors:
    Graeme Rocher
  Since:
    2.0

- - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `static java.util.List<java.lang.String>` | `EXCLUDED_PATHS` |

  - Inherited fields
    Fields inherited from class | Fields
    --- | ---
    `class BaseSettingsApi` | `appClassName, buildEventListener, buildProps, buildSettings, configSlurper, enableProfile, grailsAppName, grailsHome, isInteractive, metadata, metadataFile, pluginSettings, pluginsHome, resolver`

  - ### Properties Summary

    Properties
    Type | Name and description
    --- | ---
    `java.lang.String` | `basedir`
    `BuildSettings` | `buildSettings`
    `java.lang.ClassLoader` | `classLoader`
    `java.lang.Object` | `commonClasspath`
    `java.lang.Object` | `compileClasspath`
    `java.util.List<java.lang.String>` | `compilerExtensions`
    `org.codehaus.groovy.control.CompilerConfiguration` | `config`
    `java.lang.String` | `encoding`
    `boolean` | `isPluginProject`
    `java.util.Map` | `javaOptions`
    `PluginBuildSettings` | `pluginSettings`
    `java.lang.Object` | `runtimeClasspath`
    `java.util.List<java.lang.String>` | `srcDirectories`
    `java.lang.String` | `srcdir`
    `java.io.File` | `targetClassesDir`
    `java.io.File` | `targetPluginClassesDir`
    `java.lang.Object` | `testClasspath`
    `boolean` | `verbose`

  - ### Constructor Summary

    Constructors
    Constructor and description
    `GrailsProjectCompiler (PluginBuildSettings pluginBuildSettings, java.lang.ClassLoader rootLoader = Thread.currentThread()` Constructs a new GrailsProjectCompiler instance for the given PluginBuildSettings and optional classloader

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `void` | `compile()` Compiles project sources using the target directory passed by PluginBuildSettings
    `void` | `compile(java.lang.Object targetDir)` Compiles project sources to the given target directory
    `void` | `compileAll()` Compiles plugin and normal sources
    `void` | `compileGroovyPages(java.lang.String grailsAppName, java.lang.Object classesDir = targetClassesDir)` Compiles GSP pages for the given application name to the (optional) target directory
    `protected java.lang.Object` | `compilePluginDescriptor(java.io.File descriptor, java.io.File classesDir)` Compiles a given plugin descriptor file - *GrailsPlugin.groovy.
    `void` | `compilePlugins()`
    `void` | `compilePlugins(java.lang.Object targetDir)` Compiles plugin sources files to the given target directory
    `void` | `configureClasspath()` Configures the Grails classpath, should be called prior to any call to compile(Object)
    `groovy.util.AntBuilder` | `getAnt()`
    `java.util.List<java.io.File>` | `getExtraDependencies()` Extra dependencies defined by the 'grails.compiler.dependencies' config option in BuildConfig
    `java.util.List<java.io.File>` | `getJarFiles()` Obtains all JAR files for the project that aren't declared via BuildConfig
    `void` | `reconfigureClasspath()`
    `void` | `setAnt(groovy.util.AntBuilder ant)`
    `void` | `withCompilationErrorHandling(groovy.lang.Closure callable)`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class BaseSettingsApi` | `confirmInput, confirmInput, copyGrailsResource, copyGrailsResource, copyGrailsResources, copyGrailsResources, createXmlSlurper, enableUaa, exit, getAppClassName, getAppGrailsVersion, getBuildEventListener, getBuildProps, getBuildSettings, getConfigSlurper, getGrailsAppName, getGrailsAppVersion, getGrailsHome, getIsInteractive, getMetadata, getMetadataFile, getPluginBuildSettings, getPluginSettings, getPluginsHome, getPropertyValue, getResolver, getServerHost, getServerPort, getServerPortHttps, getServletVersion, grailsResource, isDeclared, isEnableProfile, logError, logErrorAndExit, makeApiAvailableToScripts, makeRelative, makeRelative, profile, readAllPluginXmlMetadata, readPluginXmlMetadata, resolveResources, updateMetadata, updateMetadata`
    `class java.lang.Object` | `java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()`

- - ### Field Detail

    - #### public static final java.util.List<java.lang.String> EXCLUDED_PATHS

  - ### Property Detail

    - #### java.lang.String basedir

    - #### BuildSettings buildSettings

    - #### java.lang.ClassLoader classLoader

    - #### java.lang.Object commonClasspath

    - #### java.lang.Object compileClasspath

    - #### java.util.List<java.lang.String> compilerExtensions

    - #### org.codehaus.groovy.control.CompilerConfiguration config

    - #### java.lang.String encoding

    - #### boolean isPluginProject

    - #### java.util.Map javaOptions

    - #### PluginBuildSettings pluginSettings

    - #### java.lang.Object runtimeClasspath

    - #### java.util.List<java.lang.String> srcDirectories

    - #### java.lang.String srcdir

    - #### java.io.File targetClassesDir

    - #### java.io.File targetPluginClassesDir

    - #### java.lang.Object testClasspath

    - #### boolean verbose

  - ### Constructor Detail

    - #### GrailsProjectCompiler(PluginBuildSettings pluginBuildSettings, java.lang.ClassLoader rootLoader = Thread.currentThread()

      Constructs a new GrailsProjectCompiler instance for the given PluginBuildSettings and optional classloader

      Parameters:
        `pluginBuildSettings` - The PluginBuildSettings
        `rootLoader` - The ClassLoader

  - ### Method Detail

    - #### void compile()

      Compiles project sources using the target directory passed by PluginBuildSettings

    - #### void compile(java.lang.Object targetDir)

      Compiles project sources to the given target directory

      Parameters:
        `targetDir` - The target directory to compile to

    - #### void compileAll()

      Compiles plugin and normal sources

    - #### void compileGroovyPages(java.lang.String grailsAppName, java.lang.Object classesDir = targetClassesDir)

      Compiles GSP pages for the given application name to the (optional) target directory

      Parameters:
        `grailsAppName` - The app name
        `classesDir` - The optional classes dir, defaults to one provided by PluginBuildSettings in constructor

    - #### protected java.lang.Object compilePluginDescriptor(java.io.File descriptor, java.io.File classesDir)

      Compiles a given plugin descriptor file - *GrailsPlugin.groovy.

    - #### void compilePlugins()

    - #### void compilePlugins(java.lang.Object targetDir)

      Compiles plugin sources files to the given target directory

      Parameters:
        `targetDir` - The target directory to compile to

    - #### void configureClasspath()

      Configures the Grails classpath, should be called prior to any call to compile(Object)

    - #### groovy.util.AntBuilder getAnt()

    - #### java.util.List<java.io.File> getExtraDependencies()

      Extra dependencies defined by the 'grails.compiler.dependencies' config option in BuildConfig

      Returns:

    - #### java.util.List<java.io.File> getJarFiles()

      Obtains all JAR files for the project that aren't declared via BuildConfig

      Returns:
        A list of JAR files

    - #### void reconfigureClasspath()

    - #### void setAnt(groovy.util.AntBuilder ant)

    - #### void withCompilationErrorHandling(groovy.lang.Closure callable)