0

I work daily on a large customized version of Android. Our work involves creating new APIs and testing them with our in-house test app. Currently, each person checks out the needed files to make API updates and then requests that I create a new version of the test app that works with their changes. The way I accomplish this, in part, is with a script that grabs their version of the OS files (the ones that declare the APIs) and generates a JAR of these files that is then thrown in the test app's "lib" directory so the test code can reference these new/changed APIs.

I've been able to automate so much of my workflow, but I can't find a way to automate the task of generating the jar from a few .java files that can't be compiled in isolation. I know how to create a jar and manually populate it, but I can't figure out how Eclipse is able to generate .class files for .java input source files that can't be compiled by themselves. The only way that I can currently compile these files is with a multi-hour full OS build, which I don't want to wait on. Also, our build servers don't spit out the individual .class files I would want to zip up in a JAR anyways.

So, does anyone know how to generate a JAR file with .class files compiled from .java src files that appear, by themselves, to be riddled with errors? I currently do this manually with Eclipse's "export project to JAR" ability, but it really irks me that it's the only "non-automate-able" step in my process so far.

I found this, which doesn't handle generation of the .class file(s) from a set of .java files that won't compile alone.

Thanks!

Community
  • 1
  • 1
  • I don't know how off hand, however I would recommend checking out the Eclipse Source code. It's open source and I bet your answer lives in there somewhere. – Nathaniel D. Waggoner Apr 01 '14 at 20:21
  • Could you use the "Save description of this JAR in the workspace" checkbox to save the jar description so that you don't need to manually specify the files to export each time? Or do you export a different set of classes for each user? – Russell Zahniser Apr 01 '14 at 20:24
  • I actually have an eclipse project that contains copies of the files I want to export; my scripts automate populating it with the relevant versions of the files. So right now I open this special project in eclipse, refresh the files, right-click on the project and then hit "Export" and follow the wizard. It's not horrible, but it feels like it when the entire process is automated, except for this step. It also means I can't just export my automation scripts for all to use, but would have to "hold their hand" through this step either way. – user3486659 Apr 02 '14 at 00:25

0 Answers0