Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-dev] hasDelta, Scanner when plugin checks for stale already?

No, it is not currently possible to reliably detect if you are in proper
incremental build environment or not. The closest you can get currently
is to check if buildContext instanceof DefaultBuildContext.

On a related subject. We looked at more elaborate build avoidance API
and implementation as part of our etesla project [1]. It implements very
advanced logic to track source to output mapping and is able to reliably
determine when output needs to be rebuilt or deleted. We plan to
integrate this into m2e eventually, but I can't tell when this is going
to happen.

[1] https://github.com/etesla/tesla-build-avoidance

--
Regards,
Igor

On 11-12-22 2:11 AM, Pino Silvaggio wrote:
I am trying to port my xmlbeans connector directly into the codehaus
xmlbeans plugin
using the build-api.

However, the plugin already looks for stale files before it builds.

My concern is, the buildContext hasDelta or the Scanner should still be
used
in case the stale flag is false, as there still might be a chance there
is a delta.
I guess, we shouldn't assume?

Anyways, my question, is there a way to check if the buildContext is the
default
which always returns true for deltas or should I just use instanceof to
verify this?

My logic would be, if it is not stale and it's not the default
buildContext then use
the Scanner otherwise don't use the buildContext as it will always
return true.

We could remove the check for stale but I'd have to discuss this...



Back to the top