Skip to content

Instantly share code, notes, and snippets.

@ekursakov
Last active April 7, 2022 21:12
Show Gist options
  • Select an option

  • Save ekursakov/b8ffe396ae4e00a5400f7f4e3d546f9a to your computer and use it in GitHub Desktop.

Select an option

Save ekursakov/b8ffe396ae4e00a5400f7f4e3d546f9a to your computer and use it in GitHub Desktop.

Multiple modules

In order to add support for multiple modules:

  1. Add moxy-compiler dependency to each module that uses Moxy.
  2. In each library/subproject that uses a Moxy, you must add an annotation processor argument moxyReflectorPackage.
    For built-in annotationProcessor from gradle android plugin 2.2+:
    android {
        ...
        defaultConfig {
            ...
            javaCompileOptions {
                annotationProcessorOptions {
                    arguments = [ moxyReflectorPackage : 'some.unique.package.name' ]
                }
            }
        }
        ...
    }
    For Kotlin with kapt:
    kapt {
        ...
        arguments {
            arg("moxyReflectorPackage", "some.unique.package.name")
        }
    }
  3. In application module you must add annotation @RegisterMoxyReflectorPackages to any class (for example application class) and pass all packages that were set in library modules, like this:
    @RegisterMoxyReflectorPackages({"some.unique.package.name.library1", "some.unique.package.name.library2"})
    public class MyApplication extends Application {
    ...
@Kiolk

Kiolk commented Apr 7, 2022

Copy link
Copy Markdown

Thanks. It's work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment