Class LarkBatisPlugin
- All Implemented Interfaces:
org.gradle.api.Plugin<org.gradle.api.Project>
-Alarkbatis.mapperDir to compileJava and registers
the XML files as compile inputs, so editing a mapper file recompiles the
mappers. The plugin exists because the Filer.getResource spec does
not guarantee access to src/main/resources — a build-tool plugin is
the reliable way to hand the processor a real directory path.
It also passes -parameters, which is not a convenience. Gradle's
incremental annotation processing re-runs an aggregating processor over
unchanged mappers from their class files, where a parameter name
survives only if that flag was on; without it the first clean build resolves
#{name} and the next incremental build fails on arg0. Wiring
this by hand is exactly the step a consuming build forgets, which is why the
plugin does it.
Also registers larkbatisScan, which reports what migrating a
MyBatis codebase to LarkBatis would cost. It runs the scanner in its own
JVM off a detached configuration, so neither the scanner nor the processor
ever touches the application's classpath.
All code generation stays inside javac (larkbatis-processor);
this plugin never generates sources itself and adds nothing to the
application's runtime classpath.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
LarkBatisPlugin
public LarkBatisPlugin()
-
-
Method Details
-
apply
public void apply(org.gradle.api.Project project) - Specified by:
applyin interfaceorg.gradle.api.Plugin<org.gradle.api.Project>
-