Skip to content

Commit

Permalink
doc: update README according to latest 2.6.0 update
Browse files Browse the repository at this point in the history
  • Loading branch information
2BAB committed May 15, 2021
1 parent 3819738 commit 5eb2fcf
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 12 deletions.
22 changes: 16 additions & 6 deletions README.md
Expand Up @@ -4,12 +4,11 @@

[English][[中文说明]](./README_zh.md)

## How does it work?

![](./images/ic_launcher.png)![](./images/ic_launcher_round.png)
ScratchPaper is a Gradle Plugin helps distinguish the buildType/flavor/version via APK icon overlay, bases on [Polyfill](https://github.com/2BAB/Polyfill).

![](./images/scratch-paper-json.jpg)
## How does it work?

![](./images/launchers_json.jpg)

> If you install both debug&release Apps in one device, you can not distinguish which is the one you want to test.
Expand All @@ -18,6 +17,7 @@ ScratchPaper can add a overlay on your icon, and put given information (like bui
- Support regular & round Icons
- Support adaptive-icon
- Support AAPT2
- Support custom text

> If you have more than one staging Apps for QA or other colleagues, when they found some issues you may don't know how to match the App version to your code base (branch/commit/etc..), because all of them share the same version like "2.1.0-SNAPSHOT".
Expand All @@ -28,6 +28,15 @@ ScratchPaper supports generating build information into your artifact (which can
- Dependencies
- ...

## Why choose ScratchPaper?

We can find some similar solutions from Github,such as:akonior/icon-version, akaita/easylauncher-gradle-plugin。But the pain points of them are:

- Some do not support AAPT2
- Some do not support latest AGP

You should try ScratchPaper if you keep using latest build tools.

## Usage

**0x01. Add the plugin to classpath:**
Expand All @@ -39,8 +48,8 @@ buildscript {
mavenCentral() // Since 2.5.4, the publish repository has been shifted from Jcenter to Maven Central.
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.2'
classpath 'me.2bab:scratchpaper:2.5.4' // Since 2.5.4, the artifactId of ScratchPaper changed from scratch-paper to scratchpaper
classpath 'com.android.tools.build:gradle:4.2.0'
classpath 'me.2bab:scratchpaper:2.6.0' // Since 2.5.4, the artifactId of ScratchPaper changed from scratch-paper to scratchpaper
}
}
```
Expand Down Expand Up @@ -81,6 +90,7 @@ ScratchPaper is only supported & tested on LATEST ONE Minor versions of Android

AGP Version|Latest Support Version
-----------|-----------------
4.2.x | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/me.2bab/scratchpaper/badge.svg)](https://search.maven.org/artifact/me.2bab/scratchpaper)
4.1.x | 2.5.4
4.0.x | 2.5.3
3.6.x | 2.5.1
Expand Down
16 changes: 10 additions & 6 deletions README_zh.md
Expand Up @@ -4,11 +4,11 @@

[中文说明][[English]](./README.md)

## ScratchPaper 做了些什么?
ScratchPaper 是给 APK 图标添加 buildType/flavor/version 等构建信息来快速区分不同版本的 Gradle 插件,基于 [Polyfill](https://github.com/2BAB/Polyfill) 框架编写。

![](./images/ic_launcher.png)![](./images/ic_launcher_round.png)
## ScratchPaper 解决了什么问题?

![](./images/scratch-paper-json.jpg)
![](./images/launchers_json.jpg)

> 如果你在一台设备上同时安装一个 App 的 Debug 版和 Release 版,你可能很难区分出来到底哪个你要测试的版本(不打开的情况下)。
Expand All @@ -17,6 +17,7 @@ ScratchPaper 可以在你的 App icon 上加一个蒙层用以区分出各个 Bu
- 支持 常规 和 圆形 的图标
- 支持 adaptive-icon
- 支持 AAPT2
- 支持自定义文字内容

> 如果你同时打了多个测试包给测试或者产品(例如基于多个复合分支),当他们给你反馈的问题时候你和他们可能都很难分别出每个 App 对应的具体的分支或者 commit 节点。
Expand All @@ -29,12 +30,14 @@ ScratchPaper 支持生成编译信息并打包到你的 Apk 中(从 assets 中

## 为什么一定要试试 ScratchPaper

其实市面上不乏有类似的解决方案,例如:akonior/icon-version, akaita/easylauncher-gradle-plugin。但是他们的最重要问题在于:不支持 AAPT2由于 Google 在 18 年底停止了对 aapt1 的支持(enableAapt2=false 将被移除),所以尽早迁移到 AAPT2 其实是一个明智的选择。最后 AAPT2 还会带来额外的诸多好处:
其实市面上不乏有类似的解决方案,例如:akonior/icon-version, akaita/easylauncher-gradle-plugin。但是他们的最重要问题在于:不支持 AAPT2 和新版的 AGP。由于 Google 在 18 年底停止了对 aapt1 的支持(enableAapt2=false 将被移除),所以尽早迁移到 AAPT2 其实是一个明智的选择。最后 AAPT2 还会带来额外的诸多好处:

- 其实对 local debug build 时的性能是有一定提升的
- 修复很多 AAPT1 的低级 Bug (我曾写过一个插件来修复各类 AAPT 处理 Manifest 时的 Bug,具体查阅 https://github.com/2BAB/Seal)
- 同样有办法支持插件化的开发

而保持使用新版本的 AGP 是提升编译速度最简单有效的方式。

## 如何使用?

**0x01. Add the plugin to classpath:**
Expand All @@ -46,8 +49,8 @@ buildscript {
mavenCentral() // 从 2.5.4 开始,ScratchPaper 从 Jcenter 迁移到了 Maven Central
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.2'
classpath 'me.2bab:scratchpaper:2.5.4' // 从 2.5.4 开始,ScratchPaper 的 artifactId 从 scratch-paper 改为 scratchpaper
classpath 'com.android.tools.build:gradle:4.2.0'
classpath 'me.2bab:scratchpaper:2.6.0' // 从 2.5.4 开始,ScratchPaper 的 artifactId 从 scratch-paper 改为 scratchpaper
}
}
```
Expand Down Expand Up @@ -88,6 +91,7 @@ scratchPaper {

AGP Version|Latest Support Version
-----------|-----------------
4.2.x | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/me.2bab/scratchpaper/badge.svg)](https://search.maven.org/artifact/me.2bab/scratchpaper)
4.1.x | 2.5.4
4.0.x | 2.5.3
3.6.x | 2.5.1
Expand Down
Binary file removed images/ic_launcher.png
Binary file not shown.
Binary file removed images/ic_launcher_round.png
Binary file not shown.
Binary file added images/launchers_json.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed images/scratch-paper-json.jpg
Binary file not shown.

0 comments on commit 5eb2fcf

Please sign in to comment.