Skip to content

Accompanist Migration Guide

Eliezer Graber edited this page Oct 23, 2023 · 1 revision

Migration from com.google.accompanist

In July 2023, the Accompanist project deprecated the placeholder artifact. This library was forked and published to replace it.

As a summary:

  • All code was refactored from the com.google.accompanist.placeholder root package to com.eygraber.compose.placeholder package.
  • The Maven coordinates was changed from com.google.accompanist:accompanist-placeholder to com.eygraber:compose-placeholder.

Semi-automatic migration...

The following methods below are available for your information only, but may help if you need to migrate from the old package name.

Warning

Use these at your own risk. It's a good idea to make sure that you've made a backup or committed any changes before running these.

Android Studio / IntelliJ

You can use the Replace in Path pane (⇧⌘R on Mac) in Android Studio to do a project-wide search and replace.

Android Studio Replace in Path pane

  • Find query: com.google.accompanist.placeholder
  • Replace string: com.eygraber.compose.placeholder
  • Optional: Set the file mask to *.kt so that only Kotlin files are searched. Repeat for *.gradle.

Similar can be achieved in Visual Studio Code. Other IDEs / text editors are available.

YOLO commands

These commands while automatically replace any imports and Gradle dependencies for the project in the current directory.

MacOS

find . -type f \( -name '*.kt' -or -name '*.gradle*' \) \
    -exec sed -i '' 's/com\.google\.accompanist\.placeholder/com\.eygraber\.compose\.placeholder/' {} \;

Linux

find . -type f \( -name '*.kt' -or -name '*.gradle*' \) \
    -exec sed -i 's/com\.google\.accompanist\.placeholder/com\.eygraber\.compose\.placeholder/' {} \;