Bp2build for android_app minsdkversion property
Bug: 249265719 Test: go test ./bp2build Test: insepcted generated build files Change-Id: I02ed54a9fdcc88d98439e0a61626a0afc1fce639
This commit is contained in:
@@ -344,3 +344,50 @@ android_app {
|
||||
}),
|
||||
}})
|
||||
}
|
||||
|
||||
func TestAndroidAppMinSdkProvided(t *testing.T) {
|
||||
runAndroidAppTestCase(t, Bp2buildTestCase{
|
||||
Description: "Android app with value for min_sdk_version",
|
||||
ModuleTypeUnderTest: "android_app",
|
||||
ModuleTypeUnderTestFactory: java.AndroidAppFactory,
|
||||
Filesystem: map[string]string{},
|
||||
Blueprint: simpleModuleDoNotConvertBp2build("filegroup", "foocert") + `
|
||||
android_app {
|
||||
name: "foo",
|
||||
sdk_version: "current",
|
||||
min_sdk_version: "24",
|
||||
}
|
||||
`,
|
||||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("android_binary", "foo", AttrNameToString{
|
||||
"manifest": `"AndroidManifest.xml"`,
|
||||
"resource_files": `[]`,
|
||||
"manifest_values": `{
|
||||
"minSdkVersion": "24",
|
||||
}`,
|
||||
}),
|
||||
}})
|
||||
}
|
||||
|
||||
func TestAndroidAppMinSdkDefaultToSdkVersion(t *testing.T) {
|
||||
runAndroidAppTestCase(t, Bp2buildTestCase{
|
||||
Description: "Android app with value for sdk_version",
|
||||
ModuleTypeUnderTest: "android_app",
|
||||
ModuleTypeUnderTestFactory: java.AndroidAppFactory,
|
||||
Filesystem: map[string]string{},
|
||||
Blueprint: simpleModuleDoNotConvertBp2build("filegroup", "foocert") + `
|
||||
android_app {
|
||||
name: "foo",
|
||||
sdk_version: "30",
|
||||
}
|
||||
`,
|
||||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("android_binary", "foo", AttrNameToString{
|
||||
"manifest": `"AndroidManifest.xml"`,
|
||||
"resource_files": `[]`,
|
||||
"manifest_values": `{
|
||||
"minSdkVersion": "30",
|
||||
}`,
|
||||
}),
|
||||
}})
|
||||
}
|
||||
|
Reference in New Issue
Block a user