blob: 8c3fd8e9a10e47fa1afb3a14138d958890dd3e04 [file] [log] [blame]
/*
* 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
*
* http://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.
*/
import com.android.build.api.artifact.SingleArtifact
plugins {
id("AndroidXPlugin")
id("com.android.application")
id("kotlin-android")
}
android {
defaultConfig {
minSdkVersion 28
}
buildTypes {
release {
// Minification and shrinking are disabled to avoid r8 removing unused methods and
// speed up build process.
minifyEnabled false
shrinkResources false
}
}
flavorDimensions = ["version"]
productFlavors {
v1 {
dimension "version"
versionCode 1
}
v2 {
dimension "version"
versionCode 2
}
v3 {
dimension "version"
versionCode 3
}
}
namespace "androidx.profileinstaller.integration.profileverification.target"
}
dependencies {
implementation(libs.kotlinStdlib)
implementation(project(":profileinstaller:profileinstaller"))
// These projects are not used directly but added to baseline-prof.txt to increase number of
// methods, in order to have dex opt to run.
implementation(project(":core:core"))
implementation(project(":core:core-ktx"))
}
// Define a configuration that can be consumed, as this project is a provider of test apks for
// profile verification integration test.
configurations {
apkAssets {
canBeConsumed = true
canBeResolved = false
attributes {
attribute(
LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE,
objects.named(LibraryElements, 'profileverification-apkAssets')
)
}
}
}
// Release apk variants are added as output artifacts to the apkAssets configuration.
// The apkAssets configuration is consumed by profile-verification integration test and
// artifacts are placed in the assets folder.
// Release apk variants are added as output artifacts to the apkAssets configuration.
// The apkAssets configuration is consumed by profile-verification integration test and
// artifacts are placed in the assets folder.
androidComponents {
onVariants(selector().all().withBuildType("release"), { variant ->
artifacts {
apkAssets(variant.artifacts.get(SingleArtifact.APK.INSTANCE))
}
})
}