Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ajdt-dev] Android with AspectJ and building it with Ant on Eclipse

I took a bit of a look at your situation.  It is expected that aspects
coming in from the aspect path will have warnings on all the advices.
This is because the aspect project itself does not know that it is on
the aspect path of any other project.  However, if you open your
target project, you will see that the appropriate targets have aspectj
gutter markers.    This project does know about aspects coming from
the aspect path.

So, take a look at your target project, and if you see aspectj gutter
markers, then things should be working appropriately.  However, I
don't really know how the android compiler works.  There may be some
extra code generation going on.  It may work on source code, not byte
code and will therefore not know how to handle aspects.



On Fri, Dec 9, 2011 at 11:26 AM, Sam Xiao <s.xiao@xxxxxxxxxxxxxxx> wrote:
> Hi all,
>
>
>
> Nice to meet everyone here!
>
>
>
> I'm new to Android and wanted to use AspectJ with it. I had searched couple
> articles online and follow the instruction to have it working:
> http://blog.punegtug.org/2010/11/adding-aspect-to-android.html
>
>
>
> But I wanted to know whether if it's possible to separate the aspects away
> from the Android project. In the tutorial link above, it has both the
> Android App and the aspects inside the same project, but in many cases, we
> wanted to leave the Android Project untouched in its isolating spaces.
>
>
>
> Let said I have AndroidProject in my Eclipse workspace, I would like to
> create a separate projects for my aspects called something like
> "AndroidAspectProject" which only contains the aspects for it.
>
>
>
> I'm not sure whether this would work because it seems we need to let AspectJ
> compiler inject point cuts and advices to the .class files before creating
> the .dex files. In this sense, I may not able to do it in a separate
> project.
>
>
>
> Does anyone try with this?
>
>
>
> Another related question would be: Is it possible to have Ant build the
> AndroidProject with AND without aspects on it? Can this be done outside of
> Eclipse?
>
> I'm looking for a way to build different flavours as I'm only injecting
> pointcuts into the AndroidProject on dev/debug build, but will leave it
> untouched on release build.
>
>
>
> I had already asked such question on Stackoverflow:
> http://stackoverflow.com/questions/8409425/android-with-aspectj-and-building-it-with-ant-on-eclipse
>
> But I’m still stuck to finding the best way to handle my case of building
> AspectJ libraries used in Android Project.
>
>
>
> Andrew Eisenberg (thanks to him, the person who recommended me using this
> mailing list) already provided some advices to my question, however, it
> doesn’t really quite working for me as I had errors when I put my *.aj as a
> separate projects in the workspace in Eclipse.
>
>
>
>
>
> Thanks in advanced for any answers for this!
>
>
>
>
>
> Thanks.
>
> Sam Xiao.
>
> Office: 1-408-324-3760
>
>
>
>
> _______________________________________________
> ajdt-dev mailing list
> ajdt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/ajdt-dev
>


Back to the top