Skip to content

Commit 6e4fc1a

Browse files
Update plugin.md
1 parent 345b62f commit 6e4fc1a

File tree

4 files changed

+40
-113
lines changed

4 files changed

+40
-113
lines changed

README.md

+4-49
Original file line numberDiff line numberDiff line change
@@ -23,60 +23,15 @@ App Sizer offers comprehensive analysis including:
2323

2424
Reports are generated based on the provided Android device specifications. Our [blogpost][blog_post] introduce the tool features
2525

26-
## Quick Start
26+
## Integration
2727

2828
App Sizer provides two flexible integration methods:
2929

30-
* A Gradle plugin that seamlessly integrates with your Android Gradle project.
31-
* A command-line tool to cater to non-Gradle build systems, offering the same comprehensive features.
30+
* A Gradle plugin that seamlessly integrates with your Android Gradle project ([Plugin Configuration Detail][plugin_doc].)
31+
* A command-line tool to cater to non-Gradle build systems, offering the same comprehensive features ([Commandline Configuration Detail][cli_doc].)
3232

3333
*Note: The command-line option was the original implementation and remains supported for broader compatibility.*
3434

35-
### Gradle Plugin Integration
36-
37-
Add the plugin to your project using the Gradle plugins DSL:
38-
39-
1. Add the plugin to your root `settings.gradle`:
40-
41-
```groovy
42-
pluginManagement {
43-
repositories {
44-
mavenCentral()
45-
gradlePluginPortal()
46-
}
47-
}
48-
```
49-
2. Apply and configure the plugin in your app module's build.gradle:
50-
51-
```groovy
52-
plugins {
53-
id "com.grab.sizer" version "0.1.0-alpha01"
54-
}
55-
56-
appSizer {
57-
// Configuration goes here
58-
}
59-
```
60-
61-
3. To run analysis:
62-
63-
```
64-
./gradlew app:appSizeAnalysis[Release|Debug] --no-configure-on-demand --no-configuration-cache
65-
```
66-
67-
For plugin configuration options, see [Plugin Configuration][plugin_doc].
68-
69-
### Cli Tool Integration
70-
71-
1. Download our [Latest Release][latest_release_link] from GitHub
72-
2. Ensure Java 11+ is installed
73-
74-
To run analysis using the command line tool, execute
75-
```text
76-
java -jar cli-all.jar --config-file ./path/to/config/app-size-settings.yml
77-
```
78-
79-
For command line configuration options, see [Commandline Configuration][cli_doc].
8035

8136
## Report Types
8237

@@ -155,7 +110,7 @@ SOFTWARE
155110
[limitation_doc]:https://grab.github.io/app-sizer/limitation/
156111
[blog_post]: https://engineering.grab.com/project-bonsai
157112
[latest_release_link]: https://github.com/grab/app-sizer/releases
158-
[gradle_plugin]: ./gradle-plugin
113+
[gradle_plugin]: ./sizer-gradle-plugin
159114
[commandline_tool]: ./cli
160115
[grafana_docker]: ./docker
161116

docs/index.md

+5-51
Original file line numberDiff line numberDiff line change
@@ -22,62 +22,16 @@ App Sizer offers comprehensive analysis including:
2222

2323
Reports are generated based on the provided Android device specifications. Our [blogpost][blog_post] introduce the tool features
2424

25-
## Quick Start
25+
## Integration
2626

2727
App Sizer provides two flexible integration methods:
2828

29-
* A Gradle plugin that seamlessly integrates with your Android Gradle project.
30-
* A command-line tool to cater to non-Gradle build systems, offering the same comprehensive features.
29+
* A Gradle plugin that seamlessly integrates with your Android Gradle project ([Plugin Configuration Detail][plugin_doc].)
30+
* A command-line tool to cater to non-Gradle build systems, offering the same comprehensive features ([Commandline Configuration Detail][cli_doc].)
3131

3232
*Note: The command-line option was the original implementation and remains supported for broader compatibility.*
3333

34-
### Gradle Plugin Integration
35-
36-
Add the plugin to your project using the Gradle plugins DSL:
37-
38-
1. Add the plugin to your root `settings.gradle`:
39-
40-
```groovy
41-
pluginManagement {
42-
repositories {
43-
mavenCentral()
44-
gradlePluginPortal()
45-
}
46-
}
47-
```
48-
2. Apply and configure the plugin in your app module's build.gradle:
49-
50-
```groovy
51-
plugins {
52-
id "com.grab.sizer" version "0.1.0-alpha01"
53-
}
54-
55-
appSizer {
56-
// Configuration goes here
57-
}
58-
```
59-
60-
3. To run analysis:
61-
62-
```
63-
./gradlew app:appSizeAnalysis[Release|Debug] --no-configure-on-demand --no-configuration-cache
64-
```
65-
66-
For plugin configuration options, see [Plugin Configuration][plugin_doc].
67-
68-
### Cli Tool Integration
69-
70-
1. Download our [Latest Release][latest_release_link] from GitHub
71-
2. Ensure Java 11+ is installed
72-
73-
To run analysis using the command line tool, execute
74-
```text
75-
java -jar cli-all.jar --config-file ./path/to/config/app-size-settings.yml
76-
```
77-
78-
For command line configuration options, see [Commandline Configuration][cli_doc].
79-
80-
## Report Types
34+
## Report types
8135

8236
App Sizer currently supports three types of reports:
8337

@@ -151,7 +105,7 @@ SOFTWARE
151105
[cli_doc]: ./cli.md
152106
[grafana_docker_doc]: ./docker.md
153107
[limitation_doc]:./limitation.md
154-
[gradle_plugin]: https://github.com/grab/app-sizer/tree/master/gradle-plugin
108+
[gradle_plugin]: https://github.com/grab/app-sizer/tree/master/sizer-gradle-plugin
155109
[commandline_tool]: https://github.com/grab/app-sizer/tree/master/cli
156110
[grafana_docker]: https://github.com/grab/app-sizer/tree/master/docker
157111
[blog_post]: https://engineering.grab.com/project-bonsai

docs/plugin.md

+28-12
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,21 @@ There are two ways to integrate the App Sizer plugin into your project:
77

88
### Option 1: Plugins DSL (Recommended)
99

10-
1. Add the plugin to your root `settings.gradle`:
11-
10+
1. Add the mavenCentral to your root `settings.gradle`:
1211
```groovy
1312
pluginManagement {
1413
repositories {
1514
mavenCentral()
16-
gradlePluginPortal()
1715
}
1816
}
1917
```
20-
21-
2. Apply and configure the plugin in your app module's build.gradle:
18+
2. Add the plugin to your project classpath (root's build.gradle):
19+
```groovy
20+
plugins {
21+
id "com.grab.sizer" version "0.1.0-alpha01" apply false
22+
}
23+
```
24+
3. Apply and configure the plugin to your app module's build.gradle:
2225
```groovy
2326
plugins {
2427
id "com.grab.sizer" version "0.1.0-alpha01"
@@ -31,7 +34,6 @@ appSizer {
3134

3235
### Option 2: Legacy buildscript method
3336
1. Add the plugin to your root `build.gradle`
34-
3537
```groovy
3638
buildscript {
3739
repositories {
@@ -42,18 +44,16 @@ buildscript {
4244
}
4345
}
4446
```
45-
4647
2. Apply the plugin in your app module's `build.gradle`
47-
4848
```groovy
49-
apply plugin: "com.grab.app-sizer"
49+
apply plugin: "com.grab.sizer"
5050
5151
appSizer {
5252
// Configuration goes here
5353
}
5454
```
5555

56-
3. Run the analysis
56+
### Run the analysis
5757

5858
```bash
5959
./gradlew app:appSizeAnalysis[Release|Debug] --no-configure-on-demand --no-configuration-cache
@@ -233,8 +233,24 @@ appSizer {
233233

234234
## Troubleshooting
235235

236-
- If you encounter issues with the `verifyResourceRelease` task, try enabling `enableMatchDebugVariant`.
237-
- Ensure that the `bundletool` JAR file is correctly referenced in your configuration.
236+
### Resource Verification Failures
237+
If you encounter issues with the `verifyResourceRelease` task, try these solutions:
238+
- Check that your resource files are properly formatted and located
239+
- Verify that resource names follow Android naming conventions
240+
- Enable the `enableMatchDebugVariant` flag in your configuration
241+
242+
### Dagger NoSuchMethodError
243+
If you encounter this exception:
244+
```java
245+
NoSuchMethodError: 'java.lang.Object dagger.internal.Preconditions.checkNotNullFromProvides'
246+
```
247+
This error typically occurs due to a version conflict between the Android build tools and the App-Sizer plugin's Dagger dependencies. To resolve:
248+
249+
1. Ensure the App-Sizer plugin is added to the classpath in the root build.gradle before applying it to your app module
250+
2. If step 1 doesn't resolve the issue, you might have to resolve the Dagger version conflict by adding this to your classpath
251+
```
252+
classpath "com.google.dagger:dagger:2.47"
253+
```
238254

239255
## Resources
240256

sizer-gradle-plugin/src/main/kotlin/com/grab/plugin/sizer/tasks/GenerateApkTask.kt

+3-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,9 @@ internal abstract class GenerateApkTask : DefaultTask() {
193193
(it as FinalizeBundleTask).finalBundleFile.get()
194194
}
195195
)
196-
signingConfig.set(variant.signingConfig.toInternalSigningConfig())
196+
if (variant.signingConfig != null) {
197+
signingConfig.set(variant.signingConfig.toInternalSigningConfig())
198+
}
197199
variantName.set(variant.name)
198200
}
199201
return task

0 commit comments

Comments
 (0)