views:

147

answers:

3

I asked this question on the android-developers group but didn't get any response, so I thought I'd try here.

The ADT eclipse plugin seems to have a pretty rigid idea of how an Android project should be structured - per http://developer.android.com/guide/developing/eclipse-adt.html, it needs to have the AndroidManifest.xml file at the root level of the project, plus res, assets, gen and src folders at the top level, and so on.

I'm wondering if it's possible to get the plugin to be a little more flexible with the layout it recognizes. In particular, I've been using a build plugin for the (scala-based) simple-build-tool, which expects projects to be laid out in a more Maven-like fashion, like so:

src/
  main/
    AndroidManifest.xml
    assets/
    res/
    scala/
    java/
  test/
    resources
       <files to include in test jar here>
    scala/
       <test Scala sources>
    java/
       <test Java sources>

(see the simple-build-tool docs).

This is a layout I'm used to from maven-based java development. When I load a project like it up in ADT, though, I get a lot of complaints about a missing AndroidManifest.xml, a missing res directory, and so on. These things are all present, they just aren't where ADT expects them to be.

I don't necessarily need to use ADT to build my project, but I'd like to use it (and Eclipse) for editing. Can anybody tell me whether it's possible to make it more flexible in the directories it uses to find various Android-related resources?

Also, can anyone tell me whether the ADT plugin is open-source? I can't seem to find a link to its source code anywhere.

(As a note, I've also been trying to wrangle sbt to just do things in a way that ADT likes, and it's probably possible to do but it seems very tedious.)

+1  A: 

Here's is where you can find the ADT source for r3 0.94, couldn't find the latest though

curtisk
+1  A: 

I do not believe you can change the Android project structure and have ADT understand it. It would be "very tedious" to do that even with the Ant-based command-line builds -- you'd have to make your own copy of the various Android Ant tasks, modify them to suit (and hope the underlying build tools allow what you want), then maintain them forever in the face of Android SDK updates.

Your structure is actually fairly close to the Android expectation, if you consider main/ to be the Android project. If you can convince sbt to allow src/ instead of java/ there, and if sbt won't complain about the resulting bin/ and gen/ you will wind up with in main/ after a compile, you might get it to work.

CommonsWare
A: 

Tim, Matt, you working? You are hard to find. I don't know what happened, your email address stopped working. It has been a while. You can reach me at [email protected] for the sake of this public site. Or, [email protected].

Matthew Carlson