Commit Graph

19 Commits

Author SHA1 Message Date
Saulo José Gil 2b4a2be5a2
IDEMPIERE-4842 Easier model registration (#893)
* IDEMPIERE-4842 Easier model registration

- Change from https://github.com/atteo/classindex to
https://github.com/classgraph/classgraph, remove annotation processor
config.

- Change service.ranking of DefaultModelFactory to -1 and
service.ranking of AnnotationBasedModelFactory to 0. This give
AnnotationBasedModelFactory higher priority over DefaultModelFactory and
allow plugins to have higher priority over AnnotationBasedModelFactory
with server.ranking of 1 (the common practise before the introduction of
AnnotationBasedModelFactory).

- Added resultset constructor to MTree. This is to allow the use of
MTree with model factory.

- Remove classindex annotation from org.adempiere.base.Model and X_*
model classes.

- Added unit test for table to model class mapping

- AnnotationBasedModelFactory: Change from using annotation processor to
runtime annotation scanning using the classgraph library. The default
setting scans all the X_* model class and travels the inheritance
hierarchy to discover the M* model class. Plugin needs to create a
subclass of AnnotationBasedModelFactory and register it as an OSGi
component to scan the plugin's annotated model classes (the plugin's
custom AnnotationBasedModelFactory component should have service.ranking
> 0).

* IDEMPIERE-4842 Easier model registration

minor refinement

* Minor changes

Co-authored-by: hengsin <hengsin@gmail.com>
2021-09-22 22:42:51 +08:00
hengsin 5413f0c11d
IDEMPIERE-4842 Easier model registration (#888)
* IDEMPIERE-4842 Easier model registration

- Temporary disable AnnotationBasedModelFactory until getSubclasses()
doesn't work for subclass from different package is resolve.

* IDEMPIERE-4842 Easier model registration

- turn of annotation processing in editor which causes slow editor
performance
2021-09-19 13:16:53 +08:00
Saulo José Gil 602e450a93
IDEMPIERE-4842 Easier model registration (#877)
* Preliminary support for automatic model class registration

Model classes can be tagged with a new @Model annotation that allows for
easy/fast class scanning/registration, based on the ClassIndex library.
The list of annotated model classes is generated at compile time, thus
reducing reflection reliance to a bare minimum.

NOTE: Eclipse uses its own Java compiler which is not strictly standard
compliant and requires extra configuration. In Java Compiler ->
Annotation Processing -> Factory Path you need to add ClassIndex jar
file

* Annotation based model factory

* Improve classloader determination for annotation scanning

ClassIndex default annotation scanning method determines the classloader
to be used by calling Thread.currentThread().getContextClassLoader(),
which should not be used in an OSGi environment.

* Enable ClassIndex's annotation processor under Eclipse

Make sure annotation processing is enabled at Module Properties -> Java
Compiler -> Annotation Processing

* Refactoring annotation-based model class detection

Eliminated the need of annotating M* classes, by using ClassIndex's
@IndexSubclasses annotation.

* Minor change

* Minor changes

* Creation of AbstractModelFactory

* Documentation

* Make AnnotationBasedModelFactory extend AbstractModelFactory

* IDEMPIERE-4842 Easier model registration

- add annotation processor jdt settings
- fix @Component annotation for AnnotationBasedModelFactory
- fix generated x_* class missing "org.atteo.classindex.IndexSubclasses"
import

* Expose ClassIndex lib to other bundles

* Updated model classes

Co-authored-by: hengsin <hengsin@gmail.com>
2021-09-18 13:35:57 +08:00
hengsin 1971b4f0dc
IDEMPIERE-4488 Remove .classpath from repository (#607)
* IDEMPIERE-4488 Remove .classpath from repository

* IDEMPIERE-4488 Remove .classpath from repository

add ignore for .classpath

* IDEMPIERE-4488 Remove .classpath from repository

remove ".settings/org.eclipse.jdt.core.prefs"

* IDEMPIERE-4488 Remove .classpath from repository

fix false status report for /bin and .project
2021-03-03 00:02:03 +01:00
hengsin 0f263f1c79
IDEMPIERE-4675 Add model factory base class backed by Map and Lambda … (#555)
- added interface and default mapped model factory service
- added unit test for default mapped model factory service
2021-02-01 15:29:13 +01:00
Carlos Ruiz 37e82005b5
IDEMPIERE-4329 Cleanup eclipse warnings (#107)
* IDEMPIERE-4329 Cleanup eclipse warnings

Clean unused imports

* IDEMPIERE-4329 Cleanup eclipse warnings

Clean some additional warnings
Make org.adempiere.base to respect the Warnings/Errors level configuration from workspace

* IDEMPIERE-4329 Cleanup eclipse warnings

One more unused import caused by the previous commit
2020-06-09 12:26:36 +02:00
hieplq 9a35f2054d
IDEMPIERE-4314:eclipse project setting independent JDK (#90) 2020-06-01 11:30:00 +08:00
hengsin c3cad0d1e2
IDEMPIERE-4249 Platform Refresh for 7.1z (#19)
Upgrade to Tycho 1.7.0, Eclipse 2020-03, Zk 9.0.1 and Jetty 9.4.28
2020-04-30 16:01:19 +02:00
hieplq 6c76b7e4b8 IDEMPIERE-3808:collect info to move idempiere to jdk-11 (update lib j2ee take out from jdk)
this commit by auto adjust from eclipse (exclude server.product.launch)

== setup eclipse like bellow to get stable build ==
1. keep eclipse at Eclipse 2018-09 (https://www.eclipse.org/downloads/packages/release/2018-09/r)
2. install "java-11-support-eclipse" https://marketplace.eclipse.org/content/java-11-support-eclipse-2018-09-49
3. call update "help/check for update"
4. now that eclipse full support jdk-11 and build stable without any issue

ref:https://groups.google.com/d/msg/idempiere/At6xXFyEcGY/IJ1ETiohCwAJ
2018-12-28 15:11:11 +07:00
hieplq 942800418e IDEMPIERE-3808:collect info to move idempiere to jdk-11 (zk8.6.0.1, eclipse-1812, java11, tycho 1.3)
still use local repository for maven.to.p2 to continue update library
2018-12-22 15:49:50 +07:00
hieplq a0f7e977fe IDEMPIERE-3798:Move iDempiere default branch to openjdk 10 (update maven project/build/poi)
run auto update maven projec (side effect from 15ccf00c09f5)
also help resolve build maven by jdk 10:
        https://bugs.eclipse.org/bugs/show_bug.cgi
        https://bugs.eclipse.org/bugs/show_bug.cgi?id=537016

now targetplatform have two version of poi but eclipse bind to lower version, so add package dependency to force it
2018-10-25 06:59:03 +07:00
hieplq 82c8c5b31d IDEMPIERE-3798:Move iDempiere default branch to openjdk 10
change targetPlatform and classpath to JavaSE-10
2018-10-16 07:08:34 +07:00
hieplq 31ad04d7ef IDEMPIERE-3531:auto update by eclipse when import project to new workspace by choose import exists maven project 2018-02-18 23:41:09 +07:00
hieplq 9482f02dec IDEMPIERE-3531:add maven tycho configuration 2018-02-10 16:42:06 +07:00
hieplq d7808da56a IDEMPIERE-3531:setting output build, jdk follow project convert from pure plugin to maven
a mavent project convert from plugin have flow default rule
   1. maven project prefer setting JRE to Execution environment, so .classpath is updated
   2. java class compliment to target/classes/, so build.propertie is updated
   3. JDK compliance configuration setting per project (only this option), so .settings/org.eclipse.jdt.core.prefs is created

extra setting about warning done manual to resolved
https://bugs.eclipse.org/bugs/show_bug.cgi?id=367431

   it happend on bundle use non-standard java package
      org.adempiere.base/.settings/org.eclipse.jdt.core.prefs
      org.adempiere.ui.swing/.settings/org.eclipse.jdt.core.prefs

   on org.adempiere.server, old method add accessrules to classpathentry don't work for maven build.
   so change to warning method make it consitent with other
      org.adempiere.server/.settings/org.eclipse.jdt.core.prefs
2018-02-03 01:39:47 +07:00
hieplq 83faad6612 IDEMPIERE-3510:clear facet on project metadata 2017-10-18 19:46:42 +07:00
hieplq 4ae72bb050 IDEMPIERE-3136:all stuff relate library of idempiere
because each project don't have partical build setting, so let control from workspace
2016-07-07 10:14:33 +07:00
Heng Sin Low 0b2fbe27ae IDEMPIERE-2245 Platform Upgrade for r3. 2014-10-13 11:05:19 +08:00
Heng Sin Low 83715fa436 Refactoring to make project and folder name the same as the bundle symbolic name. Migrate to use eclipse feature and product configuration ( build is broken, to fix later ) 2010-09-29 15:25:34 +08:00