- All Implemented Interfaces and Traits:
- CommandLineArgumentProvider
@groovy.transform.CompileStatic
class BaseDirArgumentProvider
extends java.lang.Object
implements CommandLineArgumentProvider
Supplies -Dbase.dir=<projectDir> to a forked Groovy compiler so the
GlobalGrailsClassInjectorTransformation AST transform resolves the correct project
directory when generating META-INF/grails.factories / grails-plugin.xml.
This mirrors GrailsAppBaseDirProvider from the Grails Gradle plugins, which is not on
this build's classpath (build-logic is a separate, unpublished build). It is applied to EVERY
module of this multi-project build so that every Groovy compile requests its own base.dir.
That is what keeps the value correct: Gradle reuses a forked compiler daemon for a task whose
requested fork arguments the daemon already satisfies, so a compile that requests no
base.dir can be handed a daemon started for another module and inherit that module's
value. When every compile requests its own unique base.dir, daemons partition per project
and the value can never leak across modules.
The directory is Internal (not an @InputDirectory) because the project
directory contains the task's own output directories; the real cache-relevant inputs (sources,
classpath) are already tracked by the compile task.