[
https://issues.apache.org/jira/browse/FINERACT-1198?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17467546#comment-17467546
]
Petri Tuomola commented on FINERACT-1198:
-----------------------------------------
So as I assumed, splitting the enhanced / JPA files to a different project did
not work - there is too much business logic mixed in. However, I found a way to
run the enhancer without triggering a full rebuild. The key is to run it as
doLast() of the compileJava task, not as a separate task. If it's separate task
then compileJava will think its outputs have been changed - but this does not
happen if it's part of the same task.
Unfortunately running enhance as a separate task is hardcoded into the OpenJPA
plug-in, so I had to ditch that and write custom code into our build.gradle to
run the enhancer. The good news is that this now works. The only task that is
now running as "full build" is spotlessJava which - for some reason - always
thinks it's input parameter "steps" has changed, and this triggers a rebuild.
Something to investigate...
Another possible improvements:
* Enhance currently runs for all domain class files, not just for the ones
modified. This is not really a problem as it takes only a second or so, but it
would be of course nice just to run it for the modified ones.
* I'm pretty sure my "custom enhance" task has broken Eclipse enhance task.
Next will need to see how to get that working again.
> Gradle incremental build is broken
> ----------------------------------
>
> Key: FINERACT-1198
> URL: https://issues.apache.org/jira/browse/FINERACT-1198
> Project: Apache Fineract
> Issue Type: Bug
> Components: Build
> Reporter: Michael Vorburger
> Assignee: Petri Tuomola
> Priority: Blocker
>
> One of the reasons why Gradle is (supposedly) so much cooler than e.g. Maven
> is that it can be really support and support very fast "incremental" builds
> (only rebuild what has changed).
> I have the impression that doesn't really work in Fineract, and suppose
> that's not really Gradle's (core) fault, but some plugin which screws this
> up? OpenJPA Enhancer, SpotBugs... presumably they all have to "play along"
> for this to work perfectly?
> My Gradle foo isn't (nearly) good enough to know if it would be possible to
> "fix" this, and how hard this may be, but filing an issue is perhaps a start
> for getting input from people more knowledgeable about this.
> [~aleks] and/or [~ptuomola] perhaps you have ideas about this.
> [~aalmiray] as per chat during ApacheCon, not sure if this is the kind of
> thing you may enjoy helping with?
--
This message was sent by Atlassian Jira
(v8.20.1#820001)