Skip to content

Commit

Permalink
Update plugin.md
Browse files Browse the repository at this point in the history
  • Loading branch information
MinhNguyen-nvm committed Dec 21, 2024
1 parent 345b62f commit 43daf3b
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 103 deletions.
49 changes: 2 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,56 +27,11 @@ Reports are generated based on the provided Android device specifications. Our [

App Sizer provides two flexible integration methods:

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

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

### Gradle Plugin Integration

Add the plugin to your project using the Gradle plugins DSL:

1. Add the plugin to your root `settings.gradle`:

```groovy
pluginManagement {
repositories {
mavenCentral()
gradlePluginPortal()
}
}
```
2. Apply and configure the plugin in your app module's build.gradle:

```groovy
plugins {
id "com.grab.sizer" version "0.1.0-alpha01"
}
appSizer {
// Configuration goes here
}
```

3. To run analysis:

```
./gradlew app:appSizeAnalysis[Release|Debug] --no-configure-on-demand --no-configuration-cache
```

For plugin configuration options, see [Plugin Configuration][plugin_doc].

### Cli Tool Integration

1. Download our [Latest Release][latest_release_link] from GitHub
2. Ensure Java 11+ is installed

To run analysis using the command line tool, execute
```text
java -jar cli-all.jar --config-file ./path/to/config/app-size-settings.yml
```

For command line configuration options, see [Commandline Configuration][cli_doc].

## Report Types

Expand Down
50 changes: 2 additions & 48 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,57 +26,11 @@ Reports are generated based on the provided Android device specifications. Our [

App Sizer provides two flexible integration methods:

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

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

### Gradle Plugin Integration

Add the plugin to your project using the Gradle plugins DSL:

1. Add the plugin to your root `settings.gradle`:

```groovy
pluginManagement {
repositories {
mavenCentral()
gradlePluginPortal()
}
}
```
2. Apply and configure the plugin in your app module's build.gradle:

```groovy
plugins {
id "com.grab.sizer" version "0.1.0-alpha01"
}
appSizer {
// Configuration goes here
}
```

3. To run analysis:

```
./gradlew app:appSizeAnalysis[Release|Debug] --no-configure-on-demand --no-configuration-cache
```

For plugin configuration options, see [Plugin Configuration][plugin_doc].

### Cli Tool Integration

1. Download our [Latest Release][latest_release_link] from GitHub
2. Ensure Java 11+ is installed

To run analysis using the command line tool, execute
```text
java -jar cli-all.jar --config-file ./path/to/config/app-size-settings.yml
```

For command line configuration options, see [Commandline Configuration][cli_doc].

## Report Types

App Sizer currently supports three types of reports:
Expand Down
36 changes: 29 additions & 7 deletions docs/plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,24 @@ There are two ways to integrate the App Sizer plugin into your project:

### Option 1: Plugins DSL (Recommended)

1. Add the plugin to your root `settings.gradle`:
1. Add the mavenCentral to your root `settings.gradle`:

```groovy
pluginManagement {
repositories {
mavenCentral()
gradlePluginPortal()
}
}
```
2. Add the plugin to your project classpath (root's build.gradle):
```groovy
plugins {
id "com.grab.sizer" version "0.1.0-alpha01" apply false
}
```

3. Apply and configure the plugin to your app module's build.gradle:

2. Apply and configure the plugin in your app module's build.gradle:
```groovy
plugins {
id "com.grab.sizer" version "0.1.0-alpha01"
Expand Down Expand Up @@ -46,14 +52,14 @@ buildscript {
2. Apply the plugin in your app module's `build.gradle`

```groovy
apply plugin: "com.grab.app-sizer"
apply plugin: "com.grab.sizer"
appSizer {
// Configuration goes here
}
```

3. Run the analysis
### Run the analysis

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

## Troubleshooting

- If you encounter issues with the `verifyResourceRelease` task, try enabling `enableMatchDebugVariant`.
- Ensure that the `bundletool` JAR file is correctly referenced in your configuration.
### Resource Verification Failures
If you encounter issues with the `verifyResourceRelease` task, try these solutions:
- Check that your resource files are properly formatted and located
- Verify that resource names follow Android naming conventions
- Enable the `enableMatchDebugVariant` flag in your configuration

### Dagger NoSuchMethodError
If you encounter this exception:
```java
NoSuchMethodError: 'java.lang.Object dagger.internal.Preconditions.checkNotNullFromProvides'
```
This error typically occurs due to a version conflict between the Android build tools and the App-Sizer plugin's Dagger dependencies. To resolve:

1. Ensure the App-Sizer plugin is added to the classpath in the root build.gradle before applying it to your app module
2. If step 1 doesn't resolve the issue, you might have to resolve the Dagger version conflict by adding this to your classpath
```
classpath "com.google.dagger:dagger:2.47"
```

## Resources

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,9 @@ internal abstract class GenerateApkTask : DefaultTask() {
(it as FinalizeBundleTask).finalBundleFile.get()
}
)
signingConfig.set(variant.signingConfig.toInternalSigningConfig())
if (variant.signingConfig != null) {
signingConfig.set(variant.signingConfig.toInternalSigningConfig())
}
variantName.set(variant.name)
}
return task
Expand Down

0 comments on commit 43daf3b

Please sign in to comment.