This branch contains recipes compatible with AGP 8.7. If you want to find recipes
for other AGP versions, switch to the corresponding agp-*
branch.
This branch is read only. Contributions are only accepted on the studio-main
branch. See CONTRIBUTION.md
there.
Index is organized in categories, offering different ways to reach the recipe you want.
- Android Assets - addGeneratedSourceFolder, legacyTaskBridging
- Android Manifest - transformManifest, createSingleArtifact, perVariantManifestPlaceholder
- Artifact API - addMultipleArtifact, transformAllClasses, transformManifest, listenToMultipleArtifact, getScopedArtifacts, transformDirectory, workerEnabledTransformation, appendToScopedArtifacts, getMultipleArtifact, getSingleArtifact, transformMultiple, createSingleArtifact, listenToArtifacts, appendToMultipleArtifact
- DSL - extendingAgp, addBuildTypeUsingDslFinalize
- Dependency Resolution - variantDependencySubstitutionTest
- Sources - addGeneratedSourceFolder, addCustomSourceType, legacyTaskBridging
- TestFixtures - testFixtures
- AndroidComponentsExtension.beforeVariants() - disableTests, selectVariants
- AndroidComponentsExtension.onVariants() - allProjectsApkAction, addMultipleArtifact, transformAllClasses, transformManifest, listenToMultipleArtifact, disableTests, getScopedArtifacts, addCustomBuildConfigFields, transformDirectory, workerEnabledTransformation, appendToScopedArtifacts, getMultipleArtifact, addGeneratedSourceFolder, extendingAgp, getSingleArtifact, transformMultiple, variantOutput, registerPreBuild, addCustomSourceType, createSingleArtifact, perVariantManifestPlaceholder, listenToArtifacts, variantDependencySubstitutionTest, legacyTaskBridging, appendToMultipleArtifact, asmTransformClasses, onVariants
- AndroidComponentsExtension.registerExtension() - extendingAgp
- AndroidComponentsExtension.selector() - allProjectsApkAction, selectVariants, variantOutput
- ApplicationVariant.applicationId - onVariants
- ApplicationVariant.outputs - variantOutput
- Artifact.ContainsMany - listenToArtifacts
- ArtifactTransformationRequest - workerEnabledTransformation
- Artifacts.add() - addMultipleArtifact, transformMultiple
- Artifacts.forScope() - transformAllClasses, getScopedArtifacts, appendToScopedArtifacts
- Artifacts.get() - allProjectsApkAction, addMultipleArtifact, transformManifest, transformDirectory, addGeneratedSourceFolder, getSingleArtifact, transformMultiple, variantOutput, perVariantManifestPlaceholder, legacyTaskBridging, appendToMultipleArtifact
- Artifacts.getAll() - getMultipleArtifact
- Artifacts.use() - transformManifest, listenToMultipleArtifact, transformDirectory, workerEnabledTransformation, transformMultiple, createSingleArtifact, listenToArtifacts, appendToMultipleArtifact
- BuildConfigField() - addCustomBuildConfigFields
- BuiltArtifact - workerEnabledTransformation
- BuiltArtifact.versionCode - listenToArtifacts
- BuiltArtifact.versionName - listenToArtifacts
- BuiltArtifacts.elements - listenToArtifacts
- BuiltArtifacts.variantName - listenToArtifacts
- BuiltArtifactsLoader.load() - listenToArtifacts
- CanMinifyAndroidResourcesBuilder.shrinkResources - selectVariants
- CanMinifyCodeBuilder.isMinifyEnabled - selectVariants
- CombiningOperationRequest.toTransform() - transformMultiple
- Component.artifacts - addMultipleArtifact, transformManifest, getScopedArtifacts, transformDirectory, appendToScopedArtifacts, getMultipleArtifact, addGeneratedSourceFolder, transformMultiple, variantOutput, createSingleArtifact, legacyTaskBridging, appendToMultipleArtifact
- Component.compileConfiguration - variantDependencySubstitutionTest
- Component.runtimeConfiguration - variantDependencySubstitutionTest
- Component.sources - addGeneratedSourceFolder, addCustomSourceType, legacyTaskBridging
- Configuration.resolutionStrategy - variantDependencySubstitutionTest
- DslExtension.Builder.build() - extendingAgp
- DslExtension.Builder.extendBuildTypeWith() - extendingAgp
- DslExtension.Builder.extendProductFlavorWith() - extendingAgp
- DslExtension.Builder.extendProjectWith() - extendingAgp
- DslLifecycle.finalizeDsl() - addBuildTypeUsingDslFinalize
- GeneratesApk.applicationId - onVariants
- Gradle.beforeProject() - allProjectsApkAction
- HasDeviceTests.deviceTests - disableTests
- HasDeviceTestsBuilder.deviceTests - disableTests
- HasHostTests.hostTests - disableTests
- HasHostTestsBuilder.hostTests - disableTests
- HasUnitTestBuilder.enableUnitTest - selectVariants
- InAndOutDirectoryOperationRequest.toTransform() - transformDirectory
- InAndOutDirectoryOperationRequest.toTransformMany() - workerEnabledTransformation
- InAndOutFileOperationRequest.toTransform() - transformManifest
- Instrumentation.transformClassesWith() - asmTransformClasses
- LifeCycleTasks.registerPreBuild() - registerPreBuild
- MapProperty.put() - addCustomBuildConfigFields, perVariantManifestPlaceholder
- MultipleArtifact.MULTIDEX_KEEP_PROGUARD - getMultipleArtifact
- MultipleArtifact.NATIVE_DEBUG_METADATA - addMultipleArtifact, listenToMultipleArtifact, transformMultiple, appendToMultipleArtifact
- MultipleArtifactTypeOutOperationRequest.toListenTo() - listenToMultipleArtifact
- OutOperationRequest.toAppendTo() - appendToMultipleArtifact
- OutOperationRequest.toCreate() - createSingleArtifact
- OutOperationRequest.toListenTo() - listenToArtifacts
- Plugin - allProjectsApkAction
- ResolutionStrategy.dependencySubstitution() - variantDependencySubstitutionTest
- ScopedArtifact.CLASSES - transformAllClasses, getScopedArtifacts, appendToScopedArtifacts, asmTransformClasses
- ScopedArtifacts.Scope.ALL - getScopedArtifacts, appendToScopedArtifacts
- ScopedArtifacts.Scope.PROJECT - transformAllClasses, getScopedArtifacts, appendToScopedArtifacts, asmTransformClasses
- ScopedArtifacts.use() - transformAllClasses, getScopedArtifacts, appendToScopedArtifacts, asmTransformClasses
- ScopedArtifactsOperation.toAppend() - appendToScopedArtifacts
- ScopedArtifactsOperation.toGet() - getScopedArtifacts, appendToScopedArtifacts, asmTransformClasses
- ScopedArtifactsOperation.toTransform() - transformAllClasses
- SingleArtifact.APK - allProjectsApkAction, workerEnabledTransformation, listenToArtifacts
- SingleArtifact.ASSETS - transformDirectory, addGeneratedSourceFolder, legacyTaskBridging
- SingleArtifact.BUNDLE - addMultipleArtifact, getSingleArtifact, appendToMultipleArtifact
- SingleArtifact.MERGED_MANIFEST - transformManifest, variantOutput, createSingleArtifact, perVariantManifestPlaceholder
- SourceDirectories.addGeneratedSourceDirectory() - addGeneratedSourceFolder, addCustomSourceType, legacyTaskBridging
- SourceDirectories.addStaticSourceDirectory() - addCustomSourceType
- TaskBasedOperation.wiredWith() - transformMultiple, createSingleArtifact, listenToArtifacts
- TaskBasedOperation.wiredWithDirectories() - transformDirectory, workerEnabledTransformation
- TaskBasedOperation.wiredWithFiles() - transformManifest
- TaskBasedOperation.wiredWithMultiple() - listenToMultipleArtifact
- TaskOutputs.upToDateWhen() - transformManifest
- TaskProvider.flatMap() - createSingleArtifact
- TaskProvider.map() - addCustomBuildConfigFields
- Variant.buildConfigFields - addCustomBuildConfigFields
- Variant.components - variantDependencySubstitutionTest
- Variant.manifestPlaceholders - perVariantManifestPlaceholder
- Variant.nestedComponents - variantDependencySubstitutionTest
- VariantBuilder.minSdk - selectVariants
- VariantExtensionConfig - extendingAgp
- VariantOutputConfiguration.OutputType.SINGLE - variantOutput
- VariantOutputConfiguration.outputType - variantOutput
- VariantSelector.all() - selectVariants, variantOutput
- VariantSelector.withBuildType() - allProjectsApkAction, selectVariants, variantDependencySubstitutionTest
- VariantSelector.withFlavor() - selectVariants, variantOutput
- VariantSelector.withName() - selectVariants
- task.getOutputs() - transformManifest
- DslExtension.Builder().extendProjectWith().extendBuildTypeWith().extendProductFlavorWith().build() - extendingAgp
- HasDeviceTests.deviceTests.get() - disableTests
- HasDeviceTestsBuilder.deviceTests.get().enable - disableTests
- HasHostTests.hostTests.get() - disableTests
- HasHostTestsBuilder.hostTests.get().enable - disableTests
- androidComponents.beforeVariants {} - disableTests, selectVariants
- androidComponents.finalizeDsl {} - addBuildTypeUsingDslFinalize
- androidComponents.onVariants {} - allProjectsApkAction, addMultipleArtifact, transformAllClasses, transformManifest, listenToMultipleArtifact, disableTests, getScopedArtifacts, addCustomBuildConfigFields, transformDirectory, workerEnabledTransformation, appendToScopedArtifacts, getMultipleArtifact, addGeneratedSourceFolder, extendingAgp, getSingleArtifact, transformMultiple, variantOutput, registerPreBuild, addCustomSourceType, createSingleArtifact, perVariantManifestPlaceholder, listenToArtifacts, variantDependencySubstitutionTest, legacyTaskBridging, appendToMultipleArtifact, asmTransformClasses, onVariants
- androidComponents.registerExtension() - extendingAgp
- androidComponents.selector().all() - selectVariants, variantOutput
- androidComponents.selector().withBuildType() - allProjectsApkAction, selectVariants, variantDependencySubstitutionTest
- androidComponents.selector().withFlavor() - selectVariants, variantOutput
- androidComponents.selector().withName() - selectVariants
- configuration.resolutionStrategy.dependencySubstitution {} - variantDependencySubstitutionTest
- settings.gradle.beforeProject {} - allProjectsApkAction
- substitute().using() - variantDependencySubstitutionTest
- task.outputs.upToDateWhen {} - transformManifest
- transformationRequest.submit() - workerEnabledTransformation
- variant.applicationId - onVariants
- variant.artifacts.add() - addMultipleArtifact, transformMultiple
- variant.artifacts.forScope().use().toAppend() - appendToScopedArtifacts
- variant.artifacts.forScope().use().toGet() - getScopedArtifacts, asmTransformClasses
- variant.artifacts.forScope().use().toTransform() - transformAllClasses
- variant.artifacts.get() - allProjectsApkAction, addMultipleArtifact, transformManifest, transformDirectory, addGeneratedSourceFolder, getSingleArtifact, transformMultiple, variantOutput, perVariantManifestPlaceholder, legacyTaskBridging, appendToMultipleArtifact, asmTransformClasses
- variant.artifacts.getAll() - getMultipleArtifact
- variant.artifacts.use().wiredWith().toAppendTo() - appendToMultipleArtifact
- variant.artifacts.use().wiredWith().toCreate() - createSingleArtifact
- variant.artifacts.use().wiredWith().toListenTo() - listenToMultipleArtifact, listenToArtifacts
- variant.artifacts.use().wiredWith().toTransform() - transformMultiple
- variant.artifacts.use().wiredWithDirectories().toTransform() - transformDirectory
- variant.artifacts.use().wiredWithDirectories().toTransformMany() - workerEnabledTransformation
- variant.artifacts.use().wiredWithFiles().toTransform() - transformManifest
- variant.buildConfigFields.put() - addCustomBuildConfigFields
- variant.instrumentation.transformClassesWith() - asmTransformClasses
- variant.manifestPlaceholders.put() - perVariantManifestPlaceholder
- variant.registerPreBuild() - registerPreBuild
- variant.sources.*.addGeneratedSourceDirectory() - addGeneratedSourceFolder, addCustomSourceType, legacyTaskBridging
- variant.sources.*.addStaticSourceDirectory() - addCustomSourceType
- variant.sources.*.all - addGeneratedSourceFolder, addCustomSourceType
- All projects - allProjectsApkAction
- DeviceTestBuilder.ANDROID_TEST_TYPE - disableTests
- Extending AGP DSL - extendingAgp
- HostTestBuilder.UNIT_TEST_TYPE - disableTests
- Legacy API bridging - legacyTaskBridging
- Placeholders - perVariantManifestPlaceholder
- Renaming APKs - listenToArtifacts
- SourceDirectories.Flat - addCustomSourceType
- SourceDirectories.Layered - addGeneratedSourceFolder
- SourceDirectories.add - addCustomSourceType
- registerSourceType - addCustomSourceType
Copyright 2022 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.