Reputation: 15042
I am using the android ant build for the first time. I have some libraries that override the libraries in the Android code. I can control the build order in Eclipse and everything works fine. When I build using the ant build, it appears to be importing the android libraries first before my overrides, which is causing compile errors because of missing constants, method names, etc.
Is there a way I can put my libraries ahead of the android ones so it will build correctly?
Upvotes: 0
Views: 321
Reputation: 15042
After much searching (and the useless Motorola docs) I found a way to get my jars in front of android while still using the default build.xml file.
The android libraries come into the javac task as the bootclasspathref. This gets evaluated ahead of the standard jars, which is why I was having a problem.
Some research later, I see that compilerarg on the javac task is set to ${java.compilerargs}. I did some reading on the build.xml in my project that calls the default build.xml and it tells you how to override things in the default build.xml. So, at the end of the day, I changed three lines:
<!-- version-tag: custom -->
<!-- add the custom bluetooth libraries ahead of Android -->
<property name="java.compilerargs" value="-Xbootclasspath/p:/home/thomash/svn/air-android/branches/ticket_2198a/libs/BluetoothGatt.jar:/home/thomash/svn/air-android/branches/ticket_2198a/libs/BluetoothGattService.jar" />
The change to version-tag is important so android doesn't automatically destroy your changes on an upgrade.
Upvotes: 1