Skip to content
Snippets Groups Projects
  1. Jan 11, 2019
    • Tor Norbye's avatar
      Add support for merging baselines · 0402e66f
      Tor Norbye authored
      From --help:
      --update-baseline [file] Rewrite the existing baseline file with the
                               current set of warnings. If some warnings have
                               been fixed, this will delete them from the
                               baseline files. If a file is provided, the
                               updated baseline is written to the given file;
                               otherwise the original source baseline file is
                               updated.
      --merge-baseline [file]  Like --update-baseline, but instead of always
                               replacing entries in the baseline, it will merge
                               the existing baseline with the new baseline.
                               This is useful if metalava runs multiple times
                               on the same source tree with different flags at
                               different times, such as occasionally with
                               --api-lint.
      
      Test: Unit test added
      Change-Id: If53a3df2d2a4b973de63babda981666c78d47133
      0402e66f
  2. Jan 03, 2019
    • Tor Norbye's avatar
      Add API lint to metalava · 4150065b
      Tor Norbye authored
      This CL implements the various checks from
      frameworks/base/tools/apilint, around 80 rules for
      good API design. It also runs the existing Kotlin
      interoperability checks as part of API lint.
      
      The checks are only applied if you invoke metalava
      with the --api-lint flag.
      
      Test: Unit tests included
      Change-Id: I5eb6693bdad4a0144dc0a7b2b09308edb3e7cb59
      4150065b
  3. Nov 14, 2018
  4. Jul 05, 2018
    • Tor Norbye's avatar
      Fix misc metalava issues: wildcard imports, type use, etc · 97dc5448
      Tor Norbye authored
      This CL fixes a cluster of issues that have come up recently:
      
      (1) Preserve wildcard imports from the original source files for
          packages that are members of the API. This normally isn't an issue
          since most framework code doesn't use wildcard imports, but some
          ojluni source files do, and without these wildcard imports in the
          documentation stubs any unqualified class references in the
          javadoc could not be resolved. (However, we have to take care to
          only include wildcard imports where at least one member is part of
          the API; otherwise we get a compilation error in the stubs.)
      
      (2) Including annotations was on by default. That was not supposed to
          be the case. Also, stop emitting annotations into the doc stubs.
      
      (3) Fix a couple of crashes related to comment lookup observed when
          running metalava on the support library.
      
      (4) Warn if anyone tries to mark findViewById or getSystemService as
          nullable. We should leave these as platform types, since otherwise
          a lot of valid code lights up as warnings even though developers
          can correctly conclude that the methods won't return null if they
          pass in correct arguments.
      
      (5) Fix handling of type-use annotations; this addresses
          111054266: Don't repeat annotations
          and possibly 111116803.
      
      (6) Don't warn about mismatches between @Deprecated and @deprecated in
          documentation for Kotlin. Instead, inline the text from
          kotlin.Deprecated into the documentation stubs.
      
      (7) Fix the javadoc invocation such that we emit its output
          synchronously instead of accumulating everything until the tool is
          done.
      
      (8) Don't mark *newly* added APIs with nullness annotations as
          recently null/non-null, only existing APIs newly annotated.
      
      (9) When inserting documentation (such as API levels, deprecation
          levels etc) for methods overriding other methods, add
          {@inheritDoc} at the beginning to ensure we don't wipe out
          inherited documentation from the base method. Also make sure
          appended segments are separated from the earlier documentation
          with a <br>. Also fixes other javadoc formatting issues.
      
      (11) Don't add @link references to constants in auto-generated
           comments if the referenced constant or permission isn't part of
           the API.
      
      (11) Misc other tweaks; flag using "JetPack" instead of "Jetpack",
           bump to latest Ktlint version, delete some unused code, allow the
           -keepstubcomments flag from doclava, remove redundant error
           constant MISSING_TYPEDEF_CONSTANT, ...
      
      Fixes: 111054266
      Test: Tests updated
      Change-Id: I22008b009a633e216d365b4b15a4995e6fcdec7c
      97dc5448
  5. Feb 26, 2018
    • Tor Norbye's avatar
      Add remaining compatibility checks · cd20b7a7
      Tor Norbye authored
      This adds checks for most of the remaining compatibility checks
      that Doclava1 performed.
      
      Also various other cleanup.
      
      Test: Unit tests included
      Change-Id: I19791748b51b6af85afabdbab1cdab066f5e9fdd
      cd20b7a7
  6. Feb 20, 2018
    • Tor Norbye's avatar
      Support @RequiresFeature, -sdkvalues, etc · 5f229d78
      Tor Norbye authored
      This CL includes a number of changes to metalava:
      
      - Track recent features added to doclava, such as
        (a) supporting the @RequiresFeature annotation to insert special
            documentation comments which links to the required feature and
            how to check for it
        (b) omitting "final" from methods in signatures where the
            surrounding class is also final
      
      - Changing the way relative references are handled in javadocs.
        Previously, metalava attempted to rewrite all javadocs to use fully
        qualified references in all cases, such that running javadoc on the
        stubs themselves would work (and since the rest of the stubs are
        using fully qualified references). However, the javadoc rewriting
        was a bit brittle, so instead leave the docs alone and include all
        the import statements from the original code instead (limited to the
        imports for classes/methods that are part of the API that is.)
      
      - Add support for the -sdkvalues flag from doclava1: this basically
        ports the code which lets metalva emit the various SDK files in
        platforms/android-X/data/ such as broadcast_actions.txt and
        widgets.txt.
      
      - Fixing the markdown formatting to correctly handle tables in
        gitiles
      
      - Allow for all compatibility flags to be specified from the command
        line
      
      Test: Unit tests included & updated
      Change-Id: Idb13fe42a746cfeebabf65a3c4b4c912fbd22e0e
      5f229d78
  7. Jan 28, 2018
  8. Jan 27, 2018
    • Aurimas Liutikas's avatar
      Initial checkin of metalava. · 52ffe48f
      Aurimas Liutikas authored
      This includes the following internal changes:
      ag/3072760
      ag/3466329
      ag/3474287
      
      Test: ./gradlew assemble
      Change-Id: Iecc7996ec8f2cbb453d84e1c63f01ca046464da3
      52ffe48f
Loading