Paul Duffin | 82d9043 | 2019-11-30 09:24:33 +0000 | [diff] [blame] | 1 | // Copyright 2019 Google Inc. All rights reserved. |
| 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 | |
| 15 | package sdk |
| 16 | |
| 17 | import ( |
Paul Duffin | c3c5d5e | 2019-11-29 20:45:22 +0000 | [diff] [blame] | 18 | "fmt" |
Paul Duffin | c3c5d5e | 2019-11-29 20:45:22 +0000 | [diff] [blame] | 19 | "path/filepath" |
Paul Duffin | 82d9043 | 2019-11-30 09:24:33 +0000 | [diff] [blame] | 20 | "strings" |
| 21 | "testing" |
| 22 | |
| 23 | "android/soong/android" |
| 24 | "android/soong/apex" |
| 25 | "android/soong/cc" |
Paul Duffin | d6ceb86 | 2021-03-04 23:02:31 +0000 | [diff] [blame] | 26 | "android/soong/genrule" |
Paul Duffin | 82d9043 | 2019-11-30 09:24:33 +0000 | [diff] [blame] | 27 | "android/soong/java" |
| 28 | ) |
| 29 | |
Paul Duffin | 4a2a29c | 2021-03-09 22:27:13 +0000 | [diff] [blame] | 30 | var sdkFixtureFactory = android.NewFixtureFactory( |
Paul Duffin | abbf63d | 2021-03-18 01:47:31 +0000 | [diff] [blame^] | 31 | nil, |
Paul Duffin | 4a2a29c | 2021-03-09 22:27:13 +0000 | [diff] [blame] | 32 | apex.PrepareForTestWithApexBuildComponents, |
| 33 | cc.PrepareForTestWithCcDefaultModules, |
| 34 | genrule.PrepareForTestWithGenRuleBuildComponents, |
| 35 | java.PrepareForTestWithJavaBuildComponents, |
| 36 | PrepareForTestWithSdkBuildComponents, |
Martin Stjernholm | 7feceb2 | 2020-07-11 04:33:29 +0100 | [diff] [blame] | 37 | |
Paul Duffin | 4a2a29c | 2021-03-09 22:27:13 +0000 | [diff] [blame] | 38 | android.FixtureAddTextFile("sdk/tests/Android.bp", ` |
Colin Cross | 98be1bb | 2019-12-13 20:41:13 -0800 | [diff] [blame] | 39 | apex_key { |
| 40 | name: "myapex.key", |
| 41 | public_key: "myapex.avbpubkey", |
| 42 | private_key: "myapex.pem", |
| 43 | } |
| 44 | |
| 45 | android_app_certificate { |
| 46 | name: "myapex.cert", |
| 47 | certificate: "myapex", |
| 48 | } |
Paul Duffin | 4a2a29c | 2021-03-09 22:27:13 +0000 | [diff] [blame] | 49 | `), |
Colin Cross | 98be1bb | 2019-12-13 20:41:13 -0800 | [diff] [blame] | 50 | |
Paul Duffin | 4a2a29c | 2021-03-09 22:27:13 +0000 | [diff] [blame] | 51 | android.FixtureMergeMockFs(map[string][]byte{ |
Martin Stjernholm | cc77601 | 2020-07-07 03:22:21 +0100 | [diff] [blame] | 52 | "build/make/target/product/security": nil, |
| 53 | "apex_manifest.json": nil, |
| 54 | "system/sepolicy/apex/myapex-file_contexts": nil, |
| 55 | "system/sepolicy/apex/myapex2-file_contexts": nil, |
| 56 | "system/sepolicy/apex/mysdkapex-file_contexts": nil, |
| 57 | "myapex.avbpubkey": nil, |
| 58 | "myapex.pem": nil, |
| 59 | "myapex.x509.pem": nil, |
| 60 | "myapex.pk8": nil, |
Paul Duffin | 4a2a29c | 2021-03-09 22:27:13 +0000 | [diff] [blame] | 61 | }), |
Colin Cross | 98be1bb | 2019-12-13 20:41:13 -0800 | [diff] [blame] | 62 | |
Paul Duffin | 4a2a29c | 2021-03-09 22:27:13 +0000 | [diff] [blame] | 63 | cc.PrepareForTestOnWindows, |
| 64 | android.FixtureModifyConfig(func(config android.Config) { |
| 65 | // Add windows as a default disable OS to test behavior when some OS variants |
| 66 | // are disabled. |
| 67 | config.Targets[android.Windows] = []android.Target{ |
| 68 | {android.Windows, android.Arch{ArchType: android.X86_64}, android.NativeBridgeDisabled, "", "", true}, |
Martin Stjernholm | 7feceb2 | 2020-07-11 04:33:29 +0100 | [diff] [blame] | 69 | } |
Paul Duffin | 4a2a29c | 2021-03-09 22:27:13 +0000 | [diff] [blame] | 70 | }), |
| 71 | ) |
Martin Stjernholm | 7feceb2 | 2020-07-11 04:33:29 +0100 | [diff] [blame] | 72 | |
Paul Duffin | 4a2a29c | 2021-03-09 22:27:13 +0000 | [diff] [blame] | 73 | var PrepareForTestWithSdkBuildComponents = android.GroupFixturePreparers( |
| 74 | android.FixtureRegisterWithContext(registerModuleExportsBuildComponents), |
| 75 | android.FixtureRegisterWithContext(registerSdkBuildComponents), |
| 76 | ) |
Paul Duffin | 82d9043 | 2019-11-30 09:24:33 +0000 | [diff] [blame] | 77 | |
Paul Duffin | 4a2a29c | 2021-03-09 22:27:13 +0000 | [diff] [blame] | 78 | func testSdkWithFs(t *testing.T, bp string, fs android.MockFS) *android.TestResult { |
Paul Duffin | c3c5d5e | 2019-11-29 20:45:22 +0000 | [diff] [blame] | 79 | t.Helper() |
Paul Duffin | 4a2a29c | 2021-03-09 22:27:13 +0000 | [diff] [blame] | 80 | return sdkFixtureFactory.RunTest(t, fs.AddToFixture(), android.FixtureWithRootAndroidBp(bp)) |
Martin Stjernholm | 7feceb2 | 2020-07-11 04:33:29 +0100 | [diff] [blame] | 81 | } |
| 82 | |
Paul Duffin | 82d9043 | 2019-11-30 09:24:33 +0000 | [diff] [blame] | 83 | func testSdkError(t *testing.T, pattern, bp string) { |
| 84 | t.Helper() |
Paul Duffin | 4a2a29c | 2021-03-09 22:27:13 +0000 | [diff] [blame] | 85 | sdkFixtureFactory. |
| 86 | ExtendWithErrorHandler(android.FixtureExpectsAtLeastOneErrorMatchingPattern(pattern)). |
| 87 | RunTestWithBp(t, bp) |
Paul Duffin | 82d9043 | 2019-11-30 09:24:33 +0000 | [diff] [blame] | 88 | } |
| 89 | |
| 90 | func ensureListContains(t *testing.T, result []string, expected string) { |
| 91 | t.Helper() |
| 92 | if !android.InList(expected, result) { |
| 93 | t.Errorf("%q is not found in %v", expected, result) |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | func pathsToStrings(paths android.Paths) []string { |
| 98 | var ret []string |
| 99 | for _, p := range paths { |
| 100 | ret = append(ret, p.String()) |
| 101 | } |
| 102 | return ret |
| 103 | } |
| 104 | |
Paul Duffin | c3c5d5e | 2019-11-29 20:45:22 +0000 | [diff] [blame] | 105 | // Analyse the sdk build rules to extract information about what it is doing. |
Paul Duffin | fe9a9e3 | 2021-03-11 17:41:01 +0000 | [diff] [blame] | 106 | // |
Paul Duffin | c3c5d5e | 2019-11-29 20:45:22 +0000 | [diff] [blame] | 107 | // e.g. find the src/dest pairs from each cp command, the various zip files |
| 108 | // generated, etc. |
Paul Duffin | 36474d3 | 2021-03-12 12:19:43 +0000 | [diff] [blame] | 109 | func getSdkSnapshotBuildInfo(t *testing.T, result *android.TestResult, sdk *sdk) *snapshotBuildInfo { |
Paul Duffin | c3c5d5e | 2019-11-29 20:45:22 +0000 | [diff] [blame] | 110 | info := &snapshotBuildInfo{ |
Paul Duffin | 36474d3 | 2021-03-12 12:19:43 +0000 | [diff] [blame] | 111 | t: t, |
Paul Duffin | 981b94b | 2021-03-11 12:32:12 +0000 | [diff] [blame] | 112 | r: result, |
Paul Duffin | d075907 | 2021-02-17 11:23:00 +0000 | [diff] [blame] | 113 | androidBpContents: sdk.GetAndroidBpContentsForTests(), |
| 114 | androidUnversionedBpContents: sdk.GetUnversionedAndroidBpContentsForTests(), |
| 115 | androidVersionedBpContents: sdk.GetVersionedAndroidBpContentsForTests(), |
Paul Duffin | c3c5d5e | 2019-11-29 20:45:22 +0000 | [diff] [blame] | 116 | } |
| 117 | |
| 118 | buildParams := sdk.BuildParamsForTests() |
| 119 | copyRules := &strings.Builder{} |
Nicolas Geoffray | 1228e9c | 2020-02-27 13:45:35 +0000 | [diff] [blame] | 120 | otherCopyRules := &strings.Builder{} |
Paul Duffin | e1ddcc9 | 2020-03-03 16:01:26 +0000 | [diff] [blame] | 121 | snapshotDirPrefix := sdk.builderForTests.snapshotDir.String() + "/" |
Paul Duffin | c3c5d5e | 2019-11-29 20:45:22 +0000 | [diff] [blame] | 122 | for _, bp := range buildParams { |
| 123 | switch bp.Rule.String() { |
| 124 | case android.Cp.String(): |
Paul Duffin | e1ddcc9 | 2020-03-03 16:01:26 +0000 | [diff] [blame] | 125 | output := bp.Output |
Nicolas Geoffray | 1228e9c | 2020-02-27 13:45:35 +0000 | [diff] [blame] | 126 | // Get destination relative to the snapshot root |
| 127 | dest := output.Rel() |
| 128 | src := android.NormalizePathForTesting(bp.Input) |
| 129 | // We differentiate between copy rules for the snapshot, and copy rules for the install file. |
Paul Duffin | e1ddcc9 | 2020-03-03 16:01:26 +0000 | [diff] [blame] | 130 | if strings.HasPrefix(output.String(), snapshotDirPrefix) { |
| 131 | // Get source relative to build directory. |
Paul Duffin | e1ddcc9 | 2020-03-03 16:01:26 +0000 | [diff] [blame] | 132 | _, _ = fmt.Fprintf(copyRules, "%s -> %s\n", src, dest) |
| 133 | info.snapshotContents = append(info.snapshotContents, dest) |
Nicolas Geoffray | 1228e9c | 2020-02-27 13:45:35 +0000 | [diff] [blame] | 134 | } else { |
| 135 | _, _ = fmt.Fprintf(otherCopyRules, "%s -> %s\n", src, dest) |
Paul Duffin | e1ddcc9 | 2020-03-03 16:01:26 +0000 | [diff] [blame] | 136 | } |
Paul Duffin | c3c5d5e | 2019-11-29 20:45:22 +0000 | [diff] [blame] | 137 | |
| 138 | case repackageZip.String(): |
| 139 | // Add the destdir to the snapshot contents as that is effectively where |
| 140 | // the content of the repackaged zip is copied. |
| 141 | dest := bp.Args["destdir"] |
| 142 | info.snapshotContents = append(info.snapshotContents, dest) |
| 143 | |
| 144 | case zipFiles.String(): |
| 145 | // This could be an intermediate zip file and not the actual output zip. |
| 146 | // In that case this will be overridden when the rule to merge the zips |
| 147 | // is processed. |
Paul Duffin | 9b478b0 | 2019-12-10 13:41:51 +0000 | [diff] [blame] | 148 | info.outputZip = android.NormalizePathForTesting(bp.Output) |
Paul Duffin | c3c5d5e | 2019-11-29 20:45:22 +0000 | [diff] [blame] | 149 | |
| 150 | case mergeZips.String(): |
| 151 | // Copy the current outputZip to the intermediateZip. |
| 152 | info.intermediateZip = info.outputZip |
Paul Duffin | 9b478b0 | 2019-12-10 13:41:51 +0000 | [diff] [blame] | 153 | mergeInput := android.NormalizePathForTesting(bp.Input) |
Paul Duffin | c3c5d5e | 2019-11-29 20:45:22 +0000 | [diff] [blame] | 154 | if info.intermediateZip != mergeInput { |
Paul Duffin | 36474d3 | 2021-03-12 12:19:43 +0000 | [diff] [blame] | 155 | t.Errorf("Expected intermediate zip %s to be an input to merge zips but found %s instead", |
Paul Duffin | c3c5d5e | 2019-11-29 20:45:22 +0000 | [diff] [blame] | 156 | info.intermediateZip, mergeInput) |
| 157 | } |
| 158 | |
| 159 | // Override output zip (which was actually the intermediate zip file) with the actual |
| 160 | // output zip. |
Paul Duffin | 9b478b0 | 2019-12-10 13:41:51 +0000 | [diff] [blame] | 161 | info.outputZip = android.NormalizePathForTesting(bp.Output) |
Paul Duffin | c3c5d5e | 2019-11-29 20:45:22 +0000 | [diff] [blame] | 162 | |
| 163 | // Save the zips to be merged into the intermediate zip. |
Paul Duffin | 9b478b0 | 2019-12-10 13:41:51 +0000 | [diff] [blame] | 164 | info.mergeZips = android.NormalizePathsForTesting(bp.Inputs) |
Paul Duffin | c3c5d5e | 2019-11-29 20:45:22 +0000 | [diff] [blame] | 165 | } |
| 166 | } |
| 167 | |
| 168 | info.copyRules = copyRules.String() |
Nicolas Geoffray | 1228e9c | 2020-02-27 13:45:35 +0000 | [diff] [blame] | 169 | info.otherCopyRules = otherCopyRules.String() |
Paul Duffin | c3c5d5e | 2019-11-29 20:45:22 +0000 | [diff] [blame] | 170 | |
| 171 | return info |
| 172 | } |
| 173 | |
Paul Duffin | c3c5d5e | 2019-11-29 20:45:22 +0000 | [diff] [blame] | 174 | // Check the snapshot build rules. |
| 175 | // |
| 176 | // Takes a list of functions which check different facets of the snapshot build rules. |
| 177 | // Allows each test to customize what is checked without duplicating lots of code |
| 178 | // or proliferating check methods of different flavors. |
Paul Duffin | 36474d3 | 2021-03-12 12:19:43 +0000 | [diff] [blame] | 179 | func CheckSnapshot(t *testing.T, result *android.TestResult, name string, dir string, checkers ...snapshotBuildInfoChecker) { |
| 180 | t.Helper() |
Paul Duffin | c3c5d5e | 2019-11-29 20:45:22 +0000 | [diff] [blame] | 181 | |
Paul Duffin | 1356d8c | 2020-02-25 19:26:33 +0000 | [diff] [blame] | 182 | // The sdk CommonOS variant is always responsible for generating the snapshot. |
| 183 | variant := android.CommonOS.Name |
| 184 | |
Paul Duffin | 981b94b | 2021-03-11 12:32:12 +0000 | [diff] [blame] | 185 | sdk := result.Module(name, variant).(*sdk) |
Paul Duffin | c3c5d5e | 2019-11-29 20:45:22 +0000 | [diff] [blame] | 186 | |
Paul Duffin | 36474d3 | 2021-03-12 12:19:43 +0000 | [diff] [blame] | 187 | snapshotBuildInfo := getSdkSnapshotBuildInfo(t, result, sdk) |
Paul Duffin | c3c5d5e | 2019-11-29 20:45:22 +0000 | [diff] [blame] | 188 | |
| 189 | // Check state of the snapshot build. |
| 190 | for _, checker := range checkers { |
| 191 | checker(snapshotBuildInfo) |
| 192 | } |
| 193 | |
| 194 | // Make sure that the generated zip file is in the correct place. |
| 195 | actual := snapshotBuildInfo.outputZip |
Paul Duffin | 593b3c9 | 2019-12-05 14:31:48 +0000 | [diff] [blame] | 196 | if dir != "" { |
| 197 | dir = filepath.Clean(dir) + "/" |
| 198 | } |
Paul Duffin | 36474d3 | 2021-03-12 12:19:43 +0000 | [diff] [blame] | 199 | android.AssertStringEquals(t, "Snapshot zip file in wrong place", |
Paul Duffin | 593b3c9 | 2019-12-05 14:31:48 +0000 | [diff] [blame] | 200 | fmt.Sprintf(".intermediates/%s%s/%s/%s-current.zip", dir, name, variant, name), actual) |
Paul Duffin | c3c5d5e | 2019-11-29 20:45:22 +0000 | [diff] [blame] | 201 | |
| 202 | // Populate a mock filesystem with the files that would have been copied by |
| 203 | // the rules. |
| 204 | fs := make(map[string][]byte) |
| 205 | for _, dest := range snapshotBuildInfo.snapshotContents { |
| 206 | fs[dest] = nil |
| 207 | } |
| 208 | |
| 209 | // Process the generated bp file to make sure it is valid. |
Paul Duffin | 36474d3 | 2021-03-12 12:19:43 +0000 | [diff] [blame] | 210 | testSdkWithFs(t, snapshotBuildInfo.androidBpContents, fs) |
Paul Duffin | c3c5d5e | 2019-11-29 20:45:22 +0000 | [diff] [blame] | 211 | } |
| 212 | |
| 213 | type snapshotBuildInfoChecker func(info *snapshotBuildInfo) |
| 214 | |
| 215 | // Check that the snapshot's generated Android.bp is correct. |
| 216 | // |
| 217 | // Both the expected and actual string are both trimmed before comparing. |
| 218 | func checkAndroidBpContents(expected string) snapshotBuildInfoChecker { |
| 219 | return func(info *snapshotBuildInfo) { |
Paul Duffin | 36474d3 | 2021-03-12 12:19:43 +0000 | [diff] [blame] | 220 | info.t.Helper() |
| 221 | android.AssertTrimmedStringEquals(info.t, "Android.bp contents do not match", expected, info.androidBpContents) |
Paul Duffin | c3c5d5e | 2019-11-29 20:45:22 +0000 | [diff] [blame] | 222 | } |
| 223 | } |
| 224 | |
Paul Duffin | d075907 | 2021-02-17 11:23:00 +0000 | [diff] [blame] | 225 | // Check that the snapshot's unversioned generated Android.bp is correct. |
| 226 | // |
| 227 | // This func should be used to check the general snapshot generation code. |
| 228 | // |
| 229 | // Both the expected and actual string are both trimmed before comparing. |
| 230 | func checkUnversionedAndroidBpContents(expected string) snapshotBuildInfoChecker { |
| 231 | return func(info *snapshotBuildInfo) { |
Paul Duffin | 36474d3 | 2021-03-12 12:19:43 +0000 | [diff] [blame] | 232 | info.t.Helper() |
| 233 | android.AssertTrimmedStringEquals(info.t, "unversioned Android.bp contents do not match", expected, info.androidUnversionedBpContents) |
Paul Duffin | d075907 | 2021-02-17 11:23:00 +0000 | [diff] [blame] | 234 | } |
| 235 | } |
| 236 | |
| 237 | // Check that the snapshot's versioned generated Android.bp is correct. |
| 238 | // |
| 239 | // This func should only be used to check the version specific snapshot generation code, |
| 240 | // i.e. the encoding of version into module names and the generation of the _snapshot module. The |
| 241 | // general snapshot generation code should be checked using the checkUnversionedAndroidBpContents() |
| 242 | // func. |
| 243 | // |
| 244 | // Both the expected and actual string are both trimmed before comparing. |
| 245 | func checkVersionedAndroidBpContents(expected string) snapshotBuildInfoChecker { |
| 246 | return func(info *snapshotBuildInfo) { |
Paul Duffin | 36474d3 | 2021-03-12 12:19:43 +0000 | [diff] [blame] | 247 | info.t.Helper() |
| 248 | android.AssertTrimmedStringEquals(info.t, "versioned Android.bp contents do not match", expected, info.androidVersionedBpContents) |
Paul Duffin | d075907 | 2021-02-17 11:23:00 +0000 | [diff] [blame] | 249 | } |
| 250 | } |
| 251 | |
Paul Duffin | c3c5d5e | 2019-11-29 20:45:22 +0000 | [diff] [blame] | 252 | // Check that the snapshot's copy rules are correct. |
| 253 | // |
| 254 | // The copy rules are formatted as <src> -> <dest>, one per line and then compared |
| 255 | // to the supplied expected string. Both the expected and actual string are trimmed |
| 256 | // before comparing. |
| 257 | func checkAllCopyRules(expected string) snapshotBuildInfoChecker { |
| 258 | return func(info *snapshotBuildInfo) { |
Paul Duffin | 36474d3 | 2021-03-12 12:19:43 +0000 | [diff] [blame] | 259 | info.t.Helper() |
| 260 | android.AssertTrimmedStringEquals(info.t, "Incorrect copy rules", expected, info.copyRules) |
Paul Duffin | c3c5d5e | 2019-11-29 20:45:22 +0000 | [diff] [blame] | 261 | } |
| 262 | } |
| 263 | |
Nicolas Geoffray | 1228e9c | 2020-02-27 13:45:35 +0000 | [diff] [blame] | 264 | func checkAllOtherCopyRules(expected string) snapshotBuildInfoChecker { |
| 265 | return func(info *snapshotBuildInfo) { |
Paul Duffin | 36474d3 | 2021-03-12 12:19:43 +0000 | [diff] [blame] | 266 | info.t.Helper() |
| 267 | android.AssertTrimmedStringEquals(info.t, "Incorrect copy rules", expected, info.otherCopyRules) |
Nicolas Geoffray | 1228e9c | 2020-02-27 13:45:35 +0000 | [diff] [blame] | 268 | } |
| 269 | } |
| 270 | |
Paul Duffin | 3d1248c | 2020-04-09 00:10:17 +0100 | [diff] [blame] | 271 | // Check that the specified paths match the list of zips to merge with the intermediate zip. |
| 272 | func checkMergeZips(expected ...string) snapshotBuildInfoChecker { |
Paul Duffin | c3c5d5e | 2019-11-29 20:45:22 +0000 | [diff] [blame] | 273 | return func(info *snapshotBuildInfo) { |
Paul Duffin | 36474d3 | 2021-03-12 12:19:43 +0000 | [diff] [blame] | 274 | info.t.Helper() |
Paul Duffin | c3c5d5e | 2019-11-29 20:45:22 +0000 | [diff] [blame] | 275 | if info.intermediateZip == "" { |
Paul Duffin | 36474d3 | 2021-03-12 12:19:43 +0000 | [diff] [blame] | 276 | info.t.Errorf("No intermediate zip file was created") |
Paul Duffin | c3c5d5e | 2019-11-29 20:45:22 +0000 | [diff] [blame] | 277 | } |
Paul Duffin | 3d1248c | 2020-04-09 00:10:17 +0100 | [diff] [blame] | 278 | |
Paul Duffin | 36474d3 | 2021-03-12 12:19:43 +0000 | [diff] [blame] | 279 | android.AssertDeepEquals(info.t, "mismatching merge zip files", expected, info.mergeZips) |
Paul Duffin | c3c5d5e | 2019-11-29 20:45:22 +0000 | [diff] [blame] | 280 | } |
| 281 | } |
| 282 | |
| 283 | // Encapsulates information about the snapshot build structure in order to insulate tests from |
| 284 | // knowing too much about internal structures. |
| 285 | // |
| 286 | // All source/input paths are relative either the build directory. All dest/output paths are |
| 287 | // relative to the snapshot root directory. |
| 288 | type snapshotBuildInfo struct { |
Paul Duffin | 36474d3 | 2021-03-12 12:19:43 +0000 | [diff] [blame] | 289 | t *testing.T |
| 290 | |
| 291 | // The result from RunTest() |
Paul Duffin | 4a2a29c | 2021-03-09 22:27:13 +0000 | [diff] [blame] | 292 | r *android.TestResult |
Paul Duffin | c3c5d5e | 2019-11-29 20:45:22 +0000 | [diff] [blame] | 293 | |
| 294 | // The contents of the generated Android.bp file |
| 295 | androidBpContents string |
| 296 | |
Paul Duffin | d075907 | 2021-02-17 11:23:00 +0000 | [diff] [blame] | 297 | // The contents of the unversioned Android.bp file |
| 298 | androidUnversionedBpContents string |
| 299 | |
| 300 | // The contents of the versioned Android.bp file |
| 301 | androidVersionedBpContents string |
| 302 | |
Paul Duffin | c3c5d5e | 2019-11-29 20:45:22 +0000 | [diff] [blame] | 303 | // The paths, relative to the snapshot root, of all files and directories copied into the |
| 304 | // snapshot. |
| 305 | snapshotContents []string |
| 306 | |
Nicolas Geoffray | 1228e9c | 2020-02-27 13:45:35 +0000 | [diff] [blame] | 307 | // A formatted representation of the src/dest pairs for a snapshot, one pair per line, |
| 308 | // of the format src -> dest |
Paul Duffin | c3c5d5e | 2019-11-29 20:45:22 +0000 | [diff] [blame] | 309 | copyRules string |
| 310 | |
Nicolas Geoffray | 1228e9c | 2020-02-27 13:45:35 +0000 | [diff] [blame] | 311 | // A formatted representation of the src/dest pairs for files not in a snapshot, one pair |
| 312 | // per line, of the format src -> dest |
| 313 | otherCopyRules string |
| 314 | |
Paul Duffin | c3c5d5e | 2019-11-29 20:45:22 +0000 | [diff] [blame] | 315 | // The path to the intermediate zip, which is a zip created from the source files copied |
| 316 | // into the snapshot directory and which will be merged with other zips to form the final output. |
| 317 | // Is am empty string if there is no intermediate zip because there are no zips to merge in. |
| 318 | intermediateZip string |
| 319 | |
| 320 | // The paths to the zips to merge into the output zip, does not include the intermediate |
| 321 | // zip. |
| 322 | mergeZips []string |
| 323 | |
| 324 | // The final output zip. |
| 325 | outputZip string |
| 326 | } |