act262 / MicroModule

rebuild a complete multi-submodule structure within the module.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MicroModule

rebuild a complete multi-submodule structure within the module.

Usage

Add buildscript dependency in root project build.gradle:

buildscript {
    repositories {
        jcenter()
        ...
    }
    dependencies {
        classpath 'com.eastwood.tools.plugins:micro-module:1.0.1'
        ...
    }
}

Apply plugin and config MicroModule in module build.gradle:

// apply plugin 'micro-module' before apply plugin 'com.android.application' or 'com.android.library'.
apply plugin: 'micro-module'
apply plugin: 'com.android.application'

// In order to prevent two non-dependent MicroModules from generating references,
// you need to open the following code boundary check plugin.
// apply plugin: 'micro-module-code-check'

...

microModule {
    // the 'include' here is similar to the 'include' in the settings.gradle.
    include ':p_home'
    include ':p_common'
    include ':p_base'
}

Define dependencies and reference other MicroModules in MicroModule build.gradle:

dependencies {
    implementation microModule(':micro-module-name')
    
    // You can also reference other third-party libraries here.
    // implementation '***'
    // api '***'
    // ...
}

MicroModule IDEA Plugin

Provides an action which allow you quickly create MicroModule.

  • You will find "New Project/Module with MicroModule..." action in [File]->[New] group.
  • Right click at project or module dir, in [New] group, you will find "MicroModule" action.

Install Step:

  1. open [File] -> [Settings...] -> [plugins] -> [Browse repositories...]
  2. and search name MicroModule

Plugin detail:

https://plugins.jetbrains.com/plugin/10785-micromodule

More Detail

https://www.jianshu.com/p/22f69f68e648 (Chinese/中文)

About

rebuild a complete multi-submodule structure within the module.

License:Other


Languages

Language:Groovy 92.7%Language:Java 7.3%