xref: /aosp_15_r20/external/accompanist/docs/migration.md (revision fa44fe6ae8e729aa3cfe5c03eedbbf98fb44e2c6)
1*fa44fe6aSInna Palant# Migration from dev.chrisbanes.accompanist
2*fa44fe6aSInna Palant
3*fa44fe6aSInna PalantIn 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*fa44fe6aSInna Palant
5*fa44fe6aSInna PalantAs a summary:
6*fa44fe6aSInna Palant
7*fa44fe6aSInna Palant- All code was refactored from the `dev.chrisbanes.accompanist` root package to `com.google.accompanist` package.
8*fa44fe6aSInna Palant- The Maven group ID was changed from `dev.chrisbanes.accompanist` to `com.google.accompanist`.
9*fa44fe6aSInna Palant
10*fa44fe6aSInna Palant## Semi-automatic migration...
11*fa44fe6aSInna Palant
12*fa44fe6aSInna PalantThe following methods below are available for your information only, but may help if you need to migrate from the old package name.
13*fa44fe6aSInna Palant
14*fa44fe6aSInna Palant!!! warning
15*fa44fe6aSInna Palant    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*fa44fe6aSInna Palant
17*fa44fe6aSInna Palant### Android Studio / IntelliJ
18*fa44fe6aSInna Palant
19*fa44fe6aSInna PalantYou 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*fa44fe6aSInna Palant
21*fa44fe6aSInna Palant![Android Studio Replace in Path pane](studio.png)
22*fa44fe6aSInna Palant
23*fa44fe6aSInna Palant- Find query: `dev.chrisbanes.accompanist`
24*fa44fe6aSInna Palant- Replace string: `com.google.accompanist`
25*fa44fe6aSInna Palant- _Optional:_ Set the file mask to `*.kt` so that only Kotlin files are searched. Repeat for `*.gradle`.
26*fa44fe6aSInna Palant
27*fa44fe6aSInna PalantSimilar can be achieved in [Visual Studio Code](https://code.visualstudio.com/docs/editor/codebasics#_search-across-files). Other IDEs / text editors are available.
28*fa44fe6aSInna Palant
29*fa44fe6aSInna Palant### YOLO commands
30*fa44fe6aSInna Palant
31*fa44fe6aSInna PalantThese commands while automatically replace any imports and Gradle dependencies for the project in the current directory.
32*fa44fe6aSInna Palant
33*fa44fe6aSInna Palant#### MacOS
34*fa44fe6aSInna Palant
35*fa44fe6aSInna Palant``` bash
36*fa44fe6aSInna Palantfind . -type f \( -name '*.kt' -or -name '*.gradle*' \) \
37*fa44fe6aSInna Palant    -exec sed -i '' 's/dev\.chrisbanes\.accompanist/com\.google\.accompanist/' {} \;
38*fa44fe6aSInna Palant```
39*fa44fe6aSInna Palant
40*fa44fe6aSInna Palant#### Linux
41*fa44fe6aSInna Palant
42*fa44fe6aSInna Palant``` bash
43*fa44fe6aSInna Palantfind . -type f \( -name '*.kt' -or -name '*.gradle*' \) \
44*fa44fe6aSInna Palant    -exec sed -i 's/dev\.chrisbanes\.accompanist/com\.google\.accompanist/' {} \;
45*fa44fe6aSInna Palant```
46