xref: /aosp_15_r20/external/accompanist/docs/migration.md (revision fa44fe6ae8e729aa3cfe5c03eedbbf98fb44e2c6)
1# Migration from dev.chrisbanes.accompanist
2
3In March 2021, the Accompanist project moved from [github.com/chrisbanes/accompanist](https://github.com/chrisbanes/accompanist) to [github.com/google/accompanist](https://github.com/google/accompanist). At the same time we migrated the libraries over to a new package name and Maven group ID.
4
5As a summary:
6
7- All code was refactored from the `dev.chrisbanes.accompanist` root package to `com.google.accompanist` package.
8- The Maven group ID was changed from `dev.chrisbanes.accompanist` to `com.google.accompanist`.
9
10## Semi-automatic migration...
11
12The following methods below are available for your information only, but may help if you need to migrate from the old package name.
13
14!!! warning
15    Use these at your own risk, but they have worked on multiple projects from my testing. It's a good idea to make sure that you've made a backup or committed any changes before running these.
16
17### Android Studio / IntelliJ
18
19You can use the [Replace in Path](https://www.jetbrains.com/help/idea/finding-and-replacing-text-in-project.html#replace_search_string_in_project) pane (⇧⌘R on Mac) in Android Studio to do a project-wide search and replace.
20
21![Android Studio Replace in Path pane](studio.png)
22
23- Find query: `dev.chrisbanes.accompanist`
24- Replace string: `com.google.accompanist`
25- _Optional:_ Set the file mask to `*.kt` so that only Kotlin files are searched. Repeat for `*.gradle`.
26
27Similar can be achieved in [Visual Studio Code](https://code.visualstudio.com/docs/editor/codebasics#_search-across-files). Other IDEs / text editors are available.
28
29### YOLO commands
30
31These commands while automatically replace any imports and Gradle dependencies for the project in the current directory.
32
33#### MacOS
34
35``` bash
36find . -type f \( -name '*.kt' -or -name '*.gradle*' \) \
37    -exec sed -i '' 's/dev\.chrisbanes\.accompanist/com\.google\.accompanist/' {} \;
38```
39
40#### Linux
41
42``` bash
43find . -type f \( -name '*.kt' -or -name '*.gradle*' \) \
44    -exec sed -i 's/dev\.chrisbanes\.accompanist/com\.google\.accompanist/' {} \;
45```
46