This is rather complex, so it's going to be a bit tricky to answer,
I'm afraid.

It does sound like you've dealt with a lot of the harder issues. I'm
not sure exactly what you mean when you say "flavor you want to
build". Build as in -- produce a .apk, or do you mean Eclipse build,
putting the result onto the device for debugging?

If you mean, you want to trigger a build with a formal output, I urge
you to not consider this to be an Eclipse build, but rather, a matter
of invoking your ant build scripts to produce a .apk, that doesn't
require Eclipse. If you do this -- that is, a standalone, completely
automated build -- it's then trivial to set up an ant external tool
launcher within eclipse, and supply the necessary parameters to select
the form of build you want. Then you can invoke it from within Eclipse
as an external tool, so you do get the convenience of doing it within
Eclipse, but you get the precise control of a standalone ant build.

Things are a bit tricker for building for developing/debugging within
Eclipse. Eclipse can only deal with one set of build results at once.
Worse, it insists on putting the temporary outputs within the actual
project structure (bin/, gen/), so you really have no opportunity to
work around that.

You can set up multiple projects in your revision control system, but
that's a potential source of error and certain source of confusion.

Better is to accept you can only do one thing at once, and set up a
res/xml/mybuild.xml file, and pull information out of here to provide
properties for configuring both build-time decisions and runtime
decisions. I actually prefer not to do this, and just drive build-time
decisions, and build/debug a "development" version that provides a run-
time switch for choosing what mode to operate the runtime in. In that
case, you can simplify the ant scripts by putting the build
configuration information in a build.properties file instead. (Or you
can do both, but I find it better to use a single file for the
purpose).

It's best to set things up so that these configuration files are not
checked in to revision control, or only default values are, and a
separate file of overrides are used.

However you do it, you'll need to set up your builders so they trigger
on changes to these files. Then, when you edit the configuration, your
system will be automatically rebuilt, and you'll see that change in
your next debug run.

Regarding Genera/Project type -- you really don't want that, except
for a top-level shell project. What you want to do is to set up
subprojects, stored within that project, to build each individual type
of asset, and set up the project references accordingly. If necessary,
they can refer to files outside the scope of these subproject
directories via relative paths.

So you'll have an Android project for each .jar and .apk (hacking the
Android projects to produce a .jar file if needed), an android junit
test project for your android unit tests, C++ projects, and one ring
to bind them. Er, I mean, one general project to bind them together.

The APIDemos sample can be set up this way, with a main project and a
tests subproject. I'm not sure why it's not out-of-the-box...

If you get everything set up just right, you'll be able to edit your
local configuration, launch the debugger, and it will make sure that
all your various pieces are compiled with the new configuration
information before launching.

On Apr 14, 3:16 am, Floof <[email protected]> wrote:
> Hello,
>
> In the process of creating a multi-platform 3D engine, I am currently
> having hard times configuring Eclipse properly to handle my project
> structure. What is causing my problems is the fact that my project has
> a fairly complex structure. I'll try to explain:
>
> My test application uses a custom GLSurfaceView (a derivation of
> GLSurfaceView) which is declared and implemented in my SDK. The
> application contains Java and C++ code, and so does the SDK. So, each
> one produces a JAR archive, and a so library. The SDK's so library's C+
> + code is linked against several static libraries (some third-party,
> and 3 internal).
>
> The directory structure is as follows:
>
>     some_dir
>     |-->Products
>     |    |--> MyApp
>     |    |    |--> Src
>     |    |    |    |--> *.cpp & *.java files (in subdirs)
>     |    |    |--> Inc
>     |    |    |    |--> *.h files
>     |    |    |--> Makefiles
>     |    |    |    |--> Android
>     |    |    |    |    |--> Makefile, build.xml, res/,
> AndroidManifest, ...
>     |--> SDK
>     |    |--> Lib1
>     |    |    |--> Src
>     |    |    |    |--> *.cpp files
>     |    |    |--> Inc
>     |    |    |    |--> *.h files
>     |    |    |--> Makefiles
>     |    |    |    |--> Android
>     |    |    |    |    |--> Makefile
>     |    |--> Lib2
>     |    |    |--> Src
>     |    |    |    |--> *.cpp files
>     |    |    |--> Inc
>     |    |    |    |--> *.h files
>     |    |    |--> Makefiles
>     |    |    |    |--> Android
>     |    |    |    |    |--> Makefile
>     |    |--> Lib3
>     |    |    |--> Src
>     |    |    |    |--> *.cpp files
>     |    |    |--> Inc
>     |    |    |    |--> *.h files
>     |    |    |--> Makefiles
>     |    |    |    |--> Android
>     |    |    |    |    |--> Makefile
>     |    |--> MySDK
>     |    |    |--> Src
>     |    |    |    |--> *.cpp & *.java files (in subdirs)
>     |    |    |--> Inc
>     |    |    |    |--> *.h files
>     |    |    |--> Makefiles
>     |    |    |    |-->Android
>     |    |    |    |    |--> Makefile
>
> So long I have been able to build the full bundle using makefiles.
> Each project can be compiled in several flavors (depending on target
> devices hardware capabilities, debug/release mode, OpenGLES1 or
> OpenGLES2 ).
>
> I would like to use the Eclipse IDE for convenience. I have managed to
> import the projects and trigger their build through ant & make
> scripts, but I haven't found a way to easily configure what "flavor" I
> want to build. Also,I can only create my project as "General/Project"
> type, which does not seem to be aware of methods, classes, etc...
>
> Eclipse projects are in the "Makefiles/Android" directories.
>
> What I would like is a way to handle:
>     - source "out-of-project-tree"
>     - android mixed java/c++ projects (JNI + SWIG + so) which are not
> applications
>     - Compile configurations (debug/release, GLES1/GLES2, ...)
>
> Is there any ?
>
> Thanks,
> Florent.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

To unsubscribe, reply using "remove me" as the subject.

Reply via email to