Ant: Adding custom entries to project.javac.classpath

1,362 views
Skip to first unread message

Pierre-Yves Ricau

unread,
Nov 26, 2012, 9:54:07 AM11/26/12
to adt...@googlegroups.com
Hi,

When using an annotation processor with Ant + Android, we need to configure the "compile" task so that the processor jar is part of "classpathref". We can't just simply put this processor within the lib folder, because the processor is a compile time lib and not a runtime lib, so we don't want the processor to be part of the APK.

We currently have two ways to do this :

* either copy the "compile" task and add a new path to the project.javac.classpath definition (see here)
* or backup "project.all.jars.path" value before compile, add a new path to it, and restore its previous value after "compile" (see here).

Things would be a lot simpler for us if we could extend "project.javac.classpath", either directly, or by having it use a custom empty entry that we can override.

What do you think about this?

I know the future build system will be Gradle, and I can't wait for that to happen. But we will still have to support Ant users...

Cheers,
Py

Xavier Ducrohet

unread,
Nov 26, 2012, 11:50:37 AM11/26/12
to adt...@googlegroups.com
yes we should do something like this. If you were willing to contribute this, it should be easy to accept.

thanks
Xav
--
Xavier Ducrohet
Android SDK Tech Lead
Google Inc.
http://developer.android.com | http://tools.android.com

Please do not send me questions directly. Thanks!

Pierre-Yves Ricau

unread,
Nov 26, 2012, 11:51:35 AM11/26/12
to adt...@googlegroups.com
Reminds me of something.. :)

2012/11/26 Xavier Ducrohet <x...@android.com>

yes we should do something like this. If you were willing to contribute this, it should be easy to accept.

thanks
Xav



--
Pierre-Yves Ricau


Christian Ulrich

unread,
Dec 20, 2012, 3:23:37 PM12/20/12
to adt...@googlegroups.com
Hi Xav


Best regards
Chris
Reply all
Reply to author
Forward
0 new messages