Skip to content

Commit

Permalink
Document ownership support in README
Browse files Browse the repository at this point in the history
  • Loading branch information
simonschiller committed Dec 14, 2021
1 parent e206502 commit 9e5b2b6
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ Ruler is a Gradle plugin which helps you analyze the size of your Android apps.

App size is an important metric which [directly correlates with business metrics](https://medium.com/googleplaydev/shrinking-apks-growing-installs-5d3fcba23ce2) like install conversion rate. Measuring app size is straightforward, but knowing what contributes to it is not. Especially in bigger projects with hundreds or thousands of modules and third-party dependencies. Ruler provides a convenient way to find out how much each module and dependency contributes to the total size of your app by running a single Gradle task.

![HTML report](docs/report.png)
<table>
<tr>
<td><img src="docs/breakdown.png"></td>
<td><img src="docs/insights.png"></td>
</tr>
</table>

## Usage

Expand Down Expand Up @@ -60,6 +65,33 @@ ruler {

Once this is done, `analyze<VariantName>Bundle` tasks will be added for each of your app variants. Running this task will build the app and generate a HTML report, which you can use to analyze your app size. It will also generate a JSON report, in case you want to further process the data.

## Ownership

In larger organizations, Gradle modules and dependencies are is often owned by specific teams. If that's the case for your app, Ruler can help you analyze app size contributions by different teams. All you need to do is provide a YAML file listing all components and their owners:

```yaml
# Identifier for Gradle modules -> path of the module
- identifier: :sample:app
owner: app-team

# Identifier for dependencies -> dependency shorthand without the version
- identifier: androidx.core:core
owner: core-team
```
This ownership file can be maintained manually, but in most cases it will be more practical to generate it during the build. You can point Ruler to your YAML file in the `build.gradle`, you can also configure default owners for components missing from the ownership file:

```kotlin
ruler {
ownershipFile.set("/path/to/ownership.yaml")
defaultOwner.set("default-team") // unknown by default
}
```

When you pass an ownership file to Ruler, you'll see a new tab in the HTML report with app size insights broken down by team:

![HTML report - ownership](docs/ownership.png)

## Project structure

Ruler is built with Kotlin and contains multiple modules:
Expand Down
Binary file added docs/breakdown.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/insights.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/ownership.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/report.png
Binary file not shown.

0 comments on commit 9e5b2b6

Please sign in to comment.