thanks
joersch
(cool project!)
To finally build the *.apk via ant, call the ant target release (type
in command line: ant release). These Task calls the "-pre-build"
target, that you can override in your own build.xml file (or any other
importet *.xml file). Now you have the correct point for generating.
To define a self made ant task is follows to do:
In build.xml define the path to the self written anttask
<path id="androidannotations.antlibs">
<pathelement path="${jar.libs.dir}/
androidannotations-2.1.2.jar" />
</path>
Then define the new Ant Task itself with the new Name
"annotateandroid":
<taskdef name="annotateandroid"
classname="com.googlecode.androidannotations.AnnotationBuilderTask"
classpathref="androidannotations.antlibs" />
Call this task in build.xml:
<target name="-pre-build">
<echo>--------------------------------------------</
echo>
<echo>----------------- Annotate now------</echo>
<echo>--------------------------------------------</
echo>
<annotateandroid/>
</target>
The "com.googlecode.androidannotations.AnnotationBuilderTask" class
inherits from org.apache.tools.ant.Task
In this class can all generating code implementet.
Here is an tutorial to writing Ant-Tasks:
http://ant.apache.org/manual/index.html
Is there everybody they can write such ant-task? It would by realy
useful.
Regards
joersch
On 24 Nov., 08:28, Pierre-Yves Ricau <py.ri...@gmail.com> wrote:
> Hello !
>
> That a really interesting question. I haven't had any report of anyone
> using AndroidAnnotations with Ant yet, so I don't know if it has already
> been done. We documented how to use Maven, and how to do it from Eclipse,
> but I think we should definitely document how to use it with Ant, since
> Android projects come with an Ant task when you create them.
>
> The question we are trying to solve here is : "how to run a java 6
> Annotation Processor with Ant", and "how to integrate that in the Android
> Ant tasks".
>
> Basically, running an annotation processor involves
> giving additional arguments to javac.
>
> It seems that someone found a general solution here :http://stackoverflow.com/questions/3644069/java-6-annotation-processi...
>
> I don't really know how to integrate that in an Android Ant script, because
> I'm not an Ant expert ;-) . Please let us know what you find out, if it
> works or not and why ;-) . And if anyone else can help, of course that's
> welcome!
>
> Thanks for using AndroidAnnotations
>
> 2011/11/22 Joersch <uhlmann.jo...@googlemail.com>
// then the default mechanism.
try {
return ref(Class.forName(fullyQualifiedClassName));
} catch (ClassNotFoundException e1) {
// fall through
}
As you can see, it catches ClassNotFoundException but not NoClassDefFoundError, which you happen to have.