Home | History | Annotate | only in /tools/metalava/stub-annotations
Up to higher level directory
NameDateSize
build.gradle21-Aug-201886
README.md21-Aug-20181.4K
src/21-Aug-2018

README.md

      1 Stub Annotations
      2 
      3 The annotations in these packages are used to compile
      4 the stubs. They are mostly identical to the annotations
      5 in the support library, but
      6 
      7 (1) There are some annotations here which are not in
      8    the support library, such as @RecentlyNullable and
      9    @RecentlyNonNull. These are used *only* in the stubs
     10    to automatically mark code as recently annotated
     11    with null/non-null. We do *not* want these annotations
     12    in the source code; the recent-ness is computed at
     13    build time and injected into the stubs in place
     14    of the normal null annotations.
     15 
     16 (2) There are some annotations in the support library
     17    that do not apply here, such as @Keep,
     18    @VisibleForTesting, etc.
     19 
     20 (3) Only class retention annotations are interesting for
     21    the stubs; that means for example that we don't
     22    include @IntDef and @StringDef.
     23 
     24 (4) We've tweaked the retention of some of the support
     25    library annotations; some of them were accidentally
     26    source retention, and here they are class retention.
     27 
     28 (5) We've tweaked the nullness annotations to include
     29    TYPE_PARAMETER and TYPE_USE targets, and removed
     30    package, local variable, annotation type, etc.
     31 
     32 (6) There are some other differences; for example, the
     33    @RequiresPermission annotation here has an extra
     34    "apis" field used for merged historical annotations
     35    to express the applicable API range.
     36 
     37 Essentially, this is a curated list of exactly the
     38 set of annotations we allow injected into the stubs.
     39 
     40