Home | History | Annotate | only in /frameworks/support/development/refaster
Up to higher level directory
NameDateSize
IsAtLeastO.java21-Aug-20181.2K
README21-Aug-20181K

README

      1 Author: aurimas (a] google.com
      2 Updated: 6/6/2017
      3 
      4 Instructions on how to compile and apply refaster rules to support library
      5 
      6 0. Download error-prone and refaster jars
      7 http://errorprone.info/docs/refaster will have up to date instructions
      8 
      9 1. Compile the refaster rule (in this example IsAtLeastO.java)
     10 java -cp /path/to/android.jar:/path/to/support-compat.jar:javac-9-dev-r3297-4.jar:error_prone_refaster-2.0.18.jar com.google.errorprone.refaster.RefasterRuleCompiler IsAtLeastO.java --out `pwd`/myrule.refaster
     11 
     12 2. Update build to use the refaster rule
     13 Add compiler args to error-prone in SupportLibraryPlugin.groovy
     14 '-XepPatchChecks:refaster:/path/to/refaster/myrule.refaster',
     15 '-XepPatchLocation:' + project.projectDir
     16 
     17 3. Compile support library using the refaster rule
     18 ./gradlew assembleErrorProne
     19 
     20 4. Apply patches
     21 error-prone will produce patch files like "design/error-prone.patch" and to apply them, cd into the
     22 directory e.g. "design" and then run:
     23 patch -p0 -u -i error-prone.patch
     24 
     25 5. Rules have been applied! Celebrate!