2

I currently have a project in a directory named bbct. This contains subdirectories swing, with the Swing version, android with the Android version, and common with code that (possibly) is shared between the two. The swing and common subdirectories are organized as NetBeans projects with nbproject, src, build, and dist subdirectories. The android subdirectory is an Android SDK project with src, res, and gen subsdirectories.

Now I need to make sure that, when I build my Android project, the JAR file in common is built via an Ant script. I believe I can add the necessary information to my android project's Ant script to do this. (I haven't tried yet.) I also need to access the classes in the generated bbct-common.jar from my Android project and included these classes, or the JAR file itself, in the APK file generated for my Android app. How do I do this last part?

Update:

From Ant build scripts, antcall, dependencies, etc, I learned that I can use the <ant> task to make sure my bbct-common.jar file is up-to-date. I also learned from How do I reference external jar files in a common directory (not libs) to build android project using ant?, How to specify lib folder for JARs when using Android-generated ant build file?, and How to build an android app with external libraries using ant? that I need to copy the JAR file to bbct/android/libs. Now my question is, what target do I override in my bbct/android/build.xml file to do this? In particular, I would like to override a single target so that both the debug and release builds call it. Is there a common dependency to these two targets where it is common to do these kinds of tasks?

Community
  • 1
  • 1
Code-Apprentice
  • 81,660
  • 23
  • 145
  • 268

0 Answers0