All Projects → EastWoodYang → Micromodule

EastWoodYang / Micromodule

Licence: other
Rebuild multiple complete module structures within the module.

Programming Languages

groovy
2714 projects

Projects that are alternatives of or similar to Micromodule

Okta Blog Archive
Okta Developer Blog
Stars: ✭ 74 (-61.46%)
Mutual labels:  gradle, maven
Jib
🏗 Build container images for your Java applications.
Stars: ✭ 11,370 (+5821.88%)
Mutual labels:  gradle, maven
Circleci Orbs
The source code for some of the orbs published by CircleCI
Stars: ✭ 82 (-57.29%)
Mutual labels:  gradle, maven
Android Cookbook Examples
Contributed code examples from O'Reilly Android Cookbook. See #user-content-table README below!
Stars: ✭ 935 (+386.98%)
Mutual labels:  gradle, maven
Maven Git Versioning Extension
This extension will virtually set project versions, based on current git branch or tag.
Stars: ✭ 178 (-7.29%)
Mutual labels:  gradle, maven
Notes
📝 Migrated to(迁移至) https://github.com/Kuangcp/Note 当前仓库已经废弃, 对应的博客网站:
Stars: ✭ 33 (-82.81%)
Mutual labels:  gradle, maven
Gradle Maven Plugin
Gradle 5.x Maven Publish Plugin to deploy artifacts
Stars: ✭ 124 (-35.42%)
Mutual labels:  gradle, maven
Gradle Maven Publish Plugin
Gradle plugin that configures an uploadArchives task to automatically upload all of your Java, Kotlin or Android libraries to any Maven instance.
Stars: ✭ 392 (+104.17%)
Mutual labels:  gradle, maven
Java Markdown Generator
Java library to generate markdown
Stars: ✭ 159 (-17.19%)
Mutual labels:  gradle, maven
Spotless
Keep your code spotless
Stars: ✭ 2,285 (+1090.1%)
Mutual labels:  gradle, maven
Ok Gradle
IntelliJ/Android Studio plugin for searching artifacts ids of popular Java libraries.
Stars: ✭ 664 (+245.83%)
Mutual labels:  gradle, maven
Simplenet
An easy-to-use, event-driven, asynchronous network application framework compiled with Java 11.
Stars: ✭ 164 (-14.58%)
Mutual labels:  gradle, maven
Spock Example
Spock example specifications along with ready-to-go Gradle and Maven builds
Stars: ✭ 595 (+209.9%)
Mutual labels:  gradle, maven
Hellojpro
Stars: ✭ 46 (-76.04%)
Mutual labels:  gradle, maven
Ms Backend Boilerplates
Boilerplate for Your Server Side(Backend) Application, Java | Spring(Boot, Cloud) | Node.js(Express, Koa, Egg) | Go | Python | DevOps 💫 服务端项目模板
Stars: ✭ 394 (+105.21%)
Mutual labels:  gradle, maven
Kotlin Mpp Standard
A standard setup for Kotlin multiplatform projects.
Stars: ✭ 92 (-52.08%)
Mutual labels:  gradle, maven
Trampoline
Admin Spring Boot Locally
Stars: ✭ 325 (+69.27%)
Mutual labels:  gradle, maven
Samples
JavaFX samples to run with different options and build tools
Stars: ✭ 352 (+83.33%)
Mutual labels:  gradle, maven
Publiccms
现代化java cms,由天津黑核科技有限公司开发,轻松支撑千万数据、千万PV;支持静态化,服务器端包含; 目前已经拥有全球0.0002%的用户,语言支持中、繁、日、英;是一个已走向海外的成熟CMS产品
Stars: ✭ 1,750 (+811.46%)
Mutual labels:  gradle, maven
Sample Projects
Sample project files for JavaCPP, JavaCPP Presets, and JavaCV
Stars: ✭ 160 (-16.67%)
Mutual labels:  gradle, maven

MicroModule

重新定义Android模块结构,在模块内部可以创建多个和模块结构一致的微模块(MicroModule)。每一个MicroModule的结构和Android模块结构保持一致,也会有自己的build.gradle。另外,你可以很方便的配置哪些MicroModule参与APK的编译。

Usage

在根项目build.gradle中添加MicroModule插件依赖:

buildscript {
    dependencies {
        ...
        classpath 'com.eastwood.tools.plugins:micro-module:1.4.0'
    }
}

applicationlibrary类型的模块build.gradle中添加MicroModule插件:

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

android {}

microModule {
    ...
}

dependencies {}

注意:MicroModule插件需要添加在android相关插件之前,相关配置microModule {} 需要添加在 android {}dependencies {}之间。

microModule属性说明

  • include

    声明一个或多个MicroModule,类似于setting.gradle中的include,MicroModule目录名即为MicroModule的名称。

    microModule {
        include 'p_base', 'p_common'
    
        // 可以根据条件动态声明
        if(debug) {
            include 'debug'
        } else {
            include 'debug'
        }
    }
    
  • export

    配置参与APK编译的MicroModule。如果未配置export,则所有include的MicroModule都会参与APK编译。

    microModule {
        include 'feature_A', 'feature_B', 'feature_C'
    
        export 'feature_A', 'feature_B'
    }
    
  • includeMain

    指定主MicroModule。 当前模块的其他MicroModule的AndroidManifest.xml,将会合入主MicroModule的AndroidManifest.xml,并存放在build/microModule/merge-manifest/下。另外,当前模块的R类包名也将由主模块AndroidManifest.xmlpackage决定。

    默认主MicroModule为目录名为main的MicroModule。通过MicroModule Android Studio插件的转换功能,将模块转换成MicroModule格式时,无需指定主模块。转换功能工作只是创建一个main目录,并将原先src移动到main目录下,以及其他操作。

  • codeCheckEnabled

    是否开启MicroModule代码边界检查,默认不开启检查。

    有些场景下可能想使MicroModule在模块中保持独立,其类或资源不被该模块的其他MicroModule引用。代码边界检查在sync&build的时候进行,检测到没有依赖而存在引用时,会报错以及停止sync&build,并输出相应日志提示。

    开启代码边界检查后,一个模块内的MicroModule之间,需要声明依赖关系。例如:

    // Module build.gradle
    
    microModule {
        codeCheckEnabled true
    
        include 'p_base', 'p_common'
        include 'feature_A', 'feature_B'
    
        export 'feature_A'
    }
    
    // MicroModule feature_A build.gradle
    
    dependencies {
        implementation microModule(':p_base')
        implementation microModule(':p_common')
    }
    
    // MicroModule feature_B build.gradle
    
    dependencies {
        implementation microModule(':p_base')
        implementation microModule(':p_common')
    }
    

    另外MicroModule所需的依赖,也可以在各自的build.gradle dependencies {}中声明(此处的依赖不在代码边界检查范围之内)。

    dependencies {
        implementation fileTree(dir: 'main/libs', include: ['*.jar'])
        implementation 'com.android.support:appcompat-v7:27.1.1'
        implementation 'com.android.support.constraint:constraint-layout:1.1.0'
    
        implementation microModule(':p_base')
        implementation microModule(':p_common')
    }
    

MicroModule Android Studio Plugin

Provides an action which allow you quickly create MicroModule or convert module to MicroModule.

  • Right click at module dir, in [New] group, you will find "MicroModule" action.
  • Right click at module dir, in [Refactor] group, you will find "Convert to 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

Question or Idea

有问题或想法可以直接加我微信: EastWoodYang

License

   Copyright 2018 EastWood Yang

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].