# KmpOptimization

[View Source](https://cs.android.com/search?q=file:com/android/build/api/dsl/KmpOptimization.kt+class:com.android.build.api.dsl.KmpOptimization) Added in 8.2.0


```
@Incubating
interface KmpOptimization
```

<br />

*** ** * ** ***

DSL object for configurations aimed for optimizing build process(e.g. speed, correctness)

## Summary

| ### Public properties |
|---|---|
| `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/ConsumerKeepRules` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KmpOptimization#consumerKeepRules()` The collection of keep rule files for consumers of the library to use. |
| `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/LibraryKeepRules` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KmpOptimization#keepRules()` The collection of keep rule files that the plugin should use when optimizing the AAR |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KmpOptimization#minify()` Specifies whether to enable code shrinking for this build type. |
| `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/ConfigurableFiles` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KmpOptimization#testKeepRules()` The collection of keep rule files to use for the test APK. |

## Public properties

### consumerKeepRules

Added in 8.2.0

```
val consumerKeepRules: ConsumerKeepRules
```

The collection of keep rule files for consumers of the library to use.

### keepRules

Added in 8.2.0

```
val keepRules: LibraryKeepRules
```

The collection of keep rule files that the plugin should use when optimizing the AAR

### minify

Added in 8.2.0

```
var minify: Boolean
```

Specifies whether to enable code shrinking for this build type.

By default, when you enable code shrinking by setting this property to `true`, the Android plugin uses ProGuard.

To learn more, read [Shrink Your Code and Resources](https://developer.android.com/studio/build/shrink-code.html).

### testKeepRules

Added in 8.2.0

```
val testKeepRules: ConfigurableFiles
```

The collection of keep rule files to use for the test APK.