All Projects → wuba → Zucker

wuba / Zucker

Licence: other
An easier way to automatically calculate the size of AAR in apk based on APP module

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Zucker

Multimodulegithubclient
Example multi-module Android project with unit tests, dagger 2, test coverage and others
Stars: ✭ 244 (+221.05%)
Mutual labels:  gradle
nexus-publish-plugin
⚠️ Deprecated - please switch to https://github.com/gradle-nexus/publish-plugin
Stars: ✭ 38 (-50%)
Mutual labels:  gradle
microframeworks-showcase
A simple grocery list webapplication implemented with the Microframeworks Spark Java, Jodd, Ninja, Javalite, Pippo and Ratpack
Stars: ✭ 29 (-61.84%)
Mutual labels:  gradle
Gradle License Plugin
Gradle plugin that provides a task to generate a HTML license report of your project.
Stars: ✭ 246 (+223.68%)
Mutual labels:  gradle
Marathon
Cross-platform test runner written for Android and iOS projects
Stars: ✭ 250 (+228.95%)
Mutual labels:  gradle
vlsi-release-plugins
A set of plugins to simplify Gradle release tasks
Stars: ✭ 30 (-60.53%)
Mutual labels:  gradle
Blindwatermark
Java 盲水印
Stars: ✭ 239 (+214.47%)
Mutual labels:  gradle
MicroServiceExample
针对微服务的各种例子实现
Stars: ✭ 25 (-67.11%)
Mutual labels:  gradle
Xpage
🔥A very useful Fragment page framework!(一个非常方便实用的fragment页面框架!)
Stars: ✭ 249 (+227.63%)
Mutual labels:  gradle
heroku-buildpack-gradle
This is a Heroku buildpack for Gradle apps. It uses Gradle to build your application and OpenJDK to run it.
Stars: ✭ 58 (-23.68%)
Mutual labels:  gradle
Globallydynamic
Dynamic Delivery everywhere through a common API
Stars: ✭ 248 (+226.32%)
Mutual labels:  gradle
Autoarchive
一个基于Jenkins的iOS/Android自动构建系统,它实现了最大程度的自动化,让你的iOS自动打包,Android自动打包流程变得更加高效。此项目包含了各种实现细节的讲解说明,你能够使用它解决大多数跟客户端构建/分发相关的问题,并将这种能力进行开放,提高研发效率。
Stars: ✭ 248 (+226.32%)
Mutual labels:  gradle
tmdb-api
This Kotlin Multiplatform library is for accessing the TMDB API to get movie and TV show content. Using for Android, iOS, and JS projects.
Stars: ✭ 31 (-59.21%)
Mutual labels:  gradle
21 Points
❤️ 21-Points Health is an app you can use to monitor your health.
Stars: ✭ 244 (+221.05%)
Mutual labels:  gradle
MultiLamp
Android library to showcase/highlight the multiple views on same overlay
Stars: ✭ 235 (+209.21%)
Mutual labels:  gradle
Sponge
The SpongeAPI implementation targeting vanilla Minecraft and 3rd party platforms.
Stars: ✭ 241 (+217.11%)
Mutual labels:  gradle
android-easy-gcm
Use this library to add GCM to your project, only in a few minutes !
Stars: ✭ 50 (-34.21%)
Mutual labels:  gradle
EmbeddedTools
Additions to the model-based DSL for deploying Java and Native projects to remote targets
Stars: ✭ 14 (-81.58%)
Mutual labels:  gradle
sphinx-gradle-plugin
Sphinx site generation plugin for Gradle
Stars: ✭ 19 (-75%)
Mutual labels:  gradle
gradle-cleaner-intellij-plugin
Force clear delaying & no longer needed Gradle tasks.
Stars: ✭ 26 (-65.79%)
Mutual labels:  gradle

Android APP模块化大小自动分析统计工具-Zucker

基于APP模块的,一个简单无侵害计算AAR独有大小的工具(An easier way to automatically calculate the size of AAR in apk based on APP module)

介绍文档

英文文档

AAR独立大小和被引入到工程后打包后占用的大小是不一样的,这个有经验的开发者都应该了解。AAR独立大小一目了然,但是怎么计算AAR在APK中的独立占有大小(独有大小)呢?Zucker就此开源给出了一份答案。

依赖环境

  • Python 3.0+
  • Android编译环境

开始使用

Demo工程测试

  1. 克隆本工程
  2. 终端cd到本工程下的src目录
  3. 执行python脚本:python3 zucker.py Sample
  4. 根据终端列出的AAR列表,选择一个目标AAR输入得到结果

项目工程测试

  1. 将zucker.py脚本放置在需要测试工程的同级目录
  2. 同[Demo工程测试]步骤2
  3. 同[Demo工程测试]步骤3:python3 zucker.py targetProjectName
  4. 同[Demo工程测试]步骤4

注意事项

  1. 确保目标工程在不依赖Zucker脚本的前提下可以正常编译
  2. 编译时使用gradlew命令,以保证采用了项目的gradle配置
  3. 首次运行时间较长,请耐心等待...
./gradlew build

-> 〜python3 /Users/iann/EnterpriseProject/Zucker/src/zucker.py /Users/iann/EnterpriseProject/Zucker/Sample
cloneBaseProject DONE
findBaseAppDirs DONE
clearBaseFlavors DONE
insertBaseScript DONE

> Configure project :app
WARNING: API 'variantOutput.getPackageApplication()' is obsolete and has been re placed with 'variant.getPackageApplicationProvider()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoid ance.
To determine what is calling variantOutput.getPackageApplication(), use -Pandroi d.debug.obsoleteApi=true on the command line to display more information.

BUILD SUCCESSFUL in 2s
5 actionable tasks: 4 executed, 1 up-to-date

脚本会自动执行,获取项目中的依赖关系并输出一级节点,可以选择目标节点进行AAR大小计算。

['app', 'app2'] 
com.github.moduth:blockcanary-android:1.2.1
com.squareup.okhttp3:okhttp:4.2.1
com.airbnb.android:lottie:2.5.6
输入AAR名称及版本,格式xxx.xxx:xxx:xxx:com.github.moduth:blockcanary-android:1.2.1
输出AAR------
['com.github.moduth:blockcanary-android:1.2.1', 'com.github.moduth:blockcanary-core:1.2.1']
/Users/iann/.gradle/caches/modules-2/files-2.1/com.github.moduth/blockcanary-android/1.2.l/78f65b7622338d512e79a26fe76e7bb9f7614190/blockcanary-android-l.2.1.aar
/Users/iann/.gradle/caches/modules-2/files-2.1/com.github.moduth/blockcanary-android/1.2.l/78f65b7622338d512e79a26fe76e7bb9f7614190/blockcanary-android-l.2.1.aar
替换 build.gradle

最后经过打包后,AAR大小就会显示在终端上。

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use f--warning-mode all1 to show the individual deprecation warnings.
See https://docs.gradle.org/5.4.l/userguide/command_line_interface.html#sec:comm ancLline一warnings

BUILD SUCCESSFUL in 9s
137 actionable tasks: 133 executed, 4 up-to-date
compile DONE
basePackSize: 2908419
aarPackSize: 2873610
aarSize: 34809

建议先在本项目的sample工程进行测试,具体流程见工程README

联系我们

  • 想了解更多开源项目信息?
  • 与项目成员零距离交流?
  • 扫码加小秘书微信
  • 一切应有尽有 jishu-58
  • 微信号 : jishu-58
  • 添加小秘书微信后由小秘书拉您进项目交流群

常见问题处理

解决办法:使用阿里云镜像,重新进行下载;修改build.gradle中的buildscript和allprojects的jcenter,添加url 'https://maven.aliyun.com/repository/jcenter'即可。

贡献代码

详见 CONTRIBUTING

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].