[jboss-jira] [JBoss JIRA] (DROOLS-729) Android Support
Mark Kedzierski (JIRA)
issues at jboss.org
Fri Mar 6 16:00:50 EST 2015
[ https://issues.jboss.org/browse/DROOLS-729?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13047168#comment-13047168 ]
Mark Kedzierski commented on DROOLS-729:
----------------------------------------
I've refactored and rebased this change on master. It is now an addon module called drools-android. The core code checks if it is running within Android by checking the classpath and if drools-android is present in the classpath to load the dex classloader implementations or to use regular ones.
I am working on adding KieContainer support but am still working through issues. There are a lot of complexities. I did manage to get a classpath container loaded from a kmodule.xml file. Issues:
-Dex 65K method limit. Adding all the drools-compiler dependencies and Jaxp implementation pushes this limit. I needed to use proguard but still right at the limit. Could explore multi-dex but that is generally annoying, and raises classloader issues.
-All jars are merged into a single apk file. Which means kmodule.xml files would overwrite each other if there are multiple kjar dependencies. Also currently the pom.properties file is found without using the releaseId as part of it. And the APK will include all the pom.properties files from all dependencies. I used the maven-android-plugin Meta-inf filter to only include the file from the main artifact. Again multiple kjars are a problem.
> Android Support
> ---------------
>
> Key: DROOLS-729
> URL: https://issues.jboss.org/browse/DROOLS-729
> Project: Drools
> Issue Type: Enhancement
> Components: core engine
> Affects Versions: 6.0.1.Final
> Environment: Android
> Reporter: Mark Kedzierski
> Assignee: Mario Fusco
> Priority: Optional
> Labels: Android
>
> I've done some work porting Drools 6.0.1.Final to work on Android. My current effort uses Dex classloaders for all generated classes. Precompiled rule packages execute on Android with either java or mvel dialect.
> code:
> http://www.github.com/kedzie/drools-android
> http://www.github.com/kedzie/drools-android-sample
> Features:
> -Dex classloaders for all generated classes
> -Roboguice integration for injecting knowledge bases from precompiled packages
> -Maven plugin which pre-compiles rule packages
> Issues:
> -Unit tests don't work because it always uses dex classloader, which doesn't work on a desktop system
> -Haven't tested drools-compiler on android platform
> I am wondering how to move forward and contribute this code. I think it would be ideal if the same codebase worked on both desktop and android platforms. Otherwise it would need to be a seperate fork. Also how to manage unit testing in the Android version. Any thoughts welcome.
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
More information about the jboss-jira
mailing list