blob: efa8e049485634c5cf5c98e4529e16b12e6f4d0b [file] [log] [blame]
Jeremy Meyer16c83af2024-07-26 16:21:49 -07001// Copyright (C) 2024 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package {
16 // See: http://go/android-license-faq
17 // A large-scale-change added 'default_applicable_licenses' to import
18 // all of the 'license_kinds' from "frameworks_base_license"
19 // to get the below license kinds:
20 // SPDX-license-identifier-Apache-2.0
21 default_applicable_licenses: ["frameworks_base_license"],
22 default_team: "trendy_team_android_resources",
23}
24
25genrule {
26 name: "resource-flagging-test-app-compile",
27 tools: ["aapt2"],
28 srcs: [
29 "res/values/bools.xml",
30 "res/values/bools2.xml",
31 "res/values/strings.xml",
32 ],
33 out: [
34 "values_bools.arsc.flat",
35 "values_bools2.arsc.flat",
36 "values_strings.arsc.flat",
37 ],
38 cmd: "$(location aapt2) compile $(in) -o $(genDir) " +
39 "--feature-flags test.package.falseFlag:ro=false,test.package.trueFlag:ro=true",
40}
41
42genrule {
43 name: "resource-flagging-test-app-apk",
44 tools: ["aapt2"],
45 // The first input file in the list must be the manifest
46 srcs: [
47 "AndroidManifest.xml",
48 ":resource-flagging-test-app-compile",
49 ],
50 out: ["resapp.apk"],
51 cmd: "$(location aapt2) link -o $(out) --manifest $(in)",
52}
53
54java_genrule {
55 name: "resource-flagging-test-app-apk-as-resource",
56 srcs: [
57 ":resource-flagging-test-app-apk",
58 ],
59 out: ["apks_as_resources.res.zip"],
60 tools: ["soong_zip"],
61
62 cmd: "mkdir -p $(genDir)/res/raw && " +
63 "cp $(in) $(genDir)/res/raw/$$(basename $(in)) && " +
64 "$(location soong_zip) -o $(out) -C $(genDir)/res -D $(genDir)/res",
65}