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

Support for Android Gradle Plugin 3.0 #557

Open galenlin opened 6 years ago

galenlin commented 6 years ago

Android Gradle Plugin (下称 AGP) 3.0 相对于 2.3.0 有了大幅的 API 改动。 导致我们的 gradle-small 编译插件在以下重要环节出现了问题:

  1. 解析 aar 依赖
  2. 分离 class
  3. 分离 arsc
  4. 分离 JNI
  5. 分离 manifest
  6. 分离 assets

为解决该适配问题,Small 决定重新设计编译流程,前置分离过程,减少不必要的后期 transform hook。同时彻底弃用原有对 AGP 私有 API 的引用,为以后兼容性打下基础。

拟采取以下方案(打钩项目已完成):

方案改造后,将完美适配 AGP 3.0。 同时新方案将大量的 I/O 操作前置到预处理过程,并良好地利用 Gradle Task Up-To-Date 设计,预期将大幅提高编译效率。

最新进展

目前已完成初步适配,代码分支 support-android-gradle-3.0

podinns commented 6 years ago

赞!👍 加油!

navyifanr commented 6 years ago

那如果只是升级Android studio 版本为3.0,不升级Android Gradle Plugin 或 gradle 版本,编译应该不会受影响吧?

galenlin commented 6 years ago

@navyifanr 不会

wkable commented 6 years ago

适配gradle plugin 3.0以上的了吗?

galenlin commented 6 years ago

@podinns @wkable 已初步适配,见分支 support-android-gradle-3.0

kumarswamy-repo commented 6 years ago

@galenlin As per your reply to #570 and The initial adaptation has now been completed given in latest update, What it means? If this means that now I can use 3.0.0 Gradle plugin version instead of 2.3.0 in my project. In that case, I made following changes in Application level build.gradle file as below

dependencies { classpath 'com.android.tools.build:gradle:3.0.0' classpath 'net.wequick.tools.build:gradle-small:2.0.0' } then I got following error "could not find net.wequick.tools.build:gradle-small:2.0.0"

When I make changes as below dependencies { classpath 'com.android.tools.build:gradle:3.0.0' classpath 'net.wequick.tools.build:gradle-small:1.3.0-beta6' }

then I got the following error "Could not get unknown property libraries for task :app.*:processDebugManifest"

Please give clarification that,either this adaption work still in progress or am I missing some thing.

galenlin commented 6 years ago

@kumarswamy-repo Yes, it's incubating, you can checkout the support-android-gradle-3.0 branch and try the DevSample source project.

lynn01247 commented 5 years ago

@kumarswamy-repo Yes, it's incubating, you can checkout the support-android-gradle-3.0 branch and try the DevSample source project.

support-android-gradle-3.0 DevSample分支跑不起来: 报错:You need to use a Theme.AppCompat theme (or descendant) with this activity。我已经将Theme适配还是不行。 AS:3.0 gradle:3.0.1

tangkoucan commented 5 years ago

@kumarswamy-repo Yes, it's incubating, you can checkout the support-android-gradle-3.0 branch and try the DevSample source project.

support-android-gradle-3.0 DevSample分支跑不起来: 报错:You need to use a Theme.AppCompat theme (or descendant) with this activity。我已经将Theme适配还是不行。 AS:3.0 gradle:3.0.1

metoo