# KmpOptimization

# 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  

<br />

```
@Incubating
interface KmpOptimization
```

<br />

*** ** * ** ***

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

## Summary

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