Add metadata for the dimension annotation, and strip typedefs

The support annotations library is a plain Java library, it's not an
Android library, which means it gets built by the Gradle java plugin,
and packaged as a plain jar file. That means that the typedef
annotations (on VisibleForTesting and Dimension) were getting included
in the .jar file, which is pointless.

This CL removes these classes at build time (and to do that, they had
to be top level classes rather than inner classes; removing inner
classes at packaging isn't safe since the outerclass contains
references to its inner classes). This CL also adds external metadata
information about the Dimension's unit attribute, which was missing.

It's unfortunate that we can't just use the android library build
support that handles all this automatically, but a number of users
like that the annotations library is a plain .jar such that they can
include it not just in their Android apps, but in plain Java modules
as well which are contain shared server and app code.

Change-Id: If6ac38f1e5aad7091001ff3749c804b5c0a2452b
6 files changed