Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0047174Openbravo ERPA. Platformpublic2021-06-17 15:372021-06-21 13:59
shuehner 
shuehner 
normalminorhave not tried
closedfixed 
5
 
PR21Q3 
Core
No
0047174: Simplify (and speedup) ant generate.entities* by simplifying calling sequence, fix incremental compile
The current internal calling sequence for i.e. ant generate.entities.forked is overly complicated.

ant task build.xml -> src/build.xml -> <java fork=yes GenerateEntitiesTask>
Then this new JVM running in main method is using AntExecutor
to run new ant instance calling into build.xml -> src/build.xml to call same GenerateEntitiesTask (now as ant-task) again

That is quite some extra overhead for no benefit.

Additionally it seems to take 2-3 extra seconds to reach the execute() method (compared to doing the work directly in the main() method.

Second topic is slightly broken incremental compile for both
- compile.src.gen compiling 4 files over and over again (even without changes)
- generate.entities.quick compiling 1 file always (even without changes)
trace calls from "ant generate.entities" in main build.xml until you read the 'execute()' method in the GenerateEntitiesTask
Remove the extra calling of the code via ant-task and just do the work directly in the main method.

Done consistent as with (nearly) all other files we have using java + fork=yes
No tags attached.
related to defect 0047193 closed shuehner api-change GenerateEntitiesTask does no longer extends ant Task 
Issue History
2021-06-17 15:37shuehnerNew Issue
2021-06-17 15:37shuehnerAssigned To => shuehner
2021-06-17 15:37shuehnerModules => Core
2021-06-17 15:37shuehnerTriggers an Emergency Pack => No
2021-06-17 15:38shuehnerTypedefect => feature request
2021-06-17 16:02shuehnerSummarySimplify (and speedup) ant generate.entities* by simplifying calling sequence => Simplify (and speedup) ant generate.entities* by simplifying calling sequence, fix incremental compile
2021-06-17 16:02shuehnerDescription Updatedbug_revision_view_page.php?rev_id=22743#r22743
2021-06-17 16:18hgbotNote Added: 0129619
2021-06-21 13:59hgbotNote Added: 0129690
2021-06-21 13:59hgbotResolutionopen => fixed
2021-06-21 13:59hgbotStatusnew => closed
2021-06-21 13:59hgbotFixed in Version => PR21Q3
2021-06-21 13:59hgbotNote Added: 0129691
2021-06-21 13:59hgbotNote Added: 0129692
2021-06-21 14:03shuehnerRelationship addedrelated to 0047193

Notes
(0129619)
hgbot   
2021-06-17 16:18   
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/401 [^]
(0129690)
hgbot   
2021-06-21 13:59   
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/401 [^]
(0129691)
hgbot   
2021-06-21 13:59   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: f8a55d961836627ef94879928780994be045d052
Author: Stefan Huehner <stefan.huehner@openbravo.com>
Date: 2021-06-17T15:38:53+02:00
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/f8a55d961836627ef94879928780994be045d052 [^]

Fixes ISSUE-47174. Simplify & speed up calling generate.entities*

Change GenerateEntitiesTask to directly to the work in its main method
instead of calling into AntExecutor and getting called again as an ant
task.

That simplifies both the build.xml & src/build.xml by removing the
additional generate.entities.quick.forked target as well as simplifes
the java code slightly.
Extra benefit is shaving of 2-3 seconds of runtime of
generate.entities.quick call which is called indirectly by various other
build tasks.

Side-effect:
Stop supporting the obsolete friendlyWarning flag which is not set anymorr
after the MMC rebuild popup removal.

---
M build.xml
M src/build.xml
M src/org/openbravo/base/gen/GenerateEntitiesTask.java
---
(0129692)
hgbot   
2021-06-21 13:59   
Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: bfa9f2dc48119d9675fd275fb619b5b3411517e1
Author: Stefan Huehner <stefan.huehner@openbravo.com>
Date: 2021-06-17T16:03:11+02:00
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/bfa9f2dc48119d9675fd275fb619b5b3411517e1 [^]

ISSUE-47174. Fix incremental compile near generate.entities.quick

Similar to issue 20416 also compile.src.gen & generate.entities.quick
had same bug causing to recompile files in modules/* always.

Fix that by ensuring the include part of javac call only matches the
path matching the javapackage of the source files.

- Specifically for compile.src.gen:
  - Remove the modules/*/src part which is supposed to match the src
    subfolder in any present module.
    Replace it by dirset entry matching the needed src subfolder
    separately.
- For the javac call at the end of generate.entities.quick split the
  srcdir attributed by a separate entry. Goal is the same to change from
  the ${base.modules} to a dirset matching the src folders properly

---
M src/build.xml
---