wequick / Small

A small framework to split app into small parts
http://code.wequick.net/Small
Apache License 2.0
5.05k stars 1.11k forks source link

根目录gradle.build统一管理子项目属性问题 #525

Closed hiyangyue closed 7 years ago

hiyangyue commented 7 years ago

错误报告

你做了什么?

用根目录的build.gradle管理子项目的属性,代码如下 :


apply plugin: 'net.wequick.small'//引用 small 插件

small {
    ...
}

subprojects {
    logger.quiet("project name is $project.name")
    if (project.name.startsWith('app')) {
        apply plugin: 'com.android.application'
    }

    android {
        compileSdkVersion 26
        ....
    }
}

你期望的结果是什么?

Small属性能够和全局管理subproject属性够并存

实际结果是什么?

在引入Small以后,提示错误 :

Error:Cannot change dependencies of configuration ':app:compile' after it has been included in dependency resolution.

Small环境

Compile-time

 gradle-small plugin : 1.3.0-beta2 (maven)
            small aar : 1.3.0-beta2 (maven)
          gradle core : 4.1
       android plugin : 2.3.3
                   OS : Mac OS X 10.12.6 (x86_64)

Bundles

type name PP sdk aapt support file(armeabi) size
host app 26 26.0.1 26.+
stub app+stub 26 26.0.1 26.+
app app.home 0x70 26 26.0.1 26.+ *_home.so 5.4 KB
lib lib.mvvm 0x5f 26 26.0.1 26.+ *_mvvm.so 3.6 KB
lib lib.net 0x3d 26 26.0.1 26.+ *_net.so 3.3 KB
lib lib.middleware 0x62 26 26.0.1 26.+ *_middleware.so 3.4 KB
lib lib.style 0x79 26 26.0.1 26.+ *_style.so 3.4 KB