luojilab / DDComponentForAndroid

一套完整有效的android组件化方案,支持组件的组件完全隔离、单独调试、集成调试、组件交互、UI跳转、动态加载卸载等功能
MIT License
3.34k stars 570 forks source link

这块代码好像不起作用?(copy module-release.aar) #9

Closed ihrthk closed 7 years ago

ihrthk commented 7 years ago
System.out.println("apply plugin is " + 'com.android.library');
project.afterEvaluate {
    Task assembleReleaseTask = project.tasks.findByPath("assembleRelease")
    if (assembleReleaseTask != null) {
        assembleReleaseTask.doLast {
            File infile = project.file("build/outputs/aar/$module-release.aar")
            File outfile = project.file("../componentrelease")
            File desFile = project.file("$module-release.aar");
            project.copy {
                from infile
                into outfile
                rename {
                    String fileName -> desFile.name
                }
            }
            System.out.println("$module-release.aar copy success ");
        }
    }
}
mqzhangw commented 7 years ago

这个是发布才会用到的,需要两个条件:一是isRunAlone设置为false,二是运行module:assembleRelease,不能运行assembleRelease,后者默认是运行app。这个规则在文章中有讲,可以再回顾一下