Stay organized with collections
Save and categorize content based on your preferences.
KmpOptimization
@Incubating interface KmpOptimization
DSL object for configurations aimed for optimizing build process(e.g. speed, correctness)
Summary
Public properties |
ConsumerKeepRules |
The collection of keep rule files for consumers of the library to use.
|
LibraryKeepRules |
The collection of keep rule files that the plugin should use when optimizing the AAR
|
Boolean |
Specifies whether to enable code shrinking for this build type.
|
ConfigurableFiles |
The collection of keep rule files to use for the test APK.
|
Public properties
keepRules
val keepRules: LibraryKeepRules
The collection of keep rule files that the plugin should use when optimizing the AAR
minify
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.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# KmpOptimization\n===============\n\n\n```\n@Incubating interface KmpOptimization\n```\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nDSL object for configurations aimed for optimizing build process(e.g. speed, correctness)\n\nSummary\n-------\n\n| ### Public properties ||\n|--------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [ConsumerKeepRules](/reference/tools/gradle-api/8.2/com/android/build/api/dsl/ConsumerKeepRules) | [consumerKeepRules](/reference/tools/gradle-api/8.2/com/android/build/api/dsl/KmpOptimization#consumerKeepRules()) The collection of keep rule files for consumers of the library to use. |\n| [LibraryKeepRules](/reference/tools/gradle-api/8.2/com/android/build/api/dsl/LibraryKeepRules) | [keepRules](/reference/tools/gradle-api/8.2/com/android/build/api/dsl/KmpOptimization#keepRules()) The collection of keep rule files that the plugin should use when optimizing the AAR |\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [minify](/reference/tools/gradle-api/8.2/com/android/build/api/dsl/KmpOptimization#minify()) Specifies whether to enable code shrinking for this build type. |\n| [ConfigurableFiles](/reference/tools/gradle-api/8.2/com/android/build/api/dsl/ConfigurableFiles) | [testKeepRules](/reference/tools/gradle-api/8.2/com/android/build/api/dsl/KmpOptimization#testKeepRules()) The collection of keep rule files to use for the test APK. |\n\nPublic properties\n-----------------\n\n### consumerKeepRules\n\n```\nval consumerKeepRules: ConsumerKeepRules\n```\n\nThe collection of keep rule files for consumers of the library to use. \n\n### keepRules\n\n```\nval keepRules: LibraryKeepRules\n```\n\nThe collection of keep rule files that the plugin should use when optimizing the AAR \n\n### minify\n\n```\nvar minify: Boolean\n```\n\nSpecifies whether to enable code shrinking for this build type.\n\nBy default, when you enable code shrinking by setting this property to `true`, the Android plugin uses ProGuard.\n\nTo learn more, read [Shrink Your Code and Resources](https://developer.android.com/studio/build/shrink-code.html). \n\n### testKeepRules\n\n```\nval testKeepRules: ConfigurableFiles\n```\n\nThe collection of keep rule files to use for the test APK."]]