Skip to content

Instantly share code, notes, and snippets.

@nisrulz
Created February 21, 2022 22:57
Show Gist options
  • Save nisrulz/b07b6f2442d19a01d4f8a11cfb51c9c0 to your computer and use it in GitHub Desktop.
Save nisrulz/b07b6f2442d19a01d4f8a11cfb51c9c0 to your computer and use it in GitHub Desktop.

Revisions

  1. nisrulz created this gist Feb 21, 2022.
    32 changes: 32 additions & 0 deletions Readme.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,32 @@
    # [Kotlin Synthetics for View is deprecated](https://android-developers.googleblog.com/2022/02/discontinuing-kotlin-synthetics-for-views.html)

    ## Find the files where you are using Kotlin Synthetics
    Run this command at the root of your project

    ```sh
    grep -rwl . -e 'kotlinx.android.synthetic'
    ```
    - -r = Recursive
    - -w = Match the whole word
    - -l = Output the file name of matching files
    - -e = Match pattern used during the search

    ## Output

    ```sh
    ❯ grep -rwl . -e 'kotlinx.android.synthetic'
    ./UsingKotlin/app/src/main/java/nisrulz/github/sample/usingkotlin/MainActivity.
    ```

    ## Find the number of files where Kotlin Synthetics are being used

    ```sh
    grep -rwl . -e 'kotlinx.android.synthetic' | wc -l
    ```

    ## Output

    ```sh
    ❯ grep -rwl . -e 'kotlinx.android.synthetic' | wc -l
    1
    ```