Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 1 | // Copyright (C) 2019 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 | |
| 15 | package sdk |
| 16 | |
| 17 | import ( |
| 18 | "testing" |
| 19 | |
Paul Duffin | 1356d8c | 2020-02-25 19:26:33 +0000 | [diff] [blame] | 20 | "android/soong/android" |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 21 | "android/soong/cc" |
| 22 | ) |
| 23 | |
Martin Stjernholm | 7feceb2 | 2020-07-11 04:33:29 +0100 | [diff] [blame] | 24 | var ccTestFs = map[string][]byte{ |
| 25 | "Test.cpp": nil, |
| 26 | "include/Test.h": nil, |
| 27 | "include-android/AndroidTest.h": nil, |
| 28 | "include-host/HostTest.h": nil, |
| 29 | "arm64/include/Arm64Test.h": nil, |
| 30 | "libfoo.so": nil, |
| 31 | "aidl/foo/bar/Test.aidl": nil, |
| 32 | "some/where/stubslib.map.txt": nil, |
| 33 | } |
| 34 | |
Paul Duffin | d835daa | 2019-11-30 17:49:09 +0000 | [diff] [blame] | 35 | func testSdkWithCc(t *testing.T, bp string) *testSdkResult { |
| 36 | t.Helper() |
Martin Stjernholm | 7feceb2 | 2020-07-11 04:33:29 +0100 | [diff] [blame] | 37 | return testSdkWithFs(t, bp, ccTestFs) |
Paul Duffin | d835daa | 2019-11-30 17:49:09 +0000 | [diff] [blame] | 38 | } |
| 39 | |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 40 | // Contains tests for SDK members provided by the cc package. |
| 41 | |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 42 | func TestSingleDeviceOsAssumption(t *testing.T) { |
| 43 | // Mock a module with DeviceSupported() == true. |
| 44 | s := &sdk{} |
| 45 | android.InitAndroidArchModule(s, android.DeviceSupported, android.MultilibCommon) |
| 46 | |
| 47 | osTypes := s.getPossibleOsTypes() |
| 48 | if len(osTypes) != 1 { |
| 49 | // The snapshot generation assumes there is a single device OS. If more are |
| 50 | // added it might need to disable them by default, like it does for host |
| 51 | // OS'es. |
| 52 | t.Errorf("expected a single device OS, got %v", osTypes) |
| 53 | } |
| 54 | } |
| 55 | |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 56 | func TestSdkIsCompileMultilibBoth(t *testing.T) { |
Paul Duffin | d835daa | 2019-11-30 17:49:09 +0000 | [diff] [blame] | 57 | result := testSdkWithCc(t, ` |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 58 | sdk { |
| 59 | name: "mysdk", |
| 60 | native_shared_libs: ["sdkmember"], |
| 61 | } |
| 62 | |
| 63 | cc_library_shared { |
| 64 | name: "sdkmember", |
| 65 | srcs: ["Test.cpp"], |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 66 | stl: "none", |
| 67 | } |
| 68 | `) |
| 69 | |
Colin Cross | 7113d20 | 2019-11-20 16:39:12 -0800 | [diff] [blame] | 70 | armOutput := result.Module("sdkmember", "android_arm_armv7-a-neon_shared").(*cc.Module).OutputFile() |
| 71 | arm64Output := result.Module("sdkmember", "android_arm64_armv8-a_shared").(*cc.Module).OutputFile() |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 72 | |
| 73 | var inputs []string |
Paul Duffin | 1356d8c | 2020-02-25 19:26:33 +0000 | [diff] [blame] | 74 | buildParams := result.Module("mysdk", android.CommonOS.Name).BuildParamsForTests() |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 75 | for _, bp := range buildParams { |
| 76 | if bp.Input != nil { |
| 77 | inputs = append(inputs, bp.Input.String()) |
| 78 | } |
| 79 | } |
| 80 | |
| 81 | // ensure that both 32/64 outputs are inputs of the sdk snapshot |
| 82 | ensureListContains(t, inputs, armOutput.String()) |
| 83 | ensureListContains(t, inputs, arm64Output.String()) |
| 84 | } |
| 85 | |
Martin Stjernholm | 26ab8e8 | 2020-06-30 20:34:00 +0100 | [diff] [blame] | 86 | func TestSdkCompileMultilibOverride(t *testing.T) { |
| 87 | result := testSdkWithCc(t, ` |
| 88 | sdk { |
| 89 | name: "mysdk", |
Martin Stjernholm | 89238f4 | 2020-07-10 00:14:03 +0100 | [diff] [blame] | 90 | host_supported: true, |
Martin Stjernholm | 26ab8e8 | 2020-06-30 20:34:00 +0100 | [diff] [blame] | 91 | native_shared_libs: ["sdkmember"], |
| 92 | compile_multilib: "64", |
| 93 | } |
| 94 | |
| 95 | cc_library_shared { |
| 96 | name: "sdkmember", |
Martin Stjernholm | 89238f4 | 2020-07-10 00:14:03 +0100 | [diff] [blame] | 97 | host_supported: true, |
Martin Stjernholm | 26ab8e8 | 2020-06-30 20:34:00 +0100 | [diff] [blame] | 98 | srcs: ["Test.cpp"], |
| 99 | stl: "none", |
| 100 | compile_multilib: "64", |
| 101 | } |
| 102 | `) |
| 103 | |
| 104 | result.CheckSnapshot("mysdk", "", |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 105 | checkUnversionedAndroidBpContents(` |
Martin Stjernholm | 89238f4 | 2020-07-10 00:14:03 +0100 | [diff] [blame] | 106 | // This is auto-generated. DO NOT EDIT. |
| 107 | |
| 108 | cc_prebuilt_library_shared { |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 109 | name: "sdkmember", |
| 110 | prefer: false, |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 111 | visibility: ["//visibility:public"], |
Martin Stjernholm | 1e04109 | 2020-11-03 00:11:09 +0000 | [diff] [blame] | 112 | apex_available: ["//apex_available:platform"], |
Martin Stjernholm | 89238f4 | 2020-07-10 00:14:03 +0100 | [diff] [blame] | 113 | host_supported: true, |
Martin Stjernholm | 89238f4 | 2020-07-10 00:14:03 +0100 | [diff] [blame] | 114 | stl: "none", |
| 115 | compile_multilib: "64", |
Martin Stjernholm | 4cfa2c6 | 2020-07-10 19:55:36 +0100 | [diff] [blame] | 116 | target: { |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 117 | host: { |
| 118 | enabled: false, |
| 119 | }, |
Martin Stjernholm | 4cfa2c6 | 2020-07-10 19:55:36 +0100 | [diff] [blame] | 120 | android_arm64: { |
| 121 | srcs: ["android/arm64/lib/sdkmember.so"], |
| 122 | }, |
| 123 | linux_glibc_x86_64: { |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 124 | enabled: true, |
Martin Stjernholm | 4cfa2c6 | 2020-07-10 19:55:36 +0100 | [diff] [blame] | 125 | srcs: ["linux_glibc/x86_64/lib/sdkmember.so"], |
Martin Stjernholm | 89238f4 | 2020-07-10 00:14:03 +0100 | [diff] [blame] | 126 | }, |
| 127 | }, |
| 128 | } |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 129 | `), |
| 130 | checkVersionedAndroidBpContents(` |
| 131 | // This is auto-generated. DO NOT EDIT. |
Martin Stjernholm | 89238f4 | 2020-07-10 00:14:03 +0100 | [diff] [blame] | 132 | |
| 133 | cc_prebuilt_library_shared { |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 134 | name: "mysdk_sdkmember@current", |
| 135 | sdk_member_name: "sdkmember", |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 136 | visibility: ["//visibility:public"], |
Martin Stjernholm | 1e04109 | 2020-11-03 00:11:09 +0000 | [diff] [blame] | 137 | apex_available: ["//apex_available:platform"], |
Martin Stjernholm | 89238f4 | 2020-07-10 00:14:03 +0100 | [diff] [blame] | 138 | host_supported: true, |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 139 | installable: false, |
Martin Stjernholm | 89238f4 | 2020-07-10 00:14:03 +0100 | [diff] [blame] | 140 | stl: "none", |
| 141 | compile_multilib: "64", |
Martin Stjernholm | 4cfa2c6 | 2020-07-10 19:55:36 +0100 | [diff] [blame] | 142 | target: { |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 143 | host: { |
| 144 | enabled: false, |
| 145 | }, |
Martin Stjernholm | 4cfa2c6 | 2020-07-10 19:55:36 +0100 | [diff] [blame] | 146 | android_arm64: { |
| 147 | srcs: ["android/arm64/lib/sdkmember.so"], |
| 148 | }, |
| 149 | linux_glibc_x86_64: { |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 150 | enabled: true, |
Martin Stjernholm | 4cfa2c6 | 2020-07-10 19:55:36 +0100 | [diff] [blame] | 151 | srcs: ["linux_glibc/x86_64/lib/sdkmember.so"], |
Martin Stjernholm | 89238f4 | 2020-07-10 00:14:03 +0100 | [diff] [blame] | 152 | }, |
| 153 | }, |
| 154 | } |
| 155 | |
| 156 | sdk_snapshot { |
| 157 | name: "mysdk@current", |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 158 | visibility: ["//visibility:public"], |
Martin Stjernholm | 89238f4 | 2020-07-10 00:14:03 +0100 | [diff] [blame] | 159 | host_supported: true, |
| 160 | native_shared_libs: ["mysdk_sdkmember@current"], |
Martin Stjernholm | 4cfa2c6 | 2020-07-10 19:55:36 +0100 | [diff] [blame] | 161 | compile_multilib: "64", |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 162 | target: { |
| 163 | host: { |
| 164 | enabled: false, |
| 165 | }, |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 166 | linux_glibc_x86_64: { |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 167 | enabled: true, |
| 168 | }, |
| 169 | }, |
Martin Stjernholm | 89238f4 | 2020-07-10 00:14:03 +0100 | [diff] [blame] | 170 | } |
| 171 | `), |
Martin Stjernholm | 26ab8e8 | 2020-06-30 20:34:00 +0100 | [diff] [blame] | 172 | checkAllCopyRules(` |
Martin Stjernholm | 4cfa2c6 | 2020-07-10 19:55:36 +0100 | [diff] [blame] | 173 | .intermediates/sdkmember/android_arm64_armv8-a_shared/sdkmember.so -> android/arm64/lib/sdkmember.so |
| 174 | .intermediates/sdkmember/linux_glibc_x86_64_shared/sdkmember.so -> linux_glibc/x86_64/lib/sdkmember.so |
Martin Stjernholm | 26ab8e8 | 2020-06-30 20:34:00 +0100 | [diff] [blame] | 175 | `)) |
| 176 | } |
| 177 | |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 178 | func TestBasicSdkWithCc(t *testing.T) { |
Paul Duffin | d835daa | 2019-11-30 17:49:09 +0000 | [diff] [blame] | 179 | result := testSdkWithCc(t, ` |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 180 | sdk { |
| 181 | name: "mysdk", |
| 182 | native_shared_libs: ["sdkmember"], |
| 183 | } |
| 184 | |
Paul Duffin | a0843f6 | 2019-12-13 19:50:38 +0000 | [diff] [blame] | 185 | cc_library_shared { |
| 186 | name: "sdkmember", |
Colin Cross | f9aabd7 | 2020-02-15 11:29:50 -0800 | [diff] [blame] | 187 | system_shared_libs: [], |
Martin Stjernholm | cc77601 | 2020-07-07 03:22:21 +0100 | [diff] [blame] | 188 | stl: "none", |
| 189 | apex_available: ["mysdkapex"], |
Paul Duffin | a0843f6 | 2019-12-13 19:50:38 +0000 | [diff] [blame] | 190 | } |
| 191 | |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 192 | sdk_snapshot { |
| 193 | name: "mysdk@1", |
| 194 | native_shared_libs: ["sdkmember_mysdk_1"], |
| 195 | } |
| 196 | |
| 197 | sdk_snapshot { |
| 198 | name: "mysdk@2", |
| 199 | native_shared_libs: ["sdkmember_mysdk_2"], |
| 200 | } |
| 201 | |
| 202 | cc_prebuilt_library_shared { |
| 203 | name: "sdkmember", |
| 204 | srcs: ["libfoo.so"], |
| 205 | prefer: false, |
| 206 | system_shared_libs: [], |
| 207 | stl: "none", |
| 208 | } |
| 209 | |
| 210 | cc_prebuilt_library_shared { |
| 211 | name: "sdkmember_mysdk_1", |
| 212 | sdk_member_name: "sdkmember", |
| 213 | srcs: ["libfoo.so"], |
| 214 | system_shared_libs: [], |
| 215 | stl: "none", |
Anton Hansson | eec79eb | 2020-01-10 15:12:39 +0000 | [diff] [blame] | 216 | // TODO: remove //apex_available:platform |
| 217 | apex_available: [ |
| 218 | "//apex_available:platform", |
| 219 | "myapex", |
| 220 | ], |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 221 | } |
| 222 | |
| 223 | cc_prebuilt_library_shared { |
| 224 | name: "sdkmember_mysdk_2", |
| 225 | sdk_member_name: "sdkmember", |
| 226 | srcs: ["libfoo.so"], |
| 227 | system_shared_libs: [], |
| 228 | stl: "none", |
Anton Hansson | eec79eb | 2020-01-10 15:12:39 +0000 | [diff] [blame] | 229 | // TODO: remove //apex_available:platform |
| 230 | apex_available: [ |
| 231 | "//apex_available:platform", |
| 232 | "myapex2", |
| 233 | ], |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 234 | } |
| 235 | |
| 236 | cc_library_shared { |
| 237 | name: "mycpplib", |
| 238 | srcs: ["Test.cpp"], |
| 239 | shared_libs: ["sdkmember"], |
| 240 | system_shared_libs: [], |
| 241 | stl: "none", |
Anton Hansson | eec79eb | 2020-01-10 15:12:39 +0000 | [diff] [blame] | 242 | apex_available: [ |
| 243 | "myapex", |
| 244 | "myapex2", |
| 245 | ], |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 246 | } |
| 247 | |
| 248 | apex { |
| 249 | name: "myapex", |
| 250 | native_shared_libs: ["mycpplib"], |
| 251 | uses_sdks: ["mysdk@1"], |
| 252 | key: "myapex.key", |
| 253 | certificate: ":myapex.cert", |
| 254 | } |
| 255 | |
| 256 | apex { |
| 257 | name: "myapex2", |
| 258 | native_shared_libs: ["mycpplib"], |
| 259 | uses_sdks: ["mysdk@2"], |
| 260 | key: "myapex.key", |
| 261 | certificate: ":myapex.cert", |
| 262 | } |
Martin Stjernholm | cc77601 | 2020-07-07 03:22:21 +0100 | [diff] [blame] | 263 | |
| 264 | apex { |
| 265 | name: "mysdkapex", |
| 266 | native_shared_libs: ["sdkmember"], |
| 267 | key: "myapex.key", |
| 268 | certificate: ":myapex.cert", |
| 269 | } |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 270 | `) |
| 271 | |
Colin Cross | aede88c | 2020-08-11 12:17:01 -0700 | [diff] [blame] | 272 | sdkMemberV1 := result.ModuleForTests("sdkmember_mysdk_1", "android_arm64_armv8-a_shared_apex10000_mysdk_1").Rule("toc").Output |
| 273 | sdkMemberV2 := result.ModuleForTests("sdkmember_mysdk_2", "android_arm64_armv8-a_shared_apex10000_mysdk_2").Rule("toc").Output |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 274 | |
Colin Cross | aede88c | 2020-08-11 12:17:01 -0700 | [diff] [blame] | 275 | cpplibForMyApex := result.ModuleForTests("mycpplib", "android_arm64_armv8-a_shared_apex10000_mysdk_1") |
| 276 | cpplibForMyApex2 := result.ModuleForTests("mycpplib", "android_arm64_armv8-a_shared_apex10000_mysdk_2") |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 277 | |
| 278 | // Depending on the uses_sdks value, different libs are linked |
| 279 | ensureListContains(t, pathsToStrings(cpplibForMyApex.Rule("ld").Implicits), sdkMemberV1.String()) |
| 280 | ensureListContains(t, pathsToStrings(cpplibForMyApex2.Rule("ld").Implicits), sdkMemberV2.String()) |
| 281 | } |
| 282 | |
Paul Duffin | a0843f6 | 2019-12-13 19:50:38 +0000 | [diff] [blame] | 283 | // Make sure the sdk can use host specific cc libraries static/shared and both. |
| 284 | func TestHostSdkWithCc(t *testing.T) { |
| 285 | testSdkWithCc(t, ` |
| 286 | sdk { |
| 287 | name: "mysdk", |
| 288 | device_supported: false, |
| 289 | host_supported: true, |
| 290 | native_shared_libs: ["sdkshared"], |
| 291 | native_static_libs: ["sdkstatic"], |
| 292 | } |
| 293 | |
| 294 | cc_library_host_shared { |
| 295 | name: "sdkshared", |
Paul Duffin | a0843f6 | 2019-12-13 19:50:38 +0000 | [diff] [blame] | 296 | stl: "none", |
| 297 | } |
| 298 | |
| 299 | cc_library_host_static { |
| 300 | name: "sdkstatic", |
Paul Duffin | a0843f6 | 2019-12-13 19:50:38 +0000 | [diff] [blame] | 301 | stl: "none", |
| 302 | } |
| 303 | `) |
| 304 | } |
| 305 | |
| 306 | // Make sure the sdk can use cc libraries static/shared and both. |
| 307 | func TestSdkWithCc(t *testing.T) { |
| 308 | testSdkWithCc(t, ` |
| 309 | sdk { |
| 310 | name: "mysdk", |
| 311 | native_shared_libs: ["sdkshared", "sdkboth1"], |
| 312 | native_static_libs: ["sdkstatic", "sdkboth2"], |
| 313 | } |
| 314 | |
| 315 | cc_library_shared { |
| 316 | name: "sdkshared", |
Paul Duffin | a0843f6 | 2019-12-13 19:50:38 +0000 | [diff] [blame] | 317 | stl: "none", |
| 318 | } |
| 319 | |
| 320 | cc_library_static { |
| 321 | name: "sdkstatic", |
Paul Duffin | a0843f6 | 2019-12-13 19:50:38 +0000 | [diff] [blame] | 322 | stl: "none", |
| 323 | } |
| 324 | |
| 325 | cc_library { |
| 326 | name: "sdkboth1", |
Paul Duffin | a0843f6 | 2019-12-13 19:50:38 +0000 | [diff] [blame] | 327 | stl: "none", |
| 328 | } |
| 329 | |
| 330 | cc_library { |
| 331 | name: "sdkboth2", |
Paul Duffin | a0843f6 | 2019-12-13 19:50:38 +0000 | [diff] [blame] | 332 | stl: "none", |
| 333 | } |
| 334 | `) |
| 335 | } |
| 336 | |
Martin Stjernholm | cd07bce | 2020-03-10 22:37:59 +0000 | [diff] [blame] | 337 | func TestSnapshotWithObject(t *testing.T) { |
| 338 | result := testSdkWithCc(t, ` |
| 339 | sdk { |
| 340 | name: "mysdk", |
| 341 | native_objects: ["crtobj"], |
| 342 | } |
| 343 | |
| 344 | cc_object { |
| 345 | name: "crtobj", |
| 346 | stl: "none", |
Martin Stjernholm | fbb486f | 2020-08-21 18:43:51 +0100 | [diff] [blame] | 347 | sanitize: { |
| 348 | never: true, |
| 349 | }, |
Martin Stjernholm | cd07bce | 2020-03-10 22:37:59 +0000 | [diff] [blame] | 350 | } |
| 351 | `) |
| 352 | |
| 353 | result.CheckSnapshot("mysdk", "", |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 354 | checkUnversionedAndroidBpContents(` |
Martin Stjernholm | cd07bce | 2020-03-10 22:37:59 +0000 | [diff] [blame] | 355 | // This is auto-generated. DO NOT EDIT. |
| 356 | |
| 357 | cc_prebuilt_object { |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 358 | name: "crtobj", |
| 359 | prefer: false, |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 360 | visibility: ["//visibility:public"], |
Martin Stjernholm | 1e04109 | 2020-11-03 00:11:09 +0000 | [diff] [blame] | 361 | apex_available: ["//apex_available:platform"], |
Martin Stjernholm | cd07bce | 2020-03-10 22:37:59 +0000 | [diff] [blame] | 362 | stl: "none", |
Martin Stjernholm | 89238f4 | 2020-07-10 00:14:03 +0100 | [diff] [blame] | 363 | compile_multilib: "both", |
Martin Stjernholm | fbb486f | 2020-08-21 18:43:51 +0100 | [diff] [blame] | 364 | sanitize: { |
| 365 | never: true, |
| 366 | }, |
Martin Stjernholm | cd07bce | 2020-03-10 22:37:59 +0000 | [diff] [blame] | 367 | arch: { |
| 368 | arm64: { |
| 369 | srcs: ["arm64/lib/crtobj.o"], |
| 370 | }, |
| 371 | arm: { |
| 372 | srcs: ["arm/lib/crtobj.o"], |
| 373 | }, |
| 374 | }, |
| 375 | } |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 376 | `), |
| 377 | // Make sure that the generated sdk_snapshot uses the native_objects property. |
| 378 | checkVersionedAndroidBpContents(` |
| 379 | // This is auto-generated. DO NOT EDIT. |
Martin Stjernholm | cd07bce | 2020-03-10 22:37:59 +0000 | [diff] [blame] | 380 | |
| 381 | cc_prebuilt_object { |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 382 | name: "mysdk_crtobj@current", |
| 383 | sdk_member_name: "crtobj", |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 384 | visibility: ["//visibility:public"], |
Martin Stjernholm | 1e04109 | 2020-11-03 00:11:09 +0000 | [diff] [blame] | 385 | apex_available: ["//apex_available:platform"], |
Martin Stjernholm | cd07bce | 2020-03-10 22:37:59 +0000 | [diff] [blame] | 386 | stl: "none", |
Martin Stjernholm | 89238f4 | 2020-07-10 00:14:03 +0100 | [diff] [blame] | 387 | compile_multilib: "both", |
Martin Stjernholm | fbb486f | 2020-08-21 18:43:51 +0100 | [diff] [blame] | 388 | sanitize: { |
| 389 | never: true, |
| 390 | }, |
Martin Stjernholm | cd07bce | 2020-03-10 22:37:59 +0000 | [diff] [blame] | 391 | arch: { |
| 392 | arm64: { |
| 393 | srcs: ["arm64/lib/crtobj.o"], |
| 394 | }, |
| 395 | arm: { |
| 396 | srcs: ["arm/lib/crtobj.o"], |
| 397 | }, |
| 398 | }, |
| 399 | } |
| 400 | |
| 401 | sdk_snapshot { |
| 402 | name: "mysdk@current", |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 403 | visibility: ["//visibility:public"], |
Martin Stjernholm | cd07bce | 2020-03-10 22:37:59 +0000 | [diff] [blame] | 404 | native_objects: ["mysdk_crtobj@current"], |
| 405 | } |
| 406 | `), |
| 407 | checkAllCopyRules(` |
| 408 | .intermediates/crtobj/android_arm64_armv8-a/crtobj.o -> arm64/lib/crtobj.o |
| 409 | .intermediates/crtobj/android_arm_armv7-a-neon/crtobj.o -> arm/lib/crtobj.o |
| 410 | `), |
| 411 | ) |
| 412 | } |
| 413 | |
Paul Duffin | c62a510 | 2019-12-11 18:34:15 +0000 | [diff] [blame] | 414 | func TestSnapshotWithCcDuplicateHeaders(t *testing.T) { |
| 415 | result := testSdkWithCc(t, ` |
| 416 | sdk { |
| 417 | name: "mysdk", |
| 418 | native_shared_libs: ["mynativelib1", "mynativelib2"], |
| 419 | } |
| 420 | |
| 421 | cc_library_shared { |
| 422 | name: "mynativelib1", |
| 423 | srcs: [ |
| 424 | "Test.cpp", |
| 425 | ], |
| 426 | export_include_dirs: ["include"], |
Paul Duffin | c62a510 | 2019-12-11 18:34:15 +0000 | [diff] [blame] | 427 | stl: "none", |
| 428 | } |
| 429 | |
| 430 | cc_library_shared { |
| 431 | name: "mynativelib2", |
| 432 | srcs: [ |
| 433 | "Test.cpp", |
| 434 | ], |
| 435 | export_include_dirs: ["include"], |
Paul Duffin | c62a510 | 2019-12-11 18:34:15 +0000 | [diff] [blame] | 436 | stl: "none", |
| 437 | } |
| 438 | `) |
| 439 | |
Paul Duffin | 1356d8c | 2020-02-25 19:26:33 +0000 | [diff] [blame] | 440 | result.CheckSnapshot("mysdk", "", |
Paul Duffin | c62a510 | 2019-12-11 18:34:15 +0000 | [diff] [blame] | 441 | checkAllCopyRules(` |
| 442 | include/Test.h -> include/include/Test.h |
Colin Cross | 7113d20 | 2019-11-20 16:39:12 -0800 | [diff] [blame] | 443 | .intermediates/mynativelib1/android_arm64_armv8-a_shared/mynativelib1.so -> arm64/lib/mynativelib1.so |
| 444 | .intermediates/mynativelib1/android_arm_armv7-a-neon_shared/mynativelib1.so -> arm/lib/mynativelib1.so |
| 445 | .intermediates/mynativelib2/android_arm64_armv8-a_shared/mynativelib2.so -> arm64/lib/mynativelib2.so |
| 446 | .intermediates/mynativelib2/android_arm_armv7-a-neon_shared/mynativelib2.so -> arm/lib/mynativelib2.so |
Paul Duffin | c62a510 | 2019-12-11 18:34:15 +0000 | [diff] [blame] | 447 | `), |
| 448 | ) |
| 449 | } |
| 450 | |
Martin Stjernholm | b024957 | 2020-09-15 02:32:35 +0100 | [diff] [blame] | 451 | // Verify that when the shared library has some common and some arch specific |
| 452 | // properties that the generated snapshot is optimized properly. Substruct |
| 453 | // handling is tested with the sanitize clauses (but note there's a lot of |
| 454 | // built-in logic in sanitize.go that can affect those flags). |
Paul Duffin | a7cd8c8 | 2019-12-11 20:00:57 +0000 | [diff] [blame] | 455 | func TestSnapshotWithCcSharedLibraryCommonProperties(t *testing.T) { |
| 456 | result := testSdkWithCc(t, ` |
| 457 | sdk { |
| 458 | name: "mysdk", |
| 459 | native_shared_libs: ["mynativelib"], |
| 460 | } |
| 461 | |
| 462 | cc_library_shared { |
| 463 | name: "mynativelib", |
| 464 | srcs: [ |
| 465 | "Test.cpp", |
| 466 | "aidl/foo/bar/Test.aidl", |
| 467 | ], |
| 468 | export_include_dirs: ["include"], |
Martin Stjernholm | b024957 | 2020-09-15 02:32:35 +0100 | [diff] [blame] | 469 | sanitize: { |
| 470 | fuzzer: false, |
| 471 | integer_overflow: true, |
| 472 | diag: { undefined: false }, |
| 473 | }, |
Paul Duffin | a7cd8c8 | 2019-12-11 20:00:57 +0000 | [diff] [blame] | 474 | arch: { |
| 475 | arm64: { |
| 476 | export_system_include_dirs: ["arm64/include"], |
Martin Stjernholm | b024957 | 2020-09-15 02:32:35 +0100 | [diff] [blame] | 477 | sanitize: { |
Martin Stjernholm | b024957 | 2020-09-15 02:32:35 +0100 | [diff] [blame] | 478 | integer_overflow: false, |
| 479 | }, |
Paul Duffin | a7cd8c8 | 2019-12-11 20:00:57 +0000 | [diff] [blame] | 480 | }, |
| 481 | }, |
Paul Duffin | a7cd8c8 | 2019-12-11 20:00:57 +0000 | [diff] [blame] | 482 | stl: "none", |
| 483 | } |
| 484 | `) |
| 485 | |
Paul Duffin | 1356d8c | 2020-02-25 19:26:33 +0000 | [diff] [blame] | 486 | result.CheckSnapshot("mysdk", "", |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 487 | checkUnversionedAndroidBpContents(` |
Paul Duffin | a7cd8c8 | 2019-12-11 20:00:57 +0000 | [diff] [blame] | 488 | // This is auto-generated. DO NOT EDIT. |
| 489 | |
| 490 | cc_prebuilt_library_shared { |
Paul Duffin | a7cd8c8 | 2019-12-11 20:00:57 +0000 | [diff] [blame] | 491 | name: "mynativelib", |
| 492 | prefer: false, |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 493 | visibility: ["//visibility:public"], |
Martin Stjernholm | 1e04109 | 2020-11-03 00:11:09 +0000 | [diff] [blame] | 494 | apex_available: ["//apex_available:platform"], |
Paul Duffin | 0174d8d | 2020-03-11 18:42:08 +0000 | [diff] [blame] | 495 | stl: "none", |
Martin Stjernholm | 89238f4 | 2020-07-10 00:14:03 +0100 | [diff] [blame] | 496 | compile_multilib: "both", |
Paul Duffin | a7cd8c8 | 2019-12-11 20:00:57 +0000 | [diff] [blame] | 497 | export_include_dirs: ["include/include"], |
Martin Stjernholm | b024957 | 2020-09-15 02:32:35 +0100 | [diff] [blame] | 498 | sanitize: { |
| 499 | fuzzer: false, |
| 500 | diag: { |
| 501 | undefined: false, |
| 502 | }, |
| 503 | }, |
Paul Duffin | a7cd8c8 | 2019-12-11 20:00:57 +0000 | [diff] [blame] | 504 | arch: { |
| 505 | arm64: { |
| 506 | srcs: ["arm64/lib/mynativelib.so"], |
| 507 | export_system_include_dirs: ["arm64/include/arm64/include"], |
Martin Stjernholm | b024957 | 2020-09-15 02:32:35 +0100 | [diff] [blame] | 508 | sanitize: { |
Martin Stjernholm | b024957 | 2020-09-15 02:32:35 +0100 | [diff] [blame] | 509 | integer_overflow: false, |
| 510 | }, |
Paul Duffin | a7cd8c8 | 2019-12-11 20:00:57 +0000 | [diff] [blame] | 511 | }, |
| 512 | arm: { |
| 513 | srcs: ["arm/lib/mynativelib.so"], |
Martin Stjernholm | b024957 | 2020-09-15 02:32:35 +0100 | [diff] [blame] | 514 | sanitize: { |
| 515 | integer_overflow: true, |
| 516 | }, |
Paul Duffin | a7cd8c8 | 2019-12-11 20:00:57 +0000 | [diff] [blame] | 517 | }, |
| 518 | }, |
Paul Duffin | a7cd8c8 | 2019-12-11 20:00:57 +0000 | [diff] [blame] | 519 | } |
Paul Duffin | a7cd8c8 | 2019-12-11 20:00:57 +0000 | [diff] [blame] | 520 | `), |
| 521 | checkAllCopyRules(` |
| 522 | include/Test.h -> include/include/Test.h |
Martin Stjernholm | 59e0c7a | 2020-10-28 23:38:33 +0000 | [diff] [blame] | 523 | .intermediates/mynativelib/android_arm64_armv8-a_shared/mynativelib.so -> arm64/lib/mynativelib.so |
Paul Duffin | a7cd8c8 | 2019-12-11 20:00:57 +0000 | [diff] [blame] | 524 | arm64/include/Arm64Test.h -> arm64/include/arm64/include/Arm64Test.h |
Colin Cross | 7113d20 | 2019-11-20 16:39:12 -0800 | [diff] [blame] | 525 | .intermediates/mynativelib/android_arm_armv7-a-neon_shared/mynativelib.so -> arm/lib/mynativelib.so`), |
Paul Duffin | a7cd8c8 | 2019-12-11 20:00:57 +0000 | [diff] [blame] | 526 | ) |
| 527 | } |
| 528 | |
Paul Duffin | 25ce04b | 2020-01-16 11:47:25 +0000 | [diff] [blame] | 529 | func TestSnapshotWithCcBinary(t *testing.T) { |
| 530 | result := testSdkWithCc(t, ` |
| 531 | module_exports { |
| 532 | name: "mymodule_exports", |
| 533 | native_binaries: ["mynativebinary"], |
| 534 | } |
| 535 | |
| 536 | cc_binary { |
| 537 | name: "mynativebinary", |
| 538 | srcs: [ |
| 539 | "Test.cpp", |
| 540 | ], |
| 541 | compile_multilib: "both", |
Paul Duffin | 25ce04b | 2020-01-16 11:47:25 +0000 | [diff] [blame] | 542 | } |
| 543 | `) |
| 544 | |
Paul Duffin | 1356d8c | 2020-02-25 19:26:33 +0000 | [diff] [blame] | 545 | result.CheckSnapshot("mymodule_exports", "", |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 546 | checkUnversionedAndroidBpContents(` |
Paul Duffin | 25ce04b | 2020-01-16 11:47:25 +0000 | [diff] [blame] | 547 | // This is auto-generated. DO NOT EDIT. |
| 548 | |
| 549 | cc_prebuilt_binary { |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 550 | name: "mynativebinary", |
| 551 | prefer: false, |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 552 | visibility: ["//visibility:public"], |
Martin Stjernholm | 1e04109 | 2020-11-03 00:11:09 +0000 | [diff] [blame] | 553 | apex_available: ["//apex_available:platform"], |
Paul Duffin | 25ce04b | 2020-01-16 11:47:25 +0000 | [diff] [blame] | 554 | compile_multilib: "both", |
| 555 | arch: { |
| 556 | arm64: { |
| 557 | srcs: ["arm64/bin/mynativebinary"], |
| 558 | }, |
| 559 | arm: { |
| 560 | srcs: ["arm/bin/mynativebinary"], |
| 561 | }, |
| 562 | }, |
| 563 | } |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 564 | `), |
| 565 | // Make sure that the generated sdk_snapshot uses the native_binaries property. |
| 566 | checkVersionedAndroidBpContents(` |
| 567 | // This is auto-generated. DO NOT EDIT. |
Paul Duffin | 25ce04b | 2020-01-16 11:47:25 +0000 | [diff] [blame] | 568 | |
| 569 | cc_prebuilt_binary { |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 570 | name: "mymodule_exports_mynativebinary@current", |
| 571 | sdk_member_name: "mynativebinary", |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 572 | visibility: ["//visibility:public"], |
Martin Stjernholm | 1e04109 | 2020-11-03 00:11:09 +0000 | [diff] [blame] | 573 | apex_available: ["//apex_available:platform"], |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 574 | installable: false, |
Paul Duffin | 25ce04b | 2020-01-16 11:47:25 +0000 | [diff] [blame] | 575 | compile_multilib: "both", |
| 576 | arch: { |
| 577 | arm64: { |
| 578 | srcs: ["arm64/bin/mynativebinary"], |
| 579 | }, |
| 580 | arm: { |
| 581 | srcs: ["arm/bin/mynativebinary"], |
| 582 | }, |
| 583 | }, |
| 584 | } |
| 585 | |
| 586 | module_exports_snapshot { |
| 587 | name: "mymodule_exports@current", |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 588 | visibility: ["//visibility:public"], |
Paul Duffin | 25ce04b | 2020-01-16 11:47:25 +0000 | [diff] [blame] | 589 | native_binaries: ["mymodule_exports_mynativebinary@current"], |
| 590 | } |
| 591 | `), |
| 592 | checkAllCopyRules(` |
| 593 | .intermediates/mynativebinary/android_arm64_armv8-a/mynativebinary -> arm64/bin/mynativebinary |
| 594 | .intermediates/mynativebinary/android_arm_armv7-a-neon/mynativebinary -> arm/bin/mynativebinary |
| 595 | `), |
| 596 | ) |
| 597 | } |
| 598 | |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 599 | func TestMultipleHostOsTypesSnapshotWithCcBinary(t *testing.T) { |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 600 | result := testSdkWithCc(t, ` |
| 601 | module_exports { |
| 602 | name: "myexports", |
| 603 | device_supported: false, |
| 604 | host_supported: true, |
| 605 | native_binaries: ["mynativebinary"], |
| 606 | target: { |
| 607 | windows: { |
| 608 | enabled: true, |
| 609 | }, |
| 610 | }, |
| 611 | } |
| 612 | |
| 613 | cc_binary { |
| 614 | name: "mynativebinary", |
| 615 | device_supported: false, |
| 616 | host_supported: true, |
| 617 | srcs: [ |
| 618 | "Test.cpp", |
| 619 | ], |
| 620 | compile_multilib: "both", |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 621 | stl: "none", |
| 622 | target: { |
| 623 | windows: { |
| 624 | enabled: true, |
| 625 | }, |
| 626 | }, |
| 627 | } |
| 628 | `) |
| 629 | |
| 630 | result.CheckSnapshot("myexports", "", |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 631 | checkUnversionedAndroidBpContents(` |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 632 | // This is auto-generated. DO NOT EDIT. |
| 633 | |
| 634 | cc_prebuilt_binary { |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 635 | name: "mynativebinary", |
| 636 | prefer: false, |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 637 | visibility: ["//visibility:public"], |
Martin Stjernholm | 1e04109 | 2020-11-03 00:11:09 +0000 | [diff] [blame] | 638 | apex_available: ["//apex_available:platform"], |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 639 | device_supported: false, |
| 640 | host_supported: true, |
Martin Stjernholm | 7130fab | 2020-05-28 22:58:01 +0100 | [diff] [blame] | 641 | stl: "none", |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 642 | target: { |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 643 | host: { |
| 644 | enabled: false, |
| 645 | }, |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 646 | linux_glibc: { |
| 647 | compile_multilib: "both", |
| 648 | }, |
| 649 | linux_glibc_x86_64: { |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 650 | enabled: true, |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 651 | srcs: ["linux_glibc/x86_64/bin/mynativebinary"], |
| 652 | }, |
| 653 | linux_glibc_x86: { |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 654 | enabled: true, |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 655 | srcs: ["linux_glibc/x86/bin/mynativebinary"], |
| 656 | }, |
| 657 | windows: { |
| 658 | compile_multilib: "64", |
| 659 | }, |
| 660 | windows_x86_64: { |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 661 | enabled: true, |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 662 | srcs: ["windows/x86_64/bin/mynativebinary.exe"], |
| 663 | }, |
| 664 | }, |
| 665 | } |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 666 | `), |
| 667 | checkVersionedAndroidBpContents(` |
| 668 | // This is auto-generated. DO NOT EDIT. |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 669 | |
| 670 | cc_prebuilt_binary { |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 671 | name: "myexports_mynativebinary@current", |
| 672 | sdk_member_name: "mynativebinary", |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 673 | visibility: ["//visibility:public"], |
Martin Stjernholm | 1e04109 | 2020-11-03 00:11:09 +0000 | [diff] [blame] | 674 | apex_available: ["//apex_available:platform"], |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 675 | device_supported: false, |
| 676 | host_supported: true, |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 677 | installable: false, |
Martin Stjernholm | 7130fab | 2020-05-28 22:58:01 +0100 | [diff] [blame] | 678 | stl: "none", |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 679 | target: { |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 680 | host: { |
| 681 | enabled: false, |
| 682 | }, |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 683 | linux_glibc: { |
| 684 | compile_multilib: "both", |
| 685 | }, |
| 686 | linux_glibc_x86_64: { |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 687 | enabled: true, |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 688 | srcs: ["linux_glibc/x86_64/bin/mynativebinary"], |
| 689 | }, |
| 690 | linux_glibc_x86: { |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 691 | enabled: true, |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 692 | srcs: ["linux_glibc/x86/bin/mynativebinary"], |
| 693 | }, |
| 694 | windows: { |
| 695 | compile_multilib: "64", |
| 696 | }, |
| 697 | windows_x86_64: { |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 698 | enabled: true, |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 699 | srcs: ["windows/x86_64/bin/mynativebinary.exe"], |
| 700 | }, |
| 701 | }, |
| 702 | } |
| 703 | |
| 704 | module_exports_snapshot { |
| 705 | name: "myexports@current", |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 706 | visibility: ["//visibility:public"], |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 707 | device_supported: false, |
| 708 | host_supported: true, |
| 709 | native_binaries: ["myexports_mynativebinary@current"], |
Paul Duffin | 6a7e953 | 2020-03-20 17:50:07 +0000 | [diff] [blame] | 710 | target: { |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 711 | windows: { |
| 712 | compile_multilib: "64", |
| 713 | }, |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 714 | host: { |
| 715 | enabled: false, |
| 716 | }, |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 717 | linux_glibc_x86_64: { |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 718 | enabled: true, |
| 719 | }, |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 720 | linux_glibc_x86: { |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 721 | enabled: true, |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 722 | }, |
| 723 | windows_x86_64: { |
| 724 | enabled: true, |
Paul Duffin | 6a7e953 | 2020-03-20 17:50:07 +0000 | [diff] [blame] | 725 | }, |
| 726 | }, |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 727 | } |
| 728 | `), |
| 729 | checkAllCopyRules(` |
| 730 | .intermediates/mynativebinary/linux_glibc_x86_64/mynativebinary -> linux_glibc/x86_64/bin/mynativebinary |
| 731 | .intermediates/mynativebinary/linux_glibc_x86/mynativebinary -> linux_glibc/x86/bin/mynativebinary |
| 732 | .intermediates/mynativebinary/windows_x86_64/mynativebinary.exe -> windows/x86_64/bin/mynativebinary.exe |
| 733 | `), |
| 734 | ) |
| 735 | } |
| 736 | |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 737 | func TestSnapshotWithSingleHostOsType(t *testing.T) { |
| 738 | ctx, config := testSdkContext(` |
| 739 | cc_defaults { |
| 740 | name: "mydefaults", |
| 741 | device_supported: false, |
| 742 | host_supported: true, |
| 743 | compile_multilib: "64", |
| 744 | target: { |
| 745 | host: { |
| 746 | enabled: false, |
| 747 | }, |
| 748 | linux_bionic: { |
| 749 | enabled: true, |
| 750 | }, |
| 751 | }, |
| 752 | } |
| 753 | |
| 754 | module_exports { |
| 755 | name: "myexports", |
| 756 | defaults: ["mydefaults"], |
| 757 | native_shared_libs: ["mynativelib"], |
| 758 | native_binaries: ["mynativebinary"], |
| 759 | compile_multilib: "64", // The built-in default in sdk.go overrides mydefaults. |
| 760 | } |
| 761 | |
| 762 | cc_library { |
| 763 | name: "mynativelib", |
| 764 | defaults: ["mydefaults"], |
| 765 | srcs: [ |
| 766 | "Test.cpp", |
| 767 | ], |
| 768 | stl: "none", |
| 769 | } |
| 770 | |
| 771 | cc_binary { |
| 772 | name: "mynativebinary", |
| 773 | defaults: ["mydefaults"], |
| 774 | srcs: [ |
| 775 | "Test.cpp", |
| 776 | ], |
| 777 | stl: "none", |
| 778 | } |
| 779 | `, ccTestFs, []android.OsType{android.LinuxBionic}) |
| 780 | |
| 781 | result := runTests(t, ctx, config) |
| 782 | |
| 783 | result.CheckSnapshot("myexports", "", |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 784 | checkUnversionedAndroidBpContents(` |
| 785 | // This is auto-generated. DO NOT EDIT. |
| 786 | |
| 787 | cc_prebuilt_binary { |
| 788 | name: "mynativebinary", |
| 789 | prefer: false, |
| 790 | visibility: ["//visibility:public"], |
| 791 | apex_available: ["//apex_available:platform"], |
| 792 | device_supported: false, |
| 793 | host_supported: true, |
| 794 | stl: "none", |
| 795 | compile_multilib: "64", |
| 796 | target: { |
| 797 | host: { |
| 798 | enabled: false, |
| 799 | }, |
| 800 | linux_bionic_x86_64: { |
| 801 | enabled: true, |
| 802 | srcs: ["x86_64/bin/mynativebinary"], |
| 803 | }, |
| 804 | }, |
| 805 | } |
| 806 | |
| 807 | cc_prebuilt_library_shared { |
| 808 | name: "mynativelib", |
| 809 | prefer: false, |
| 810 | visibility: ["//visibility:public"], |
| 811 | apex_available: ["//apex_available:platform"], |
| 812 | device_supported: false, |
| 813 | host_supported: true, |
| 814 | stl: "none", |
| 815 | compile_multilib: "64", |
| 816 | target: { |
| 817 | host: { |
| 818 | enabled: false, |
| 819 | }, |
| 820 | linux_bionic_x86_64: { |
| 821 | enabled: true, |
| 822 | srcs: ["x86_64/lib/mynativelib.so"], |
| 823 | }, |
| 824 | }, |
| 825 | } |
| 826 | `), |
| 827 | checkVersionedAndroidBpContents(` |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 828 | // This is auto-generated. DO NOT EDIT. |
| 829 | |
| 830 | cc_prebuilt_binary { |
| 831 | name: "myexports_mynativebinary@current", |
| 832 | sdk_member_name: "mynativebinary", |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 833 | visibility: ["//visibility:public"], |
Martin Stjernholm | 1e04109 | 2020-11-03 00:11:09 +0000 | [diff] [blame] | 834 | apex_available: ["//apex_available:platform"], |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 835 | device_supported: false, |
| 836 | host_supported: true, |
| 837 | installable: false, |
| 838 | stl: "none", |
| 839 | compile_multilib: "64", |
| 840 | target: { |
| 841 | host: { |
| 842 | enabled: false, |
| 843 | }, |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 844 | linux_bionic_x86_64: { |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 845 | enabled: true, |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 846 | srcs: ["x86_64/bin/mynativebinary"], |
| 847 | }, |
| 848 | }, |
| 849 | } |
| 850 | |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 851 | cc_prebuilt_library_shared { |
| 852 | name: "myexports_mynativelib@current", |
| 853 | sdk_member_name: "mynativelib", |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 854 | visibility: ["//visibility:public"], |
Martin Stjernholm | 1e04109 | 2020-11-03 00:11:09 +0000 | [diff] [blame] | 855 | apex_available: ["//apex_available:platform"], |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 856 | device_supported: false, |
| 857 | host_supported: true, |
| 858 | installable: false, |
| 859 | stl: "none", |
| 860 | compile_multilib: "64", |
| 861 | target: { |
| 862 | host: { |
| 863 | enabled: false, |
| 864 | }, |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 865 | linux_bionic_x86_64: { |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 866 | enabled: true, |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 867 | srcs: ["x86_64/lib/mynativelib.so"], |
| 868 | }, |
| 869 | }, |
| 870 | } |
| 871 | |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 872 | module_exports_snapshot { |
| 873 | name: "myexports@current", |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 874 | visibility: ["//visibility:public"], |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 875 | device_supported: false, |
| 876 | host_supported: true, |
| 877 | native_binaries: ["myexports_mynativebinary@current"], |
| 878 | native_shared_libs: ["myexports_mynativelib@current"], |
| 879 | compile_multilib: "64", |
| 880 | target: { |
| 881 | host: { |
| 882 | enabled: false, |
| 883 | }, |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 884 | linux_bionic_x86_64: { |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 885 | enabled: true, |
| 886 | }, |
| 887 | }, |
| 888 | } |
| 889 | `), |
| 890 | checkAllCopyRules(` |
| 891 | .intermediates/mynativebinary/linux_bionic_x86_64/mynativebinary -> x86_64/bin/mynativebinary |
| 892 | .intermediates/mynativelib/linux_bionic_x86_64_shared/mynativelib.so -> x86_64/lib/mynativelib.so |
| 893 | `), |
| 894 | ) |
| 895 | } |
| 896 | |
Martin Stjernholm | 7130fab | 2020-05-28 22:58:01 +0100 | [diff] [blame] | 897 | // Test that we support the necessary flags for the linker binary, which is |
| 898 | // special in several ways. |
| 899 | func TestSnapshotWithCcStaticNocrtBinary(t *testing.T) { |
Martin Stjernholm | 7130fab | 2020-05-28 22:58:01 +0100 | [diff] [blame] | 900 | result := testSdkWithCc(t, ` |
| 901 | module_exports { |
| 902 | name: "mymodule_exports", |
| 903 | host_supported: true, |
| 904 | device_supported: false, |
| 905 | native_binaries: ["linker"], |
| 906 | } |
| 907 | |
| 908 | cc_binary { |
| 909 | name: "linker", |
| 910 | host_supported: true, |
| 911 | static_executable: true, |
| 912 | nocrt: true, |
| 913 | stl: "none", |
| 914 | srcs: [ |
| 915 | "Test.cpp", |
| 916 | ], |
| 917 | compile_multilib: "both", |
| 918 | } |
| 919 | `) |
| 920 | |
| 921 | result.CheckSnapshot("mymodule_exports", "", |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 922 | checkUnversionedAndroidBpContents(` |
Martin Stjernholm | 7130fab | 2020-05-28 22:58:01 +0100 | [diff] [blame] | 923 | // This is auto-generated. DO NOT EDIT. |
| 924 | |
| 925 | cc_prebuilt_binary { |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 926 | name: "linker", |
| 927 | prefer: false, |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 928 | visibility: ["//visibility:public"], |
Martin Stjernholm | 1e04109 | 2020-11-03 00:11:09 +0000 | [diff] [blame] | 929 | apex_available: ["//apex_available:platform"], |
Martin Stjernholm | 7130fab | 2020-05-28 22:58:01 +0100 | [diff] [blame] | 930 | device_supported: false, |
| 931 | host_supported: true, |
Martin Stjernholm | 7130fab | 2020-05-28 22:58:01 +0100 | [diff] [blame] | 932 | stl: "none", |
Martin Stjernholm | 89238f4 | 2020-07-10 00:14:03 +0100 | [diff] [blame] | 933 | compile_multilib: "both", |
Martin Stjernholm | 7130fab | 2020-05-28 22:58:01 +0100 | [diff] [blame] | 934 | static_executable: true, |
| 935 | nocrt: true, |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 936 | target: { |
| 937 | host: { |
| 938 | enabled: false, |
| 939 | }, |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 940 | linux_glibc_x86_64: { |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 941 | enabled: true, |
Martin Stjernholm | 7130fab | 2020-05-28 22:58:01 +0100 | [diff] [blame] | 942 | srcs: ["x86_64/bin/linker"], |
| 943 | }, |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 944 | linux_glibc_x86: { |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 945 | enabled: true, |
Martin Stjernholm | 7130fab | 2020-05-28 22:58:01 +0100 | [diff] [blame] | 946 | srcs: ["x86/bin/linker"], |
| 947 | }, |
| 948 | }, |
| 949 | } |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 950 | `), |
| 951 | checkVersionedAndroidBpContents(` |
| 952 | // This is auto-generated. DO NOT EDIT. |
Martin Stjernholm | 7130fab | 2020-05-28 22:58:01 +0100 | [diff] [blame] | 953 | |
| 954 | cc_prebuilt_binary { |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 955 | name: "mymodule_exports_linker@current", |
| 956 | sdk_member_name: "linker", |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 957 | visibility: ["//visibility:public"], |
Martin Stjernholm | 1e04109 | 2020-11-03 00:11:09 +0000 | [diff] [blame] | 958 | apex_available: ["//apex_available:platform"], |
Martin Stjernholm | 7130fab | 2020-05-28 22:58:01 +0100 | [diff] [blame] | 959 | device_supported: false, |
| 960 | host_supported: true, |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 961 | installable: false, |
Martin Stjernholm | 7130fab | 2020-05-28 22:58:01 +0100 | [diff] [blame] | 962 | stl: "none", |
Martin Stjernholm | 89238f4 | 2020-07-10 00:14:03 +0100 | [diff] [blame] | 963 | compile_multilib: "both", |
Martin Stjernholm | 7130fab | 2020-05-28 22:58:01 +0100 | [diff] [blame] | 964 | static_executable: true, |
| 965 | nocrt: true, |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 966 | target: { |
| 967 | host: { |
| 968 | enabled: false, |
| 969 | }, |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 970 | linux_glibc_x86_64: { |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 971 | enabled: true, |
Martin Stjernholm | 7130fab | 2020-05-28 22:58:01 +0100 | [diff] [blame] | 972 | srcs: ["x86_64/bin/linker"], |
| 973 | }, |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 974 | linux_glibc_x86: { |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 975 | enabled: true, |
Martin Stjernholm | 7130fab | 2020-05-28 22:58:01 +0100 | [diff] [blame] | 976 | srcs: ["x86/bin/linker"], |
| 977 | }, |
| 978 | }, |
| 979 | } |
| 980 | |
| 981 | module_exports_snapshot { |
| 982 | name: "mymodule_exports@current", |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 983 | visibility: ["//visibility:public"], |
Martin Stjernholm | 7130fab | 2020-05-28 22:58:01 +0100 | [diff] [blame] | 984 | device_supported: false, |
| 985 | host_supported: true, |
| 986 | native_binaries: ["mymodule_exports_linker@current"], |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 987 | target: { |
| 988 | host: { |
| 989 | enabled: false, |
| 990 | }, |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 991 | linux_glibc_x86_64: { |
| 992 | enabled: true, |
| 993 | }, |
| 994 | linux_glibc_x86: { |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 995 | enabled: true, |
| 996 | }, |
| 997 | }, |
Martin Stjernholm | 7130fab | 2020-05-28 22:58:01 +0100 | [diff] [blame] | 998 | } |
| 999 | `), |
| 1000 | checkAllCopyRules(` |
| 1001 | .intermediates/linker/linux_glibc_x86_64/linker -> x86_64/bin/linker |
| 1002 | .intermediates/linker/linux_glibc_x86/linker -> x86/bin/linker |
| 1003 | `), |
| 1004 | ) |
| 1005 | } |
| 1006 | |
Paul Duffin | 9ab556f | 2019-12-11 18:42:17 +0000 | [diff] [blame] | 1007 | func TestSnapshotWithCcSharedLibrary(t *testing.T) { |
Paul Duffin | d835daa | 2019-11-30 17:49:09 +0000 | [diff] [blame] | 1008 | result := testSdkWithCc(t, ` |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 1009 | sdk { |
| 1010 | name: "mysdk", |
| 1011 | native_shared_libs: ["mynativelib"], |
| 1012 | } |
| 1013 | |
| 1014 | cc_library_shared { |
| 1015 | name: "mynativelib", |
| 1016 | srcs: [ |
| 1017 | "Test.cpp", |
| 1018 | "aidl/foo/bar/Test.aidl", |
| 1019 | ], |
Paul Duffin | befa4b9 | 2020-03-04 14:22:45 +0000 | [diff] [blame] | 1020 | apex_available: ["apex1", "apex2"], |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 1021 | export_include_dirs: ["include"], |
| 1022 | aidl: { |
| 1023 | export_aidl_headers: true, |
| 1024 | }, |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 1025 | stl: "none", |
| 1026 | } |
| 1027 | `) |
| 1028 | |
Paul Duffin | 1356d8c | 2020-02-25 19:26:33 +0000 | [diff] [blame] | 1029 | result.CheckSnapshot("mysdk", "", |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 1030 | checkUnversionedAndroidBpContents(` |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 1031 | // This is auto-generated. DO NOT EDIT. |
| 1032 | |
| 1033 | cc_prebuilt_library_shared { |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 1034 | name: "mynativelib", |
| 1035 | prefer: false, |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 1036 | visibility: ["//visibility:public"], |
Paul Duffin | befa4b9 | 2020-03-04 14:22:45 +0000 | [diff] [blame] | 1037 | apex_available: [ |
| 1038 | "apex1", |
| 1039 | "apex2", |
| 1040 | ], |
Paul Duffin | 0174d8d | 2020-03-11 18:42:08 +0000 | [diff] [blame] | 1041 | stl: "none", |
Martin Stjernholm | 89238f4 | 2020-07-10 00:14:03 +0100 | [diff] [blame] | 1042 | compile_multilib: "both", |
Paul Duffin | 57b9e1d | 2019-12-13 00:03:35 +0000 | [diff] [blame] | 1043 | export_include_dirs: ["include/include"], |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 1044 | arch: { |
| 1045 | arm64: { |
| 1046 | srcs: ["arm64/lib/mynativelib.so"], |
Paul Duffin | 57b9e1d | 2019-12-13 00:03:35 +0000 | [diff] [blame] | 1047 | export_include_dirs: ["arm64/include_gen/mynativelib"], |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 1048 | }, |
| 1049 | arm: { |
| 1050 | srcs: ["arm/lib/mynativelib.so"], |
Paul Duffin | 57b9e1d | 2019-12-13 00:03:35 +0000 | [diff] [blame] | 1051 | export_include_dirs: ["arm/include_gen/mynativelib"], |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 1052 | }, |
| 1053 | }, |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 1054 | } |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 1055 | `), |
| 1056 | checkAllCopyRules(` |
Paul Duffin | 57b9e1d | 2019-12-13 00:03:35 +0000 | [diff] [blame] | 1057 | include/Test.h -> include/include/Test.h |
Colin Cross | 7113d20 | 2019-11-20 16:39:12 -0800 | [diff] [blame] | 1058 | .intermediates/mynativelib/android_arm64_armv8-a_shared/mynativelib.so -> arm64/lib/mynativelib.so |
| 1059 | .intermediates/mynativelib/android_arm64_armv8-a_shared/gen/aidl/aidl/foo/bar/Test.h -> arm64/include_gen/mynativelib/aidl/foo/bar/Test.h |
| 1060 | .intermediates/mynativelib/android_arm64_armv8-a_shared/gen/aidl/aidl/foo/bar/BnTest.h -> arm64/include_gen/mynativelib/aidl/foo/bar/BnTest.h |
| 1061 | .intermediates/mynativelib/android_arm64_armv8-a_shared/gen/aidl/aidl/foo/bar/BpTest.h -> arm64/include_gen/mynativelib/aidl/foo/bar/BpTest.h |
| 1062 | .intermediates/mynativelib/android_arm_armv7-a-neon_shared/mynativelib.so -> arm/lib/mynativelib.so |
| 1063 | .intermediates/mynativelib/android_arm_armv7-a-neon_shared/gen/aidl/aidl/foo/bar/Test.h -> arm/include_gen/mynativelib/aidl/foo/bar/Test.h |
| 1064 | .intermediates/mynativelib/android_arm_armv7-a-neon_shared/gen/aidl/aidl/foo/bar/BnTest.h -> arm/include_gen/mynativelib/aidl/foo/bar/BnTest.h |
| 1065 | .intermediates/mynativelib/android_arm_armv7-a-neon_shared/gen/aidl/aidl/foo/bar/BpTest.h -> arm/include_gen/mynativelib/aidl/foo/bar/BpTest.h |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 1066 | `), |
| 1067 | ) |
| 1068 | } |
| 1069 | |
Paul Duffin | 13f0271 | 2020-03-06 12:30:43 +0000 | [diff] [blame] | 1070 | func TestSnapshotWithCcSharedLibrarySharedLibs(t *testing.T) { |
| 1071 | result := testSdkWithCc(t, ` |
| 1072 | sdk { |
| 1073 | name: "mysdk", |
| 1074 | native_shared_libs: [ |
| 1075 | "mynativelib", |
| 1076 | "myothernativelib", |
| 1077 | "mysystemnativelib", |
| 1078 | ], |
| 1079 | } |
| 1080 | |
| 1081 | cc_library { |
| 1082 | name: "mysystemnativelib", |
| 1083 | srcs: [ |
| 1084 | "Test.cpp", |
| 1085 | ], |
Paul Duffin | 13f0271 | 2020-03-06 12:30:43 +0000 | [diff] [blame] | 1086 | stl: "none", |
| 1087 | } |
| 1088 | |
| 1089 | cc_library_shared { |
| 1090 | name: "myothernativelib", |
| 1091 | srcs: [ |
| 1092 | "Test.cpp", |
| 1093 | ], |
| 1094 | system_shared_libs: [ |
| 1095 | // A reference to a library that is not an sdk member. Uses libm as that |
| 1096 | // is in the default set of modules available to this test and so is available |
| 1097 | // both here and also when the generated Android.bp file is tested in |
| 1098 | // CheckSnapshot(). This ensures that the system_shared_libs property correctly |
| 1099 | // handles references to modules that are not sdk members. |
| 1100 | "libm", |
| 1101 | ], |
| 1102 | stl: "none", |
| 1103 | } |
| 1104 | |
| 1105 | cc_library { |
| 1106 | name: "mynativelib", |
| 1107 | srcs: [ |
| 1108 | "Test.cpp", |
| 1109 | ], |
| 1110 | shared_libs: [ |
| 1111 | // A reference to another sdk member. |
| 1112 | "myothernativelib", |
| 1113 | ], |
| 1114 | target: { |
| 1115 | android: { |
| 1116 | shared: { |
| 1117 | shared_libs: [ |
| 1118 | // A reference to a library that is not an sdk member. The libc library |
| 1119 | // is used here to check that the shared_libs property is handled correctly |
| 1120 | // in a similar way to how libm is used to check system_shared_libs above. |
| 1121 | "libc", |
| 1122 | ], |
| 1123 | }, |
| 1124 | }, |
| 1125 | }, |
Paul Duffin | 13f0271 | 2020-03-06 12:30:43 +0000 | [diff] [blame] | 1126 | stl: "none", |
| 1127 | } |
| 1128 | `) |
| 1129 | |
| 1130 | result.CheckSnapshot("mysdk", "", |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 1131 | checkUnversionedAndroidBpContents(` |
Paul Duffin | 13f0271 | 2020-03-06 12:30:43 +0000 | [diff] [blame] | 1132 | // This is auto-generated. DO NOT EDIT. |
| 1133 | |
| 1134 | cc_prebuilt_library_shared { |
Paul Duffin | 13f0271 | 2020-03-06 12:30:43 +0000 | [diff] [blame] | 1135 | name: "mynativelib", |
| 1136 | prefer: false, |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 1137 | visibility: ["//visibility:public"], |
Martin Stjernholm | 1e04109 | 2020-11-03 00:11:09 +0000 | [diff] [blame] | 1138 | apex_available: ["//apex_available:platform"], |
Paul Duffin | 0174d8d | 2020-03-11 18:42:08 +0000 | [diff] [blame] | 1139 | stl: "none", |
Martin Stjernholm | 89238f4 | 2020-07-10 00:14:03 +0100 | [diff] [blame] | 1140 | compile_multilib: "both", |
Paul Duffin | 13f0271 | 2020-03-06 12:30:43 +0000 | [diff] [blame] | 1141 | shared_libs: [ |
| 1142 | "myothernativelib", |
| 1143 | "libc", |
| 1144 | ], |
| 1145 | arch: { |
| 1146 | arm64: { |
| 1147 | srcs: ["arm64/lib/mynativelib.so"], |
| 1148 | }, |
| 1149 | arm: { |
| 1150 | srcs: ["arm/lib/mynativelib.so"], |
| 1151 | }, |
| 1152 | }, |
Paul Duffin | 13f0271 | 2020-03-06 12:30:43 +0000 | [diff] [blame] | 1153 | } |
| 1154 | |
| 1155 | cc_prebuilt_library_shared { |
Paul Duffin | 13f0271 | 2020-03-06 12:30:43 +0000 | [diff] [blame] | 1156 | name: "myothernativelib", |
| 1157 | prefer: false, |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 1158 | visibility: ["//visibility:public"], |
Martin Stjernholm | 1e04109 | 2020-11-03 00:11:09 +0000 | [diff] [blame] | 1159 | apex_available: ["//apex_available:platform"], |
Paul Duffin | 0174d8d | 2020-03-11 18:42:08 +0000 | [diff] [blame] | 1160 | stl: "none", |
Martin Stjernholm | 89238f4 | 2020-07-10 00:14:03 +0100 | [diff] [blame] | 1161 | compile_multilib: "both", |
Paul Duffin | 13f0271 | 2020-03-06 12:30:43 +0000 | [diff] [blame] | 1162 | system_shared_libs: ["libm"], |
| 1163 | arch: { |
| 1164 | arm64: { |
| 1165 | srcs: ["arm64/lib/myothernativelib.so"], |
| 1166 | }, |
| 1167 | arm: { |
| 1168 | srcs: ["arm/lib/myothernativelib.so"], |
| 1169 | }, |
| 1170 | }, |
Paul Duffin | 13f0271 | 2020-03-06 12:30:43 +0000 | [diff] [blame] | 1171 | } |
| 1172 | |
| 1173 | cc_prebuilt_library_shared { |
Paul Duffin | 13f0271 | 2020-03-06 12:30:43 +0000 | [diff] [blame] | 1174 | name: "mysystemnativelib", |
| 1175 | prefer: false, |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 1176 | visibility: ["//visibility:public"], |
Martin Stjernholm | 1e04109 | 2020-11-03 00:11:09 +0000 | [diff] [blame] | 1177 | apex_available: ["//apex_available:platform"], |
Paul Duffin | 0174d8d | 2020-03-11 18:42:08 +0000 | [diff] [blame] | 1178 | stl: "none", |
Martin Stjernholm | 89238f4 | 2020-07-10 00:14:03 +0100 | [diff] [blame] | 1179 | compile_multilib: "both", |
Paul Duffin | 13f0271 | 2020-03-06 12:30:43 +0000 | [diff] [blame] | 1180 | arch: { |
| 1181 | arm64: { |
| 1182 | srcs: ["arm64/lib/mysystemnativelib.so"], |
| 1183 | }, |
| 1184 | arm: { |
| 1185 | srcs: ["arm/lib/mysystemnativelib.so"], |
| 1186 | }, |
| 1187 | }, |
Paul Duffin | 13f0271 | 2020-03-06 12:30:43 +0000 | [diff] [blame] | 1188 | } |
Paul Duffin | 13f0271 | 2020-03-06 12:30:43 +0000 | [diff] [blame] | 1189 | `), |
| 1190 | checkAllCopyRules(` |
| 1191 | .intermediates/mynativelib/android_arm64_armv8-a_shared/mynativelib.so -> arm64/lib/mynativelib.so |
| 1192 | .intermediates/mynativelib/android_arm_armv7-a-neon_shared/mynativelib.so -> arm/lib/mynativelib.so |
| 1193 | .intermediates/myothernativelib/android_arm64_armv8-a_shared/myothernativelib.so -> arm64/lib/myothernativelib.so |
| 1194 | .intermediates/myothernativelib/android_arm_armv7-a-neon_shared/myothernativelib.so -> arm/lib/myothernativelib.so |
| 1195 | .intermediates/mysystemnativelib/android_arm64_armv8-a_shared/mysystemnativelib.so -> arm64/lib/mysystemnativelib.so |
| 1196 | .intermediates/mysystemnativelib/android_arm_armv7-a-neon_shared/mysystemnativelib.so -> arm/lib/mysystemnativelib.so |
| 1197 | `), |
| 1198 | ) |
| 1199 | } |
| 1200 | |
Paul Duffin | 9ab556f | 2019-12-11 18:42:17 +0000 | [diff] [blame] | 1201 | func TestHostSnapshotWithCcSharedLibrary(t *testing.T) { |
Paul Duffin | d835daa | 2019-11-30 17:49:09 +0000 | [diff] [blame] | 1202 | result := testSdkWithCc(t, ` |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 1203 | sdk { |
| 1204 | name: "mysdk", |
| 1205 | device_supported: false, |
| 1206 | host_supported: true, |
| 1207 | native_shared_libs: ["mynativelib"], |
| 1208 | } |
| 1209 | |
| 1210 | cc_library_shared { |
| 1211 | name: "mynativelib", |
| 1212 | device_supported: false, |
| 1213 | host_supported: true, |
| 1214 | srcs: [ |
| 1215 | "Test.cpp", |
| 1216 | "aidl/foo/bar/Test.aidl", |
| 1217 | ], |
| 1218 | export_include_dirs: ["include"], |
| 1219 | aidl: { |
| 1220 | export_aidl_headers: true, |
| 1221 | }, |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 1222 | stl: "none", |
Paul Duffin | 0c394f3 | 2020-03-05 14:09:58 +0000 | [diff] [blame] | 1223 | sdk_version: "minimum", |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 1224 | } |
| 1225 | `) |
| 1226 | |
Paul Duffin | 1356d8c | 2020-02-25 19:26:33 +0000 | [diff] [blame] | 1227 | result.CheckSnapshot("mysdk", "", |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 1228 | checkUnversionedAndroidBpContents(` |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 1229 | // This is auto-generated. DO NOT EDIT. |
| 1230 | |
| 1231 | cc_prebuilt_library_shared { |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 1232 | name: "mynativelib", |
| 1233 | prefer: false, |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 1234 | visibility: ["//visibility:public"], |
Martin Stjernholm | 1e04109 | 2020-11-03 00:11:09 +0000 | [diff] [blame] | 1235 | apex_available: ["//apex_available:platform"], |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 1236 | device_supported: false, |
| 1237 | host_supported: true, |
Paul Duffin | 0c394f3 | 2020-03-05 14:09:58 +0000 | [diff] [blame] | 1238 | sdk_version: "minimum", |
Paul Duffin | 0174d8d | 2020-03-11 18:42:08 +0000 | [diff] [blame] | 1239 | stl: "none", |
Martin Stjernholm | 89238f4 | 2020-07-10 00:14:03 +0100 | [diff] [blame] | 1240 | compile_multilib: "both", |
Paul Duffin | 57b9e1d | 2019-12-13 00:03:35 +0000 | [diff] [blame] | 1241 | export_include_dirs: ["include/include"], |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 1242 | target: { |
| 1243 | host: { |
| 1244 | enabled: false, |
| 1245 | }, |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 1246 | linux_glibc_x86_64: { |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 1247 | enabled: true, |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 1248 | srcs: ["x86_64/lib/mynativelib.so"], |
Paul Duffin | 57b9e1d | 2019-12-13 00:03:35 +0000 | [diff] [blame] | 1249 | export_include_dirs: ["x86_64/include_gen/mynativelib"], |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 1250 | }, |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 1251 | linux_glibc_x86: { |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 1252 | enabled: true, |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 1253 | srcs: ["x86/lib/mynativelib.so"], |
Paul Duffin | 57b9e1d | 2019-12-13 00:03:35 +0000 | [diff] [blame] | 1254 | export_include_dirs: ["x86/include_gen/mynativelib"], |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 1255 | }, |
| 1256 | }, |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 1257 | } |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 1258 | `), |
| 1259 | checkVersionedAndroidBpContents(` |
| 1260 | // This is auto-generated. DO NOT EDIT. |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 1261 | |
| 1262 | cc_prebuilt_library_shared { |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 1263 | name: "mysdk_mynativelib@current", |
| 1264 | sdk_member_name: "mynativelib", |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 1265 | visibility: ["//visibility:public"], |
Martin Stjernholm | 1e04109 | 2020-11-03 00:11:09 +0000 | [diff] [blame] | 1266 | apex_available: ["//apex_available:platform"], |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 1267 | device_supported: false, |
| 1268 | host_supported: true, |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 1269 | installable: false, |
Paul Duffin | 0c394f3 | 2020-03-05 14:09:58 +0000 | [diff] [blame] | 1270 | sdk_version: "minimum", |
Paul Duffin | 0174d8d | 2020-03-11 18:42:08 +0000 | [diff] [blame] | 1271 | stl: "none", |
Martin Stjernholm | 89238f4 | 2020-07-10 00:14:03 +0100 | [diff] [blame] | 1272 | compile_multilib: "both", |
Paul Duffin | 57b9e1d | 2019-12-13 00:03:35 +0000 | [diff] [blame] | 1273 | export_include_dirs: ["include/include"], |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 1274 | target: { |
| 1275 | host: { |
| 1276 | enabled: false, |
| 1277 | }, |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 1278 | linux_glibc_x86_64: { |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 1279 | enabled: true, |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 1280 | srcs: ["x86_64/lib/mynativelib.so"], |
Paul Duffin | 57b9e1d | 2019-12-13 00:03:35 +0000 | [diff] [blame] | 1281 | export_include_dirs: ["x86_64/include_gen/mynativelib"], |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 1282 | }, |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 1283 | linux_glibc_x86: { |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 1284 | enabled: true, |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 1285 | srcs: ["x86/lib/mynativelib.so"], |
Paul Duffin | 57b9e1d | 2019-12-13 00:03:35 +0000 | [diff] [blame] | 1286 | export_include_dirs: ["x86/include_gen/mynativelib"], |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 1287 | }, |
| 1288 | }, |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 1289 | } |
| 1290 | |
| 1291 | sdk_snapshot { |
| 1292 | name: "mysdk@current", |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 1293 | visibility: ["//visibility:public"], |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 1294 | device_supported: false, |
| 1295 | host_supported: true, |
| 1296 | native_shared_libs: ["mysdk_mynativelib@current"], |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 1297 | target: { |
| 1298 | host: { |
| 1299 | enabled: false, |
| 1300 | }, |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 1301 | linux_glibc_x86_64: { |
| 1302 | enabled: true, |
| 1303 | }, |
| 1304 | linux_glibc_x86: { |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 1305 | enabled: true, |
| 1306 | }, |
| 1307 | }, |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 1308 | } |
| 1309 | `), |
| 1310 | checkAllCopyRules(` |
Paul Duffin | 57b9e1d | 2019-12-13 00:03:35 +0000 | [diff] [blame] | 1311 | include/Test.h -> include/include/Test.h |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 1312 | .intermediates/mynativelib/linux_glibc_x86_64_shared/mynativelib.so -> x86_64/lib/mynativelib.so |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 1313 | .intermediates/mynativelib/linux_glibc_x86_64_shared/gen/aidl/aidl/foo/bar/Test.h -> x86_64/include_gen/mynativelib/aidl/foo/bar/Test.h |
| 1314 | .intermediates/mynativelib/linux_glibc_x86_64_shared/gen/aidl/aidl/foo/bar/BnTest.h -> x86_64/include_gen/mynativelib/aidl/foo/bar/BnTest.h |
| 1315 | .intermediates/mynativelib/linux_glibc_x86_64_shared/gen/aidl/aidl/foo/bar/BpTest.h -> x86_64/include_gen/mynativelib/aidl/foo/bar/BpTest.h |
| 1316 | .intermediates/mynativelib/linux_glibc_x86_shared/mynativelib.so -> x86/lib/mynativelib.so |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 1317 | .intermediates/mynativelib/linux_glibc_x86_shared/gen/aidl/aidl/foo/bar/Test.h -> x86/include_gen/mynativelib/aidl/foo/bar/Test.h |
| 1318 | .intermediates/mynativelib/linux_glibc_x86_shared/gen/aidl/aidl/foo/bar/BnTest.h -> x86/include_gen/mynativelib/aidl/foo/bar/BnTest.h |
| 1319 | .intermediates/mynativelib/linux_glibc_x86_shared/gen/aidl/aidl/foo/bar/BpTest.h -> x86/include_gen/mynativelib/aidl/foo/bar/BpTest.h |
| 1320 | `), |
| 1321 | ) |
| 1322 | } |
Paul Duffin | 9ab556f | 2019-12-11 18:42:17 +0000 | [diff] [blame] | 1323 | |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 1324 | func TestMultipleHostOsTypesSnapshotWithCcSharedLibrary(t *testing.T) { |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 1325 | result := testSdkWithCc(t, ` |
| 1326 | sdk { |
| 1327 | name: "mysdk", |
| 1328 | device_supported: false, |
| 1329 | host_supported: true, |
| 1330 | native_shared_libs: ["mynativelib"], |
| 1331 | target: { |
| 1332 | windows: { |
| 1333 | enabled: true, |
| 1334 | }, |
| 1335 | }, |
| 1336 | } |
| 1337 | |
| 1338 | cc_library_shared { |
| 1339 | name: "mynativelib", |
| 1340 | device_supported: false, |
| 1341 | host_supported: true, |
| 1342 | srcs: [ |
| 1343 | "Test.cpp", |
| 1344 | ], |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 1345 | stl: "none", |
| 1346 | target: { |
| 1347 | windows: { |
| 1348 | enabled: true, |
| 1349 | }, |
| 1350 | }, |
| 1351 | } |
| 1352 | `) |
| 1353 | |
| 1354 | result.CheckSnapshot("mysdk", "", |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 1355 | checkUnversionedAndroidBpContents(` |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 1356 | // This is auto-generated. DO NOT EDIT. |
| 1357 | |
| 1358 | cc_prebuilt_library_shared { |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 1359 | name: "mynativelib", |
| 1360 | prefer: false, |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 1361 | visibility: ["//visibility:public"], |
Martin Stjernholm | 1e04109 | 2020-11-03 00:11:09 +0000 | [diff] [blame] | 1362 | apex_available: ["//apex_available:platform"], |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 1363 | device_supported: false, |
| 1364 | host_supported: true, |
Paul Duffin | 0174d8d | 2020-03-11 18:42:08 +0000 | [diff] [blame] | 1365 | stl: "none", |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 1366 | target: { |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 1367 | host: { |
| 1368 | enabled: false, |
| 1369 | }, |
Martin Stjernholm | 89238f4 | 2020-07-10 00:14:03 +0100 | [diff] [blame] | 1370 | linux_glibc: { |
| 1371 | compile_multilib: "both", |
| 1372 | }, |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 1373 | linux_glibc_x86_64: { |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 1374 | enabled: true, |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 1375 | srcs: ["linux_glibc/x86_64/lib/mynativelib.so"], |
| 1376 | }, |
| 1377 | linux_glibc_x86: { |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 1378 | enabled: true, |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 1379 | srcs: ["linux_glibc/x86/lib/mynativelib.so"], |
| 1380 | }, |
Martin Stjernholm | 89238f4 | 2020-07-10 00:14:03 +0100 | [diff] [blame] | 1381 | windows: { |
| 1382 | compile_multilib: "64", |
| 1383 | }, |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 1384 | windows_x86_64: { |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 1385 | enabled: true, |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 1386 | srcs: ["windows/x86_64/lib/mynativelib.dll"], |
| 1387 | }, |
| 1388 | }, |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 1389 | } |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 1390 | `), |
| 1391 | checkVersionedAndroidBpContents(` |
| 1392 | // This is auto-generated. DO NOT EDIT. |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 1393 | |
| 1394 | cc_prebuilt_library_shared { |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 1395 | name: "mysdk_mynativelib@current", |
| 1396 | sdk_member_name: "mynativelib", |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 1397 | visibility: ["//visibility:public"], |
Martin Stjernholm | 1e04109 | 2020-11-03 00:11:09 +0000 | [diff] [blame] | 1398 | apex_available: ["//apex_available:platform"], |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 1399 | device_supported: false, |
| 1400 | host_supported: true, |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 1401 | installable: false, |
Paul Duffin | 0174d8d | 2020-03-11 18:42:08 +0000 | [diff] [blame] | 1402 | stl: "none", |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 1403 | target: { |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 1404 | host: { |
| 1405 | enabled: false, |
| 1406 | }, |
Martin Stjernholm | 89238f4 | 2020-07-10 00:14:03 +0100 | [diff] [blame] | 1407 | linux_glibc: { |
| 1408 | compile_multilib: "both", |
| 1409 | }, |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 1410 | linux_glibc_x86_64: { |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 1411 | enabled: true, |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 1412 | srcs: ["linux_glibc/x86_64/lib/mynativelib.so"], |
| 1413 | }, |
| 1414 | linux_glibc_x86: { |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 1415 | enabled: true, |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 1416 | srcs: ["linux_glibc/x86/lib/mynativelib.so"], |
| 1417 | }, |
Martin Stjernholm | 89238f4 | 2020-07-10 00:14:03 +0100 | [diff] [blame] | 1418 | windows: { |
| 1419 | compile_multilib: "64", |
| 1420 | }, |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 1421 | windows_x86_64: { |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 1422 | enabled: true, |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 1423 | srcs: ["windows/x86_64/lib/mynativelib.dll"], |
| 1424 | }, |
| 1425 | }, |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 1426 | } |
| 1427 | |
| 1428 | sdk_snapshot { |
| 1429 | name: "mysdk@current", |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 1430 | visibility: ["//visibility:public"], |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 1431 | device_supported: false, |
| 1432 | host_supported: true, |
| 1433 | native_shared_libs: ["mysdk_mynativelib@current"], |
Paul Duffin | 6a7e953 | 2020-03-20 17:50:07 +0000 | [diff] [blame] | 1434 | target: { |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 1435 | windows: { |
| 1436 | compile_multilib: "64", |
| 1437 | }, |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 1438 | host: { |
| 1439 | enabled: false, |
| 1440 | }, |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 1441 | linux_glibc_x86_64: { |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 1442 | enabled: true, |
| 1443 | }, |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 1444 | linux_glibc_x86: { |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 1445 | enabled: true, |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 1446 | }, |
| 1447 | windows_x86_64: { |
| 1448 | enabled: true, |
Paul Duffin | 6a7e953 | 2020-03-20 17:50:07 +0000 | [diff] [blame] | 1449 | }, |
| 1450 | }, |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 1451 | } |
| 1452 | `), |
| 1453 | checkAllCopyRules(` |
| 1454 | .intermediates/mynativelib/linux_glibc_x86_64_shared/mynativelib.so -> linux_glibc/x86_64/lib/mynativelib.so |
| 1455 | .intermediates/mynativelib/linux_glibc_x86_shared/mynativelib.so -> linux_glibc/x86/lib/mynativelib.so |
| 1456 | .intermediates/mynativelib/windows_x86_64_shared/mynativelib.dll -> windows/x86_64/lib/mynativelib.dll |
| 1457 | `), |
| 1458 | ) |
| 1459 | } |
| 1460 | |
Paul Duffin | 9ab556f | 2019-12-11 18:42:17 +0000 | [diff] [blame] | 1461 | func TestSnapshotWithCcStaticLibrary(t *testing.T) { |
| 1462 | result := testSdkWithCc(t, ` |
Paul Duffin | e602918 | 2019-12-16 17:43:48 +0000 | [diff] [blame] | 1463 | module_exports { |
| 1464 | name: "myexports", |
Paul Duffin | 9ab556f | 2019-12-11 18:42:17 +0000 | [diff] [blame] | 1465 | native_static_libs: ["mynativelib"], |
| 1466 | } |
| 1467 | |
| 1468 | cc_library_static { |
| 1469 | name: "mynativelib", |
| 1470 | srcs: [ |
| 1471 | "Test.cpp", |
| 1472 | "aidl/foo/bar/Test.aidl", |
| 1473 | ], |
| 1474 | export_include_dirs: ["include"], |
| 1475 | aidl: { |
| 1476 | export_aidl_headers: true, |
| 1477 | }, |
Paul Duffin | 9ab556f | 2019-12-11 18:42:17 +0000 | [diff] [blame] | 1478 | stl: "none", |
| 1479 | } |
| 1480 | `) |
| 1481 | |
Paul Duffin | 1356d8c | 2020-02-25 19:26:33 +0000 | [diff] [blame] | 1482 | result.CheckSnapshot("myexports", "", |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 1483 | checkUnversionedAndroidBpContents(` |
Paul Duffin | 9ab556f | 2019-12-11 18:42:17 +0000 | [diff] [blame] | 1484 | // This is auto-generated. DO NOT EDIT. |
| 1485 | |
| 1486 | cc_prebuilt_library_static { |
Paul Duffin | 9ab556f | 2019-12-11 18:42:17 +0000 | [diff] [blame] | 1487 | name: "mynativelib", |
| 1488 | prefer: false, |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 1489 | visibility: ["//visibility:public"], |
Martin Stjernholm | 1e04109 | 2020-11-03 00:11:09 +0000 | [diff] [blame] | 1490 | apex_available: ["//apex_available:platform"], |
Paul Duffin | 0174d8d | 2020-03-11 18:42:08 +0000 | [diff] [blame] | 1491 | stl: "none", |
Martin Stjernholm | 89238f4 | 2020-07-10 00:14:03 +0100 | [diff] [blame] | 1492 | compile_multilib: "both", |
Paul Duffin | 57b9e1d | 2019-12-13 00:03:35 +0000 | [diff] [blame] | 1493 | export_include_dirs: ["include/include"], |
Paul Duffin | 9ab556f | 2019-12-11 18:42:17 +0000 | [diff] [blame] | 1494 | arch: { |
| 1495 | arm64: { |
| 1496 | srcs: ["arm64/lib/mynativelib.a"], |
Paul Duffin | 57b9e1d | 2019-12-13 00:03:35 +0000 | [diff] [blame] | 1497 | export_include_dirs: ["arm64/include_gen/mynativelib"], |
Paul Duffin | 9ab556f | 2019-12-11 18:42:17 +0000 | [diff] [blame] | 1498 | }, |
| 1499 | arm: { |
| 1500 | srcs: ["arm/lib/mynativelib.a"], |
Paul Duffin | 57b9e1d | 2019-12-13 00:03:35 +0000 | [diff] [blame] | 1501 | export_include_dirs: ["arm/include_gen/mynativelib"], |
Paul Duffin | 9ab556f | 2019-12-11 18:42:17 +0000 | [diff] [blame] | 1502 | }, |
| 1503 | }, |
Paul Duffin | 9ab556f | 2019-12-11 18:42:17 +0000 | [diff] [blame] | 1504 | } |
Paul Duffin | 9ab556f | 2019-12-11 18:42:17 +0000 | [diff] [blame] | 1505 | `), |
| 1506 | checkAllCopyRules(` |
Paul Duffin | 57b9e1d | 2019-12-13 00:03:35 +0000 | [diff] [blame] | 1507 | include/Test.h -> include/include/Test.h |
Colin Cross | 7113d20 | 2019-11-20 16:39:12 -0800 | [diff] [blame] | 1508 | .intermediates/mynativelib/android_arm64_armv8-a_static/mynativelib.a -> arm64/lib/mynativelib.a |
| 1509 | .intermediates/mynativelib/android_arm64_armv8-a_static/gen/aidl/aidl/foo/bar/Test.h -> arm64/include_gen/mynativelib/aidl/foo/bar/Test.h |
| 1510 | .intermediates/mynativelib/android_arm64_armv8-a_static/gen/aidl/aidl/foo/bar/BnTest.h -> arm64/include_gen/mynativelib/aidl/foo/bar/BnTest.h |
| 1511 | .intermediates/mynativelib/android_arm64_armv8-a_static/gen/aidl/aidl/foo/bar/BpTest.h -> arm64/include_gen/mynativelib/aidl/foo/bar/BpTest.h |
| 1512 | .intermediates/mynativelib/android_arm_armv7-a-neon_static/mynativelib.a -> arm/lib/mynativelib.a |
| 1513 | .intermediates/mynativelib/android_arm_armv7-a-neon_static/gen/aidl/aidl/foo/bar/Test.h -> arm/include_gen/mynativelib/aidl/foo/bar/Test.h |
| 1514 | .intermediates/mynativelib/android_arm_armv7-a-neon_static/gen/aidl/aidl/foo/bar/BnTest.h -> arm/include_gen/mynativelib/aidl/foo/bar/BnTest.h |
| 1515 | .intermediates/mynativelib/android_arm_armv7-a-neon_static/gen/aidl/aidl/foo/bar/BpTest.h -> arm/include_gen/mynativelib/aidl/foo/bar/BpTest.h |
Paul Duffin | 9ab556f | 2019-12-11 18:42:17 +0000 | [diff] [blame] | 1516 | `), |
| 1517 | ) |
| 1518 | } |
| 1519 | |
| 1520 | func TestHostSnapshotWithCcStaticLibrary(t *testing.T) { |
Paul Duffin | 9ab556f | 2019-12-11 18:42:17 +0000 | [diff] [blame] | 1521 | result := testSdkWithCc(t, ` |
Paul Duffin | e602918 | 2019-12-16 17:43:48 +0000 | [diff] [blame] | 1522 | module_exports { |
| 1523 | name: "myexports", |
Paul Duffin | 9ab556f | 2019-12-11 18:42:17 +0000 | [diff] [blame] | 1524 | device_supported: false, |
| 1525 | host_supported: true, |
| 1526 | native_static_libs: ["mynativelib"], |
| 1527 | } |
| 1528 | |
| 1529 | cc_library_static { |
| 1530 | name: "mynativelib", |
| 1531 | device_supported: false, |
| 1532 | host_supported: true, |
| 1533 | srcs: [ |
| 1534 | "Test.cpp", |
| 1535 | "aidl/foo/bar/Test.aidl", |
| 1536 | ], |
| 1537 | export_include_dirs: ["include"], |
| 1538 | aidl: { |
| 1539 | export_aidl_headers: true, |
| 1540 | }, |
Paul Duffin | 9ab556f | 2019-12-11 18:42:17 +0000 | [diff] [blame] | 1541 | stl: "none", |
| 1542 | } |
| 1543 | `) |
| 1544 | |
Paul Duffin | 1356d8c | 2020-02-25 19:26:33 +0000 | [diff] [blame] | 1545 | result.CheckSnapshot("myexports", "", |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 1546 | checkUnversionedAndroidBpContents(` |
Paul Duffin | 9ab556f | 2019-12-11 18:42:17 +0000 | [diff] [blame] | 1547 | // This is auto-generated. DO NOT EDIT. |
| 1548 | |
| 1549 | cc_prebuilt_library_static { |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 1550 | name: "mynativelib", |
| 1551 | prefer: false, |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 1552 | visibility: ["//visibility:public"], |
Martin Stjernholm | 1e04109 | 2020-11-03 00:11:09 +0000 | [diff] [blame] | 1553 | apex_available: ["//apex_available:platform"], |
Paul Duffin | 9ab556f | 2019-12-11 18:42:17 +0000 | [diff] [blame] | 1554 | device_supported: false, |
| 1555 | host_supported: true, |
Paul Duffin | 0174d8d | 2020-03-11 18:42:08 +0000 | [diff] [blame] | 1556 | stl: "none", |
Martin Stjernholm | 89238f4 | 2020-07-10 00:14:03 +0100 | [diff] [blame] | 1557 | compile_multilib: "both", |
Paul Duffin | 57b9e1d | 2019-12-13 00:03:35 +0000 | [diff] [blame] | 1558 | export_include_dirs: ["include/include"], |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 1559 | target: { |
| 1560 | host: { |
| 1561 | enabled: false, |
| 1562 | }, |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 1563 | linux_glibc_x86_64: { |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 1564 | enabled: true, |
Paul Duffin | 9ab556f | 2019-12-11 18:42:17 +0000 | [diff] [blame] | 1565 | srcs: ["x86_64/lib/mynativelib.a"], |
Paul Duffin | 57b9e1d | 2019-12-13 00:03:35 +0000 | [diff] [blame] | 1566 | export_include_dirs: ["x86_64/include_gen/mynativelib"], |
Paul Duffin | 9ab556f | 2019-12-11 18:42:17 +0000 | [diff] [blame] | 1567 | }, |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 1568 | linux_glibc_x86: { |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 1569 | enabled: true, |
Paul Duffin | 9ab556f | 2019-12-11 18:42:17 +0000 | [diff] [blame] | 1570 | srcs: ["x86/lib/mynativelib.a"], |
Paul Duffin | 57b9e1d | 2019-12-13 00:03:35 +0000 | [diff] [blame] | 1571 | export_include_dirs: ["x86/include_gen/mynativelib"], |
Paul Duffin | 9ab556f | 2019-12-11 18:42:17 +0000 | [diff] [blame] | 1572 | }, |
| 1573 | }, |
Paul Duffin | 9ab556f | 2019-12-11 18:42:17 +0000 | [diff] [blame] | 1574 | } |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 1575 | `), |
| 1576 | checkVersionedAndroidBpContents(` |
| 1577 | // This is auto-generated. DO NOT EDIT. |
Paul Duffin | 9ab556f | 2019-12-11 18:42:17 +0000 | [diff] [blame] | 1578 | |
| 1579 | cc_prebuilt_library_static { |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 1580 | name: "myexports_mynativelib@current", |
| 1581 | sdk_member_name: "mynativelib", |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 1582 | visibility: ["//visibility:public"], |
Martin Stjernholm | 1e04109 | 2020-11-03 00:11:09 +0000 | [diff] [blame] | 1583 | apex_available: ["//apex_available:platform"], |
Paul Duffin | 9ab556f | 2019-12-11 18:42:17 +0000 | [diff] [blame] | 1584 | device_supported: false, |
| 1585 | host_supported: true, |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 1586 | installable: false, |
Paul Duffin | 0174d8d | 2020-03-11 18:42:08 +0000 | [diff] [blame] | 1587 | stl: "none", |
Martin Stjernholm | 89238f4 | 2020-07-10 00:14:03 +0100 | [diff] [blame] | 1588 | compile_multilib: "both", |
Paul Duffin | 57b9e1d | 2019-12-13 00:03:35 +0000 | [diff] [blame] | 1589 | export_include_dirs: ["include/include"], |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 1590 | target: { |
| 1591 | host: { |
| 1592 | enabled: false, |
| 1593 | }, |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 1594 | linux_glibc_x86_64: { |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 1595 | enabled: true, |
Paul Duffin | 9ab556f | 2019-12-11 18:42:17 +0000 | [diff] [blame] | 1596 | srcs: ["x86_64/lib/mynativelib.a"], |
Paul Duffin | 57b9e1d | 2019-12-13 00:03:35 +0000 | [diff] [blame] | 1597 | export_include_dirs: ["x86_64/include_gen/mynativelib"], |
Paul Duffin | 9ab556f | 2019-12-11 18:42:17 +0000 | [diff] [blame] | 1598 | }, |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 1599 | linux_glibc_x86: { |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 1600 | enabled: true, |
Paul Duffin | 9ab556f | 2019-12-11 18:42:17 +0000 | [diff] [blame] | 1601 | srcs: ["x86/lib/mynativelib.a"], |
Paul Duffin | 57b9e1d | 2019-12-13 00:03:35 +0000 | [diff] [blame] | 1602 | export_include_dirs: ["x86/include_gen/mynativelib"], |
Paul Duffin | 9ab556f | 2019-12-11 18:42:17 +0000 | [diff] [blame] | 1603 | }, |
| 1604 | }, |
Paul Duffin | 9ab556f | 2019-12-11 18:42:17 +0000 | [diff] [blame] | 1605 | } |
| 1606 | |
Paul Duffin | e602918 | 2019-12-16 17:43:48 +0000 | [diff] [blame] | 1607 | module_exports_snapshot { |
| 1608 | name: "myexports@current", |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 1609 | visibility: ["//visibility:public"], |
Paul Duffin | 9ab556f | 2019-12-11 18:42:17 +0000 | [diff] [blame] | 1610 | device_supported: false, |
| 1611 | host_supported: true, |
Paul Duffin | e602918 | 2019-12-16 17:43:48 +0000 | [diff] [blame] | 1612 | native_static_libs: ["myexports_mynativelib@current"], |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 1613 | target: { |
| 1614 | host: { |
| 1615 | enabled: false, |
| 1616 | }, |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 1617 | linux_glibc_x86_64: { |
| 1618 | enabled: true, |
| 1619 | }, |
| 1620 | linux_glibc_x86: { |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 1621 | enabled: true, |
| 1622 | }, |
| 1623 | }, |
Paul Duffin | 9ab556f | 2019-12-11 18:42:17 +0000 | [diff] [blame] | 1624 | } |
| 1625 | `), |
| 1626 | checkAllCopyRules(` |
Paul Duffin | 57b9e1d | 2019-12-13 00:03:35 +0000 | [diff] [blame] | 1627 | include/Test.h -> include/include/Test.h |
Paul Duffin | 9ab556f | 2019-12-11 18:42:17 +0000 | [diff] [blame] | 1628 | .intermediates/mynativelib/linux_glibc_x86_64_static/mynativelib.a -> x86_64/lib/mynativelib.a |
Paul Duffin | 9ab556f | 2019-12-11 18:42:17 +0000 | [diff] [blame] | 1629 | .intermediates/mynativelib/linux_glibc_x86_64_static/gen/aidl/aidl/foo/bar/Test.h -> x86_64/include_gen/mynativelib/aidl/foo/bar/Test.h |
| 1630 | .intermediates/mynativelib/linux_glibc_x86_64_static/gen/aidl/aidl/foo/bar/BnTest.h -> x86_64/include_gen/mynativelib/aidl/foo/bar/BnTest.h |
| 1631 | .intermediates/mynativelib/linux_glibc_x86_64_static/gen/aidl/aidl/foo/bar/BpTest.h -> x86_64/include_gen/mynativelib/aidl/foo/bar/BpTest.h |
| 1632 | .intermediates/mynativelib/linux_glibc_x86_static/mynativelib.a -> x86/lib/mynativelib.a |
Paul Duffin | 9ab556f | 2019-12-11 18:42:17 +0000 | [diff] [blame] | 1633 | .intermediates/mynativelib/linux_glibc_x86_static/gen/aidl/aidl/foo/bar/Test.h -> x86/include_gen/mynativelib/aidl/foo/bar/Test.h |
| 1634 | .intermediates/mynativelib/linux_glibc_x86_static/gen/aidl/aidl/foo/bar/BnTest.h -> x86/include_gen/mynativelib/aidl/foo/bar/BnTest.h |
| 1635 | .intermediates/mynativelib/linux_glibc_x86_static/gen/aidl/aidl/foo/bar/BpTest.h -> x86/include_gen/mynativelib/aidl/foo/bar/BpTest.h |
| 1636 | `), |
| 1637 | ) |
| 1638 | } |
Paul Duffin | 13ad94f | 2020-02-19 16:19:27 +0000 | [diff] [blame] | 1639 | |
Paul Duffin | 9b76c0b | 2020-03-12 10:24:35 +0000 | [diff] [blame] | 1640 | func TestSnapshotWithCcLibrary(t *testing.T) { |
| 1641 | result := testSdkWithCc(t, ` |
| 1642 | module_exports { |
| 1643 | name: "myexports", |
| 1644 | native_libs: ["mynativelib"], |
| 1645 | } |
| 1646 | |
| 1647 | cc_library { |
| 1648 | name: "mynativelib", |
| 1649 | srcs: [ |
| 1650 | "Test.cpp", |
| 1651 | ], |
| 1652 | export_include_dirs: ["include"], |
Paul Duffin | 9b76c0b | 2020-03-12 10:24:35 +0000 | [diff] [blame] | 1653 | stl: "none", |
Paul Duffin | d6abaa7 | 2020-09-07 16:39:22 +0100 | [diff] [blame] | 1654 | recovery_available: true, |
Paul Duffin | d1edbd4 | 2020-08-13 19:45:31 +0100 | [diff] [blame] | 1655 | vendor_available: true, |
Paul Duffin | 9b76c0b | 2020-03-12 10:24:35 +0000 | [diff] [blame] | 1656 | } |
| 1657 | `) |
| 1658 | |
| 1659 | result.CheckSnapshot("myexports", "", |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 1660 | checkUnversionedAndroidBpContents(` |
Paul Duffin | 9b76c0b | 2020-03-12 10:24:35 +0000 | [diff] [blame] | 1661 | // This is auto-generated. DO NOT EDIT. |
| 1662 | |
| 1663 | cc_prebuilt_library { |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 1664 | name: "mynativelib", |
| 1665 | prefer: false, |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 1666 | visibility: ["//visibility:public"], |
Martin Stjernholm | 1e04109 | 2020-11-03 00:11:09 +0000 | [diff] [blame] | 1667 | apex_available: ["//apex_available:platform"], |
Paul Duffin | d6abaa7 | 2020-09-07 16:39:22 +0100 | [diff] [blame] | 1668 | recovery_available: true, |
Paul Duffin | d1edbd4 | 2020-08-13 19:45:31 +0100 | [diff] [blame] | 1669 | vendor_available: true, |
Paul Duffin | 9b76c0b | 2020-03-12 10:24:35 +0000 | [diff] [blame] | 1670 | stl: "none", |
Martin Stjernholm | 89238f4 | 2020-07-10 00:14:03 +0100 | [diff] [blame] | 1671 | compile_multilib: "both", |
Paul Duffin | 9b76c0b | 2020-03-12 10:24:35 +0000 | [diff] [blame] | 1672 | export_include_dirs: ["include/include"], |
| 1673 | arch: { |
| 1674 | arm64: { |
| 1675 | static: { |
| 1676 | srcs: ["arm64/lib/mynativelib.a"], |
| 1677 | }, |
| 1678 | shared: { |
| 1679 | srcs: ["arm64/lib/mynativelib.so"], |
| 1680 | }, |
| 1681 | }, |
| 1682 | arm: { |
| 1683 | static: { |
| 1684 | srcs: ["arm/lib/mynativelib.a"], |
| 1685 | }, |
| 1686 | shared: { |
| 1687 | srcs: ["arm/lib/mynativelib.so"], |
| 1688 | }, |
| 1689 | }, |
| 1690 | }, |
| 1691 | } |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 1692 | `), |
| 1693 | // Make sure that the generated sdk_snapshot uses the native_libs property. |
| 1694 | checkVersionedAndroidBpContents(` |
| 1695 | // This is auto-generated. DO NOT EDIT. |
Paul Duffin | 9b76c0b | 2020-03-12 10:24:35 +0000 | [diff] [blame] | 1696 | |
| 1697 | cc_prebuilt_library { |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 1698 | name: "myexports_mynativelib@current", |
| 1699 | sdk_member_name: "mynativelib", |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 1700 | visibility: ["//visibility:public"], |
Martin Stjernholm | 1e04109 | 2020-11-03 00:11:09 +0000 | [diff] [blame] | 1701 | apex_available: ["//apex_available:platform"], |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 1702 | installable: false, |
Paul Duffin | d6abaa7 | 2020-09-07 16:39:22 +0100 | [diff] [blame] | 1703 | recovery_available: true, |
Paul Duffin | d1edbd4 | 2020-08-13 19:45:31 +0100 | [diff] [blame] | 1704 | vendor_available: true, |
Paul Duffin | 9b76c0b | 2020-03-12 10:24:35 +0000 | [diff] [blame] | 1705 | stl: "none", |
Martin Stjernholm | 89238f4 | 2020-07-10 00:14:03 +0100 | [diff] [blame] | 1706 | compile_multilib: "both", |
Paul Duffin | 9b76c0b | 2020-03-12 10:24:35 +0000 | [diff] [blame] | 1707 | export_include_dirs: ["include/include"], |
| 1708 | arch: { |
| 1709 | arm64: { |
| 1710 | static: { |
| 1711 | srcs: ["arm64/lib/mynativelib.a"], |
| 1712 | }, |
| 1713 | shared: { |
| 1714 | srcs: ["arm64/lib/mynativelib.so"], |
| 1715 | }, |
| 1716 | }, |
| 1717 | arm: { |
| 1718 | static: { |
| 1719 | srcs: ["arm/lib/mynativelib.a"], |
| 1720 | }, |
| 1721 | shared: { |
| 1722 | srcs: ["arm/lib/mynativelib.so"], |
| 1723 | }, |
| 1724 | }, |
| 1725 | }, |
| 1726 | } |
| 1727 | |
| 1728 | module_exports_snapshot { |
| 1729 | name: "myexports@current", |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 1730 | visibility: ["//visibility:public"], |
Paul Duffin | 9b76c0b | 2020-03-12 10:24:35 +0000 | [diff] [blame] | 1731 | native_libs: ["myexports_mynativelib@current"], |
| 1732 | } |
| 1733 | `), |
| 1734 | checkAllCopyRules(` |
| 1735 | include/Test.h -> include/include/Test.h |
| 1736 | .intermediates/mynativelib/android_arm64_armv8-a_static/mynativelib.a -> arm64/lib/mynativelib.a |
| 1737 | .intermediates/mynativelib/android_arm64_armv8-a_shared/mynativelib.so -> arm64/lib/mynativelib.so |
| 1738 | .intermediates/mynativelib/android_arm_armv7-a-neon_static/mynativelib.a -> arm/lib/mynativelib.a |
| 1739 | .intermediates/mynativelib/android_arm_armv7-a-neon_shared/mynativelib.so -> arm/lib/mynativelib.so`), |
| 1740 | ) |
| 1741 | } |
| 1742 | |
Paul Duffin | 13ad94f | 2020-02-19 16:19:27 +0000 | [diff] [blame] | 1743 | func TestHostSnapshotWithMultiLib64(t *testing.T) { |
Paul Duffin | 13ad94f | 2020-02-19 16:19:27 +0000 | [diff] [blame] | 1744 | result := testSdkWithCc(t, ` |
| 1745 | module_exports { |
| 1746 | name: "myexports", |
| 1747 | device_supported: false, |
| 1748 | host_supported: true, |
| 1749 | target: { |
| 1750 | host: { |
| 1751 | compile_multilib: "64", |
| 1752 | }, |
| 1753 | }, |
| 1754 | native_static_libs: ["mynativelib"], |
| 1755 | } |
| 1756 | |
| 1757 | cc_library_static { |
| 1758 | name: "mynativelib", |
| 1759 | device_supported: false, |
| 1760 | host_supported: true, |
| 1761 | srcs: [ |
| 1762 | "Test.cpp", |
| 1763 | "aidl/foo/bar/Test.aidl", |
| 1764 | ], |
| 1765 | export_include_dirs: ["include"], |
| 1766 | aidl: { |
| 1767 | export_aidl_headers: true, |
| 1768 | }, |
Paul Duffin | 13ad94f | 2020-02-19 16:19:27 +0000 | [diff] [blame] | 1769 | stl: "none", |
| 1770 | } |
| 1771 | `) |
| 1772 | |
Paul Duffin | 1356d8c | 2020-02-25 19:26:33 +0000 | [diff] [blame] | 1773 | result.CheckSnapshot("myexports", "", |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 1774 | checkUnversionedAndroidBpContents(` |
Paul Duffin | 13ad94f | 2020-02-19 16:19:27 +0000 | [diff] [blame] | 1775 | // This is auto-generated. DO NOT EDIT. |
| 1776 | |
| 1777 | cc_prebuilt_library_static { |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 1778 | name: "mynativelib", |
| 1779 | prefer: false, |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 1780 | visibility: ["//visibility:public"], |
Martin Stjernholm | 1e04109 | 2020-11-03 00:11:09 +0000 | [diff] [blame] | 1781 | apex_available: ["//apex_available:platform"], |
Paul Duffin | 13ad94f | 2020-02-19 16:19:27 +0000 | [diff] [blame] | 1782 | device_supported: false, |
| 1783 | host_supported: true, |
Paul Duffin | 0174d8d | 2020-03-11 18:42:08 +0000 | [diff] [blame] | 1784 | stl: "none", |
Martin Stjernholm | 89238f4 | 2020-07-10 00:14:03 +0100 | [diff] [blame] | 1785 | compile_multilib: "64", |
Paul Duffin | 13ad94f | 2020-02-19 16:19:27 +0000 | [diff] [blame] | 1786 | export_include_dirs: ["include/include"], |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 1787 | target: { |
| 1788 | host: { |
| 1789 | enabled: false, |
| 1790 | }, |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 1791 | linux_glibc_x86_64: { |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 1792 | enabled: true, |
Paul Duffin | 13ad94f | 2020-02-19 16:19:27 +0000 | [diff] [blame] | 1793 | srcs: ["x86_64/lib/mynativelib.a"], |
| 1794 | export_include_dirs: ["x86_64/include_gen/mynativelib"], |
| 1795 | }, |
| 1796 | }, |
Paul Duffin | 13ad94f | 2020-02-19 16:19:27 +0000 | [diff] [blame] | 1797 | } |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 1798 | `), |
| 1799 | checkVersionedAndroidBpContents(` |
| 1800 | // This is auto-generated. DO NOT EDIT. |
Paul Duffin | 13ad94f | 2020-02-19 16:19:27 +0000 | [diff] [blame] | 1801 | |
| 1802 | cc_prebuilt_library_static { |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 1803 | name: "myexports_mynativelib@current", |
| 1804 | sdk_member_name: "mynativelib", |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 1805 | visibility: ["//visibility:public"], |
Martin Stjernholm | 1e04109 | 2020-11-03 00:11:09 +0000 | [diff] [blame] | 1806 | apex_available: ["//apex_available:platform"], |
Paul Duffin | 13ad94f | 2020-02-19 16:19:27 +0000 | [diff] [blame] | 1807 | device_supported: false, |
| 1808 | host_supported: true, |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 1809 | installable: false, |
Paul Duffin | 0174d8d | 2020-03-11 18:42:08 +0000 | [diff] [blame] | 1810 | stl: "none", |
Martin Stjernholm | 89238f4 | 2020-07-10 00:14:03 +0100 | [diff] [blame] | 1811 | compile_multilib: "64", |
Paul Duffin | 13ad94f | 2020-02-19 16:19:27 +0000 | [diff] [blame] | 1812 | export_include_dirs: ["include/include"], |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 1813 | target: { |
| 1814 | host: { |
| 1815 | enabled: false, |
| 1816 | }, |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 1817 | linux_glibc_x86_64: { |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 1818 | enabled: true, |
Paul Duffin | 13ad94f | 2020-02-19 16:19:27 +0000 | [diff] [blame] | 1819 | srcs: ["x86_64/lib/mynativelib.a"], |
| 1820 | export_include_dirs: ["x86_64/include_gen/mynativelib"], |
| 1821 | }, |
| 1822 | }, |
Paul Duffin | 13ad94f | 2020-02-19 16:19:27 +0000 | [diff] [blame] | 1823 | } |
| 1824 | |
| 1825 | module_exports_snapshot { |
| 1826 | name: "myexports@current", |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 1827 | visibility: ["//visibility:public"], |
Paul Duffin | 13ad94f | 2020-02-19 16:19:27 +0000 | [diff] [blame] | 1828 | device_supported: false, |
| 1829 | host_supported: true, |
Paul Duffin | 07ef3cb | 2020-03-11 18:17:42 +0000 | [diff] [blame] | 1830 | native_static_libs: ["myexports_mynativelib@current"], |
Martin Stjernholm | 4cfa2c6 | 2020-07-10 19:55:36 +0100 | [diff] [blame] | 1831 | compile_multilib: "64", |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 1832 | target: { |
| 1833 | host: { |
| 1834 | enabled: false, |
| 1835 | }, |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 1836 | linux_glibc_x86_64: { |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 1837 | enabled: true, |
| 1838 | }, |
| 1839 | }, |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 1840 | } |
| 1841 | `), |
Paul Duffin | 13ad94f | 2020-02-19 16:19:27 +0000 | [diff] [blame] | 1842 | checkAllCopyRules(` |
| 1843 | include/Test.h -> include/include/Test.h |
| 1844 | .intermediates/mynativelib/linux_glibc_x86_64_static/mynativelib.a -> x86_64/lib/mynativelib.a |
| 1845 | .intermediates/mynativelib/linux_glibc_x86_64_static/gen/aidl/aidl/foo/bar/Test.h -> x86_64/include_gen/mynativelib/aidl/foo/bar/Test.h |
| 1846 | .intermediates/mynativelib/linux_glibc_x86_64_static/gen/aidl/aidl/foo/bar/BnTest.h -> x86_64/include_gen/mynativelib/aidl/foo/bar/BnTest.h |
| 1847 | .intermediates/mynativelib/linux_glibc_x86_64_static/gen/aidl/aidl/foo/bar/BpTest.h -> x86_64/include_gen/mynativelib/aidl/foo/bar/BpTest.h |
| 1848 | `), |
| 1849 | ) |
| 1850 | } |
Paul Duffin | 91756d2 | 2020-02-21 16:29:57 +0000 | [diff] [blame] | 1851 | |
| 1852 | func TestSnapshotWithCcHeadersLibrary(t *testing.T) { |
| 1853 | result := testSdkWithCc(t, ` |
| 1854 | sdk { |
| 1855 | name: "mysdk", |
| 1856 | native_header_libs: ["mynativeheaders"], |
| 1857 | } |
| 1858 | |
| 1859 | cc_library_headers { |
| 1860 | name: "mynativeheaders", |
| 1861 | export_include_dirs: ["include"], |
Paul Duffin | 91756d2 | 2020-02-21 16:29:57 +0000 | [diff] [blame] | 1862 | stl: "none", |
| 1863 | } |
| 1864 | `) |
| 1865 | |
Paul Duffin | 1356d8c | 2020-02-25 19:26:33 +0000 | [diff] [blame] | 1866 | result.CheckSnapshot("mysdk", "", |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 1867 | checkUnversionedAndroidBpContents(` |
Paul Duffin | 91756d2 | 2020-02-21 16:29:57 +0000 | [diff] [blame] | 1868 | // This is auto-generated. DO NOT EDIT. |
| 1869 | |
| 1870 | cc_prebuilt_library_headers { |
Paul Duffin | 91756d2 | 2020-02-21 16:29:57 +0000 | [diff] [blame] | 1871 | name: "mynativeheaders", |
| 1872 | prefer: false, |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 1873 | visibility: ["//visibility:public"], |
Martin Stjernholm | 1e04109 | 2020-11-03 00:11:09 +0000 | [diff] [blame] | 1874 | apex_available: ["//apex_available:platform"], |
Paul Duffin | 91756d2 | 2020-02-21 16:29:57 +0000 | [diff] [blame] | 1875 | stl: "none", |
Martin Stjernholm | 89238f4 | 2020-07-10 00:14:03 +0100 | [diff] [blame] | 1876 | compile_multilib: "both", |
Paul Duffin | 0174d8d | 2020-03-11 18:42:08 +0000 | [diff] [blame] | 1877 | export_include_dirs: ["include/include"], |
Paul Duffin | 91756d2 | 2020-02-21 16:29:57 +0000 | [diff] [blame] | 1878 | } |
Paul Duffin | 91756d2 | 2020-02-21 16:29:57 +0000 | [diff] [blame] | 1879 | `), |
| 1880 | checkAllCopyRules(` |
| 1881 | include/Test.h -> include/include/Test.h |
| 1882 | `), |
| 1883 | ) |
| 1884 | } |
| 1885 | |
| 1886 | func TestHostSnapshotWithCcHeadersLibrary(t *testing.T) { |
Paul Duffin | 91756d2 | 2020-02-21 16:29:57 +0000 | [diff] [blame] | 1887 | result := testSdkWithCc(t, ` |
| 1888 | sdk { |
| 1889 | name: "mysdk", |
| 1890 | device_supported: false, |
| 1891 | host_supported: true, |
| 1892 | native_header_libs: ["mynativeheaders"], |
| 1893 | } |
| 1894 | |
| 1895 | cc_library_headers { |
| 1896 | name: "mynativeheaders", |
| 1897 | device_supported: false, |
| 1898 | host_supported: true, |
| 1899 | export_include_dirs: ["include"], |
Paul Duffin | 91756d2 | 2020-02-21 16:29:57 +0000 | [diff] [blame] | 1900 | stl: "none", |
| 1901 | } |
| 1902 | `) |
| 1903 | |
Paul Duffin | 1356d8c | 2020-02-25 19:26:33 +0000 | [diff] [blame] | 1904 | result.CheckSnapshot("mysdk", "", |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 1905 | checkUnversionedAndroidBpContents(` |
Paul Duffin | 91756d2 | 2020-02-21 16:29:57 +0000 | [diff] [blame] | 1906 | // This is auto-generated. DO NOT EDIT. |
| 1907 | |
| 1908 | cc_prebuilt_library_headers { |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 1909 | name: "mynativeheaders", |
| 1910 | prefer: false, |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 1911 | visibility: ["//visibility:public"], |
Martin Stjernholm | 1e04109 | 2020-11-03 00:11:09 +0000 | [diff] [blame] | 1912 | apex_available: ["//apex_available:platform"], |
Paul Duffin | 91756d2 | 2020-02-21 16:29:57 +0000 | [diff] [blame] | 1913 | device_supported: false, |
| 1914 | host_supported: true, |
Paul Duffin | 91756d2 | 2020-02-21 16:29:57 +0000 | [diff] [blame] | 1915 | stl: "none", |
Martin Stjernholm | 89238f4 | 2020-07-10 00:14:03 +0100 | [diff] [blame] | 1916 | compile_multilib: "both", |
Paul Duffin | 0174d8d | 2020-03-11 18:42:08 +0000 | [diff] [blame] | 1917 | export_include_dirs: ["include/include"], |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 1918 | target: { |
| 1919 | host: { |
| 1920 | enabled: false, |
| 1921 | }, |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 1922 | linux_glibc_x86_64: { |
| 1923 | enabled: true, |
| 1924 | }, |
| 1925 | linux_glibc_x86: { |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 1926 | enabled: true, |
| 1927 | }, |
| 1928 | }, |
Paul Duffin | 91756d2 | 2020-02-21 16:29:57 +0000 | [diff] [blame] | 1929 | } |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 1930 | `), |
| 1931 | checkVersionedAndroidBpContents(` |
| 1932 | // This is auto-generated. DO NOT EDIT. |
Paul Duffin | 91756d2 | 2020-02-21 16:29:57 +0000 | [diff] [blame] | 1933 | |
| 1934 | cc_prebuilt_library_headers { |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 1935 | name: "mysdk_mynativeheaders@current", |
| 1936 | sdk_member_name: "mynativeheaders", |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 1937 | visibility: ["//visibility:public"], |
Martin Stjernholm | 1e04109 | 2020-11-03 00:11:09 +0000 | [diff] [blame] | 1938 | apex_available: ["//apex_available:platform"], |
Paul Duffin | 91756d2 | 2020-02-21 16:29:57 +0000 | [diff] [blame] | 1939 | device_supported: false, |
| 1940 | host_supported: true, |
Paul Duffin | 91756d2 | 2020-02-21 16:29:57 +0000 | [diff] [blame] | 1941 | stl: "none", |
Martin Stjernholm | 89238f4 | 2020-07-10 00:14:03 +0100 | [diff] [blame] | 1942 | compile_multilib: "both", |
Paul Duffin | 0174d8d | 2020-03-11 18:42:08 +0000 | [diff] [blame] | 1943 | export_include_dirs: ["include/include"], |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 1944 | target: { |
| 1945 | host: { |
| 1946 | enabled: false, |
| 1947 | }, |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 1948 | linux_glibc_x86_64: { |
| 1949 | enabled: true, |
| 1950 | }, |
| 1951 | linux_glibc_x86: { |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 1952 | enabled: true, |
| 1953 | }, |
| 1954 | }, |
Paul Duffin | 91756d2 | 2020-02-21 16:29:57 +0000 | [diff] [blame] | 1955 | } |
| 1956 | |
| 1957 | sdk_snapshot { |
| 1958 | name: "mysdk@current", |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 1959 | visibility: ["//visibility:public"], |
Paul Duffin | 91756d2 | 2020-02-21 16:29:57 +0000 | [diff] [blame] | 1960 | device_supported: false, |
| 1961 | host_supported: true, |
| 1962 | native_header_libs: ["mysdk_mynativeheaders@current"], |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 1963 | target: { |
| 1964 | host: { |
| 1965 | enabled: false, |
| 1966 | }, |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 1967 | linux_glibc_x86_64: { |
| 1968 | enabled: true, |
| 1969 | }, |
| 1970 | linux_glibc_x86: { |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 1971 | enabled: true, |
| 1972 | }, |
| 1973 | }, |
Paul Duffin | 91756d2 | 2020-02-21 16:29:57 +0000 | [diff] [blame] | 1974 | } |
| 1975 | `), |
| 1976 | checkAllCopyRules(` |
| 1977 | include/Test.h -> include/include/Test.h |
| 1978 | `), |
| 1979 | ) |
| 1980 | } |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 1981 | |
| 1982 | func TestDeviceAndHostSnapshotWithCcHeadersLibrary(t *testing.T) { |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 1983 | result := testSdkWithCc(t, ` |
| 1984 | sdk { |
| 1985 | name: "mysdk", |
| 1986 | host_supported: true, |
| 1987 | native_header_libs: ["mynativeheaders"], |
| 1988 | } |
| 1989 | |
| 1990 | cc_library_headers { |
| 1991 | name: "mynativeheaders", |
| 1992 | host_supported: true, |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 1993 | stl: "none", |
| 1994 | export_system_include_dirs: ["include"], |
| 1995 | target: { |
| 1996 | android: { |
| 1997 | export_include_dirs: ["include-android"], |
| 1998 | }, |
| 1999 | host: { |
| 2000 | export_include_dirs: ["include-host"], |
| 2001 | }, |
| 2002 | }, |
| 2003 | } |
| 2004 | `) |
| 2005 | |
| 2006 | result.CheckSnapshot("mysdk", "", |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 2007 | checkUnversionedAndroidBpContents(` |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 2008 | // This is auto-generated. DO NOT EDIT. |
| 2009 | |
| 2010 | cc_prebuilt_library_headers { |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 2011 | name: "mynativeheaders", |
| 2012 | prefer: false, |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 2013 | visibility: ["//visibility:public"], |
Martin Stjernholm | 1e04109 | 2020-11-03 00:11:09 +0000 | [diff] [blame] | 2014 | apex_available: ["//apex_available:platform"], |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 2015 | host_supported: true, |
Paul Duffin | 0174d8d | 2020-03-11 18:42:08 +0000 | [diff] [blame] | 2016 | stl: "none", |
Martin Stjernholm | 89238f4 | 2020-07-10 00:14:03 +0100 | [diff] [blame] | 2017 | compile_multilib: "both", |
Paul Duffin | ed62b9c | 2020-06-16 16:12:50 +0100 | [diff] [blame] | 2018 | export_system_include_dirs: ["common_os/include/include"], |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 2019 | target: { |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 2020 | host: { |
| 2021 | enabled: false, |
| 2022 | }, |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 2023 | android: { |
Paul Duffin | ed62b9c | 2020-06-16 16:12:50 +0100 | [diff] [blame] | 2024 | export_include_dirs: ["android/include/include-android"], |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 2025 | }, |
| 2026 | linux_glibc: { |
Paul Duffin | ed62b9c | 2020-06-16 16:12:50 +0100 | [diff] [blame] | 2027 | export_include_dirs: ["linux_glibc/include/include-host"], |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 2028 | }, |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 2029 | linux_glibc_x86_64: { |
| 2030 | enabled: true, |
| 2031 | }, |
| 2032 | linux_glibc_x86: { |
| 2033 | enabled: true, |
| 2034 | }, |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 2035 | }, |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 2036 | } |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 2037 | `), |
| 2038 | // Verifi |
| 2039 | checkVersionedAndroidBpContents(` |
| 2040 | // This is auto-generated. DO NOT EDIT. |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 2041 | |
| 2042 | cc_prebuilt_library_headers { |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 2043 | name: "mysdk_mynativeheaders@current", |
| 2044 | sdk_member_name: "mynativeheaders", |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 2045 | visibility: ["//visibility:public"], |
Martin Stjernholm | 1e04109 | 2020-11-03 00:11:09 +0000 | [diff] [blame] | 2046 | apex_available: ["//apex_available:platform"], |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 2047 | host_supported: true, |
Paul Duffin | 0174d8d | 2020-03-11 18:42:08 +0000 | [diff] [blame] | 2048 | stl: "none", |
Martin Stjernholm | 89238f4 | 2020-07-10 00:14:03 +0100 | [diff] [blame] | 2049 | compile_multilib: "both", |
Paul Duffin | ed62b9c | 2020-06-16 16:12:50 +0100 | [diff] [blame] | 2050 | export_system_include_dirs: ["common_os/include/include"], |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 2051 | target: { |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 2052 | host: { |
| 2053 | enabled: false, |
| 2054 | }, |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 2055 | android: { |
Paul Duffin | ed62b9c | 2020-06-16 16:12:50 +0100 | [diff] [blame] | 2056 | export_include_dirs: ["android/include/include-android"], |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 2057 | }, |
| 2058 | linux_glibc: { |
Paul Duffin | ed62b9c | 2020-06-16 16:12:50 +0100 | [diff] [blame] | 2059 | export_include_dirs: ["linux_glibc/include/include-host"], |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 2060 | }, |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 2061 | linux_glibc_x86_64: { |
| 2062 | enabled: true, |
| 2063 | }, |
| 2064 | linux_glibc_x86: { |
| 2065 | enabled: true, |
| 2066 | }, |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 2067 | }, |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 2068 | } |
| 2069 | |
| 2070 | sdk_snapshot { |
| 2071 | name: "mysdk@current", |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 2072 | visibility: ["//visibility:public"], |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 2073 | host_supported: true, |
| 2074 | native_header_libs: ["mysdk_mynativeheaders@current"], |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 2075 | target: { |
| 2076 | host: { |
| 2077 | enabled: false, |
| 2078 | }, |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 2079 | linux_glibc_x86_64: { |
| 2080 | enabled: true, |
| 2081 | }, |
| 2082 | linux_glibc_x86: { |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 2083 | enabled: true, |
| 2084 | }, |
| 2085 | }, |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 2086 | } |
| 2087 | `), |
| 2088 | checkAllCopyRules(` |
Paul Duffin | ed62b9c | 2020-06-16 16:12:50 +0100 | [diff] [blame] | 2089 | include/Test.h -> common_os/include/include/Test.h |
| 2090 | include-android/AndroidTest.h -> android/include/include-android/AndroidTest.h |
| 2091 | include-host/HostTest.h -> linux_glibc/include/include-host/HostTest.h |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 2092 | `), |
| 2093 | ) |
| 2094 | } |
Martin Stjernholm | 10566a0 | 2020-03-24 01:19:52 +0000 | [diff] [blame] | 2095 | |
| 2096 | func TestSystemSharedLibPropagation(t *testing.T) { |
| 2097 | result := testSdkWithCc(t, ` |
| 2098 | sdk { |
| 2099 | name: "mysdk", |
| 2100 | native_shared_libs: ["sslnil", "sslempty", "sslnonempty"], |
| 2101 | } |
| 2102 | |
| 2103 | cc_library { |
| 2104 | name: "sslnil", |
| 2105 | host_supported: true, |
| 2106 | } |
| 2107 | |
| 2108 | cc_library { |
| 2109 | name: "sslempty", |
| 2110 | system_shared_libs: [], |
| 2111 | } |
| 2112 | |
| 2113 | cc_library { |
| 2114 | name: "sslnonempty", |
| 2115 | system_shared_libs: ["sslnil"], |
| 2116 | } |
| 2117 | `) |
| 2118 | |
| 2119 | result.CheckSnapshot("mysdk", "", |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 2120 | checkUnversionedAndroidBpContents(` |
Martin Stjernholm | 10566a0 | 2020-03-24 01:19:52 +0000 | [diff] [blame] | 2121 | // This is auto-generated. DO NOT EDIT. |
| 2122 | |
| 2123 | cc_prebuilt_library_shared { |
Martin Stjernholm | 10566a0 | 2020-03-24 01:19:52 +0000 | [diff] [blame] | 2124 | name: "sslnil", |
| 2125 | prefer: false, |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 2126 | visibility: ["//visibility:public"], |
Martin Stjernholm | 1e04109 | 2020-11-03 00:11:09 +0000 | [diff] [blame] | 2127 | apex_available: ["//apex_available:platform"], |
Martin Stjernholm | 89238f4 | 2020-07-10 00:14:03 +0100 | [diff] [blame] | 2128 | compile_multilib: "both", |
Martin Stjernholm | 10566a0 | 2020-03-24 01:19:52 +0000 | [diff] [blame] | 2129 | arch: { |
| 2130 | arm64: { |
| 2131 | srcs: ["arm64/lib/sslnil.so"], |
| 2132 | }, |
| 2133 | arm: { |
| 2134 | srcs: ["arm/lib/sslnil.so"], |
| 2135 | }, |
| 2136 | }, |
| 2137 | } |
| 2138 | |
| 2139 | cc_prebuilt_library_shared { |
Martin Stjernholm | 10566a0 | 2020-03-24 01:19:52 +0000 | [diff] [blame] | 2140 | name: "sslempty", |
| 2141 | prefer: false, |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 2142 | visibility: ["//visibility:public"], |
Martin Stjernholm | 1e04109 | 2020-11-03 00:11:09 +0000 | [diff] [blame] | 2143 | apex_available: ["//apex_available:platform"], |
Martin Stjernholm | 89238f4 | 2020-07-10 00:14:03 +0100 | [diff] [blame] | 2144 | compile_multilib: "both", |
Martin Stjernholm | 10566a0 | 2020-03-24 01:19:52 +0000 | [diff] [blame] | 2145 | system_shared_libs: [], |
| 2146 | arch: { |
| 2147 | arm64: { |
| 2148 | srcs: ["arm64/lib/sslempty.so"], |
| 2149 | }, |
| 2150 | arm: { |
| 2151 | srcs: ["arm/lib/sslempty.so"], |
| 2152 | }, |
| 2153 | }, |
| 2154 | } |
| 2155 | |
| 2156 | cc_prebuilt_library_shared { |
Martin Stjernholm | 10566a0 | 2020-03-24 01:19:52 +0000 | [diff] [blame] | 2157 | name: "sslnonempty", |
| 2158 | prefer: false, |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 2159 | visibility: ["//visibility:public"], |
Martin Stjernholm | 1e04109 | 2020-11-03 00:11:09 +0000 | [diff] [blame] | 2160 | apex_available: ["//apex_available:platform"], |
Martin Stjernholm | 89238f4 | 2020-07-10 00:14:03 +0100 | [diff] [blame] | 2161 | compile_multilib: "both", |
Martin Stjernholm | 10566a0 | 2020-03-24 01:19:52 +0000 | [diff] [blame] | 2162 | system_shared_libs: ["sslnil"], |
| 2163 | arch: { |
| 2164 | arm64: { |
| 2165 | srcs: ["arm64/lib/sslnonempty.so"], |
| 2166 | }, |
| 2167 | arm: { |
| 2168 | srcs: ["arm/lib/sslnonempty.so"], |
| 2169 | }, |
| 2170 | }, |
| 2171 | } |
Martin Stjernholm | 10566a0 | 2020-03-24 01:19:52 +0000 | [diff] [blame] | 2172 | `)) |
| 2173 | |
| 2174 | result = testSdkWithCc(t, ` |
| 2175 | sdk { |
| 2176 | name: "mysdk", |
| 2177 | host_supported: true, |
| 2178 | native_shared_libs: ["sslvariants"], |
| 2179 | } |
| 2180 | |
| 2181 | cc_library { |
| 2182 | name: "sslvariants", |
| 2183 | host_supported: true, |
| 2184 | target: { |
| 2185 | android: { |
| 2186 | system_shared_libs: [], |
| 2187 | }, |
| 2188 | }, |
| 2189 | } |
| 2190 | `) |
| 2191 | |
| 2192 | result.CheckSnapshot("mysdk", "", |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 2193 | checkUnversionedAndroidBpContents(` |
Martin Stjernholm | 10566a0 | 2020-03-24 01:19:52 +0000 | [diff] [blame] | 2194 | // This is auto-generated. DO NOT EDIT. |
| 2195 | |
| 2196 | cc_prebuilt_library_shared { |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 2197 | name: "sslvariants", |
| 2198 | prefer: false, |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 2199 | visibility: ["//visibility:public"], |
Martin Stjernholm | 1e04109 | 2020-11-03 00:11:09 +0000 | [diff] [blame] | 2200 | apex_available: ["//apex_available:platform"], |
Martin Stjernholm | 10566a0 | 2020-03-24 01:19:52 +0000 | [diff] [blame] | 2201 | host_supported: true, |
Martin Stjernholm | 89238f4 | 2020-07-10 00:14:03 +0100 | [diff] [blame] | 2202 | compile_multilib: "both", |
Martin Stjernholm | 10566a0 | 2020-03-24 01:19:52 +0000 | [diff] [blame] | 2203 | target: { |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 2204 | host: { |
| 2205 | enabled: false, |
| 2206 | }, |
Martin Stjernholm | 10566a0 | 2020-03-24 01:19:52 +0000 | [diff] [blame] | 2207 | android: { |
| 2208 | system_shared_libs: [], |
| 2209 | }, |
| 2210 | android_arm64: { |
| 2211 | srcs: ["android/arm64/lib/sslvariants.so"], |
| 2212 | }, |
| 2213 | android_arm: { |
| 2214 | srcs: ["android/arm/lib/sslvariants.so"], |
| 2215 | }, |
| 2216 | linux_glibc_x86_64: { |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 2217 | enabled: true, |
Martin Stjernholm | 10566a0 | 2020-03-24 01:19:52 +0000 | [diff] [blame] | 2218 | srcs: ["linux_glibc/x86_64/lib/sslvariants.so"], |
| 2219 | }, |
| 2220 | linux_glibc_x86: { |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 2221 | enabled: true, |
Martin Stjernholm | 10566a0 | 2020-03-24 01:19:52 +0000 | [diff] [blame] | 2222 | srcs: ["linux_glibc/x86/lib/sslvariants.so"], |
| 2223 | }, |
| 2224 | }, |
| 2225 | } |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 2226 | `), |
| 2227 | checkVersionedAndroidBpContents(` |
| 2228 | // This is auto-generated. DO NOT EDIT. |
Martin Stjernholm | 10566a0 | 2020-03-24 01:19:52 +0000 | [diff] [blame] | 2229 | |
| 2230 | cc_prebuilt_library_shared { |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 2231 | name: "mysdk_sslvariants@current", |
| 2232 | sdk_member_name: "sslvariants", |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 2233 | visibility: ["//visibility:public"], |
Martin Stjernholm | 1e04109 | 2020-11-03 00:11:09 +0000 | [diff] [blame] | 2234 | apex_available: ["//apex_available:platform"], |
Martin Stjernholm | 10566a0 | 2020-03-24 01:19:52 +0000 | [diff] [blame] | 2235 | host_supported: true, |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 2236 | installable: false, |
Martin Stjernholm | 89238f4 | 2020-07-10 00:14:03 +0100 | [diff] [blame] | 2237 | compile_multilib: "both", |
Martin Stjernholm | 10566a0 | 2020-03-24 01:19:52 +0000 | [diff] [blame] | 2238 | target: { |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 2239 | host: { |
| 2240 | enabled: false, |
| 2241 | }, |
Martin Stjernholm | 10566a0 | 2020-03-24 01:19:52 +0000 | [diff] [blame] | 2242 | android: { |
| 2243 | system_shared_libs: [], |
| 2244 | }, |
| 2245 | android_arm64: { |
| 2246 | srcs: ["android/arm64/lib/sslvariants.so"], |
| 2247 | }, |
| 2248 | android_arm: { |
| 2249 | srcs: ["android/arm/lib/sslvariants.so"], |
| 2250 | }, |
| 2251 | linux_glibc_x86_64: { |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 2252 | enabled: true, |
Martin Stjernholm | 10566a0 | 2020-03-24 01:19:52 +0000 | [diff] [blame] | 2253 | srcs: ["linux_glibc/x86_64/lib/sslvariants.so"], |
| 2254 | }, |
| 2255 | linux_glibc_x86: { |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 2256 | enabled: true, |
Martin Stjernholm | 10566a0 | 2020-03-24 01:19:52 +0000 | [diff] [blame] | 2257 | srcs: ["linux_glibc/x86/lib/sslvariants.so"], |
| 2258 | }, |
| 2259 | }, |
| 2260 | } |
| 2261 | |
| 2262 | sdk_snapshot { |
| 2263 | name: "mysdk@current", |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 2264 | visibility: ["//visibility:public"], |
Martin Stjernholm | 10566a0 | 2020-03-24 01:19:52 +0000 | [diff] [blame] | 2265 | host_supported: true, |
| 2266 | native_shared_libs: ["mysdk_sslvariants@current"], |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 2267 | target: { |
| 2268 | host: { |
| 2269 | enabled: false, |
| 2270 | }, |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 2271 | linux_glibc_x86_64: { |
| 2272 | enabled: true, |
| 2273 | }, |
| 2274 | linux_glibc_x86: { |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 2275 | enabled: true, |
| 2276 | }, |
| 2277 | }, |
Martin Stjernholm | 10566a0 | 2020-03-24 01:19:52 +0000 | [diff] [blame] | 2278 | } |
| 2279 | `)) |
| 2280 | } |
Martin Stjernholm | c5dd4f7 | 2020-04-01 20:38:01 +0100 | [diff] [blame] | 2281 | |
| 2282 | func TestStubsLibrary(t *testing.T) { |
| 2283 | result := testSdkWithCc(t, ` |
| 2284 | sdk { |
| 2285 | name: "mysdk", |
| 2286 | native_shared_libs: ["stubslib"], |
| 2287 | } |
| 2288 | |
| 2289 | cc_library { |
Martin Stjernholm | cc330d6 | 2020-04-21 20:45:35 +0100 | [diff] [blame] | 2290 | name: "internaldep", |
| 2291 | } |
| 2292 | |
| 2293 | cc_library { |
Martin Stjernholm | c5dd4f7 | 2020-04-01 20:38:01 +0100 | [diff] [blame] | 2294 | name: "stubslib", |
Martin Stjernholm | cc330d6 | 2020-04-21 20:45:35 +0100 | [diff] [blame] | 2295 | shared_libs: ["internaldep"], |
Martin Stjernholm | c5dd4f7 | 2020-04-01 20:38:01 +0100 | [diff] [blame] | 2296 | stubs: { |
| 2297 | symbol_file: "some/where/stubslib.map.txt", |
| 2298 | versions: ["1", "2", "3"], |
| 2299 | }, |
| 2300 | } |
| 2301 | `) |
| 2302 | |
| 2303 | result.CheckSnapshot("mysdk", "", |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 2304 | checkUnversionedAndroidBpContents(` |
Martin Stjernholm | c5dd4f7 | 2020-04-01 20:38:01 +0100 | [diff] [blame] | 2305 | // This is auto-generated. DO NOT EDIT. |
| 2306 | |
| 2307 | cc_prebuilt_library_shared { |
Martin Stjernholm | c5dd4f7 | 2020-04-01 20:38:01 +0100 | [diff] [blame] | 2308 | name: "stubslib", |
| 2309 | prefer: false, |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 2310 | visibility: ["//visibility:public"], |
Martin Stjernholm | 1e04109 | 2020-11-03 00:11:09 +0000 | [diff] [blame] | 2311 | apex_available: ["//apex_available:platform"], |
Martin Stjernholm | 89238f4 | 2020-07-10 00:14:03 +0100 | [diff] [blame] | 2312 | compile_multilib: "both", |
Martin Stjernholm | c5dd4f7 | 2020-04-01 20:38:01 +0100 | [diff] [blame] | 2313 | stubs: { |
Martin Stjernholm | 618b671 | 2020-09-24 16:53:04 +0100 | [diff] [blame] | 2314 | versions: [ |
| 2315 | "1", |
| 2316 | "2", |
| 2317 | "3", |
| 2318 | ], |
Martin Stjernholm | c5dd4f7 | 2020-04-01 20:38:01 +0100 | [diff] [blame] | 2319 | }, |
| 2320 | arch: { |
| 2321 | arm64: { |
| 2322 | srcs: ["arm64/lib/stubslib.so"], |
| 2323 | }, |
| 2324 | arm: { |
| 2325 | srcs: ["arm/lib/stubslib.so"], |
| 2326 | }, |
| 2327 | }, |
| 2328 | } |
Martin Stjernholm | c5dd4f7 | 2020-04-01 20:38:01 +0100 | [diff] [blame] | 2329 | `)) |
| 2330 | } |
Paul Duffin | 7a1f7f3 | 2020-05-04 15:32:08 +0100 | [diff] [blame] | 2331 | |
| 2332 | func TestDeviceAndHostSnapshotWithStubsLibrary(t *testing.T) { |
Paul Duffin | 7a1f7f3 | 2020-05-04 15:32:08 +0100 | [diff] [blame] | 2333 | result := testSdkWithCc(t, ` |
| 2334 | sdk { |
| 2335 | name: "mysdk", |
| 2336 | host_supported: true, |
| 2337 | native_shared_libs: ["stubslib"], |
| 2338 | } |
| 2339 | |
| 2340 | cc_library { |
| 2341 | name: "internaldep", |
| 2342 | host_supported: true, |
| 2343 | } |
| 2344 | |
| 2345 | cc_library { |
| 2346 | name: "stubslib", |
| 2347 | host_supported: true, |
| 2348 | shared_libs: ["internaldep"], |
| 2349 | stubs: { |
| 2350 | symbol_file: "some/where/stubslib.map.txt", |
| 2351 | versions: ["1", "2", "3"], |
| 2352 | }, |
| 2353 | } |
| 2354 | `) |
| 2355 | |
| 2356 | result.CheckSnapshot("mysdk", "", |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 2357 | checkUnversionedAndroidBpContents(` |
Paul Duffin | 7a1f7f3 | 2020-05-04 15:32:08 +0100 | [diff] [blame] | 2358 | // This is auto-generated. DO NOT EDIT. |
| 2359 | |
| 2360 | cc_prebuilt_library_shared { |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 2361 | name: "stubslib", |
| 2362 | prefer: false, |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 2363 | visibility: ["//visibility:public"], |
Martin Stjernholm | 1e04109 | 2020-11-03 00:11:09 +0000 | [diff] [blame] | 2364 | apex_available: ["//apex_available:platform"], |
Paul Duffin | 7a1f7f3 | 2020-05-04 15:32:08 +0100 | [diff] [blame] | 2365 | host_supported: true, |
Martin Stjernholm | 89238f4 | 2020-07-10 00:14:03 +0100 | [diff] [blame] | 2366 | compile_multilib: "both", |
Paul Duffin | 7a1f7f3 | 2020-05-04 15:32:08 +0100 | [diff] [blame] | 2367 | stubs: { |
Martin Stjernholm | 618b671 | 2020-09-24 16:53:04 +0100 | [diff] [blame] | 2368 | versions: [ |
| 2369 | "1", |
| 2370 | "2", |
| 2371 | "3", |
| 2372 | ], |
Paul Duffin | 7a1f7f3 | 2020-05-04 15:32:08 +0100 | [diff] [blame] | 2373 | }, |
| 2374 | target: { |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 2375 | host: { |
| 2376 | enabled: false, |
| 2377 | }, |
Paul Duffin | 7a1f7f3 | 2020-05-04 15:32:08 +0100 | [diff] [blame] | 2378 | android_arm64: { |
| 2379 | srcs: ["android/arm64/lib/stubslib.so"], |
| 2380 | }, |
| 2381 | android_arm: { |
| 2382 | srcs: ["android/arm/lib/stubslib.so"], |
| 2383 | }, |
| 2384 | linux_glibc_x86_64: { |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 2385 | enabled: true, |
Paul Duffin | 7a1f7f3 | 2020-05-04 15:32:08 +0100 | [diff] [blame] | 2386 | srcs: ["linux_glibc/x86_64/lib/stubslib.so"], |
| 2387 | }, |
| 2388 | linux_glibc_x86: { |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 2389 | enabled: true, |
Paul Duffin | 7a1f7f3 | 2020-05-04 15:32:08 +0100 | [diff] [blame] | 2390 | srcs: ["linux_glibc/x86/lib/stubslib.so"], |
| 2391 | }, |
| 2392 | }, |
| 2393 | } |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 2394 | `), |
| 2395 | checkVersionedAndroidBpContents(` |
| 2396 | // This is auto-generated. DO NOT EDIT. |
Paul Duffin | 7a1f7f3 | 2020-05-04 15:32:08 +0100 | [diff] [blame] | 2397 | |
| 2398 | cc_prebuilt_library_shared { |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 2399 | name: "mysdk_stubslib@current", |
| 2400 | sdk_member_name: "stubslib", |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 2401 | visibility: ["//visibility:public"], |
Martin Stjernholm | 1e04109 | 2020-11-03 00:11:09 +0000 | [diff] [blame] | 2402 | apex_available: ["//apex_available:platform"], |
Paul Duffin | 7a1f7f3 | 2020-05-04 15:32:08 +0100 | [diff] [blame] | 2403 | host_supported: true, |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 2404 | installable: false, |
Martin Stjernholm | 89238f4 | 2020-07-10 00:14:03 +0100 | [diff] [blame] | 2405 | compile_multilib: "both", |
Paul Duffin | 7a1f7f3 | 2020-05-04 15:32:08 +0100 | [diff] [blame] | 2406 | stubs: { |
Martin Stjernholm | 618b671 | 2020-09-24 16:53:04 +0100 | [diff] [blame] | 2407 | versions: [ |
| 2408 | "1", |
| 2409 | "2", |
| 2410 | "3", |
| 2411 | ], |
Paul Duffin | 7a1f7f3 | 2020-05-04 15:32:08 +0100 | [diff] [blame] | 2412 | }, |
| 2413 | target: { |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 2414 | host: { |
| 2415 | enabled: false, |
| 2416 | }, |
Paul Duffin | 7a1f7f3 | 2020-05-04 15:32:08 +0100 | [diff] [blame] | 2417 | android_arm64: { |
| 2418 | srcs: ["android/arm64/lib/stubslib.so"], |
| 2419 | }, |
| 2420 | android_arm: { |
| 2421 | srcs: ["android/arm/lib/stubslib.so"], |
| 2422 | }, |
| 2423 | linux_glibc_x86_64: { |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 2424 | enabled: true, |
Paul Duffin | 7a1f7f3 | 2020-05-04 15:32:08 +0100 | [diff] [blame] | 2425 | srcs: ["linux_glibc/x86_64/lib/stubslib.so"], |
| 2426 | }, |
| 2427 | linux_glibc_x86: { |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 2428 | enabled: true, |
Paul Duffin | 7a1f7f3 | 2020-05-04 15:32:08 +0100 | [diff] [blame] | 2429 | srcs: ["linux_glibc/x86/lib/stubslib.so"], |
| 2430 | }, |
| 2431 | }, |
| 2432 | } |
| 2433 | |
| 2434 | sdk_snapshot { |
| 2435 | name: "mysdk@current", |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 2436 | visibility: ["//visibility:public"], |
Paul Duffin | 7a1f7f3 | 2020-05-04 15:32:08 +0100 | [diff] [blame] | 2437 | host_supported: true, |
| 2438 | native_shared_libs: ["mysdk_stubslib@current"], |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 2439 | target: { |
| 2440 | host: { |
| 2441 | enabled: false, |
| 2442 | }, |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 2443 | linux_glibc_x86_64: { |
| 2444 | enabled: true, |
| 2445 | }, |
| 2446 | linux_glibc_x86: { |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 2447 | enabled: true, |
| 2448 | }, |
| 2449 | }, |
Paul Duffin | 7a1f7f3 | 2020-05-04 15:32:08 +0100 | [diff] [blame] | 2450 | } |
| 2451 | `)) |
| 2452 | } |
Martin Stjernholm | 47ed352 | 2020-06-17 22:52:25 +0100 | [diff] [blame] | 2453 | |
| 2454 | func TestUniqueHostSoname(t *testing.T) { |
Martin Stjernholm | 47ed352 | 2020-06-17 22:52:25 +0100 | [diff] [blame] | 2455 | result := testSdkWithCc(t, ` |
| 2456 | sdk { |
| 2457 | name: "mysdk", |
| 2458 | host_supported: true, |
| 2459 | native_shared_libs: ["mylib"], |
| 2460 | } |
| 2461 | |
| 2462 | cc_library { |
| 2463 | name: "mylib", |
| 2464 | host_supported: true, |
| 2465 | unique_host_soname: true, |
| 2466 | } |
| 2467 | `) |
| 2468 | |
| 2469 | result.CheckSnapshot("mysdk", "", |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 2470 | checkUnversionedAndroidBpContents(` |
Martin Stjernholm | 47ed352 | 2020-06-17 22:52:25 +0100 | [diff] [blame] | 2471 | // This is auto-generated. DO NOT EDIT. |
| 2472 | |
| 2473 | cc_prebuilt_library_shared { |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 2474 | name: "mylib", |
| 2475 | prefer: false, |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 2476 | visibility: ["//visibility:public"], |
Martin Stjernholm | 1e04109 | 2020-11-03 00:11:09 +0000 | [diff] [blame] | 2477 | apex_available: ["//apex_available:platform"], |
Martin Stjernholm | 47ed352 | 2020-06-17 22:52:25 +0100 | [diff] [blame] | 2478 | host_supported: true, |
Martin Stjernholm | 47ed352 | 2020-06-17 22:52:25 +0100 | [diff] [blame] | 2479 | unique_host_soname: true, |
Martin Stjernholm | 89238f4 | 2020-07-10 00:14:03 +0100 | [diff] [blame] | 2480 | compile_multilib: "both", |
Martin Stjernholm | 47ed352 | 2020-06-17 22:52:25 +0100 | [diff] [blame] | 2481 | target: { |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 2482 | host: { |
| 2483 | enabled: false, |
| 2484 | }, |
Martin Stjernholm | 47ed352 | 2020-06-17 22:52:25 +0100 | [diff] [blame] | 2485 | android_arm64: { |
| 2486 | srcs: ["android/arm64/lib/mylib.so"], |
| 2487 | }, |
| 2488 | android_arm: { |
| 2489 | srcs: ["android/arm/lib/mylib.so"], |
| 2490 | }, |
| 2491 | linux_glibc_x86_64: { |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 2492 | enabled: true, |
Martin Stjernholm | 47ed352 | 2020-06-17 22:52:25 +0100 | [diff] [blame] | 2493 | srcs: ["linux_glibc/x86_64/lib/mylib-host.so"], |
| 2494 | }, |
| 2495 | linux_glibc_x86: { |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 2496 | enabled: true, |
Martin Stjernholm | 47ed352 | 2020-06-17 22:52:25 +0100 | [diff] [blame] | 2497 | srcs: ["linux_glibc/x86/lib/mylib-host.so"], |
| 2498 | }, |
| 2499 | }, |
| 2500 | } |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 2501 | `), |
| 2502 | checkVersionedAndroidBpContents(` |
| 2503 | // This is auto-generated. DO NOT EDIT. |
Martin Stjernholm | 47ed352 | 2020-06-17 22:52:25 +0100 | [diff] [blame] | 2504 | |
| 2505 | cc_prebuilt_library_shared { |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 2506 | name: "mysdk_mylib@current", |
| 2507 | sdk_member_name: "mylib", |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 2508 | visibility: ["//visibility:public"], |
Martin Stjernholm | 1e04109 | 2020-11-03 00:11:09 +0000 | [diff] [blame] | 2509 | apex_available: ["//apex_available:platform"], |
Martin Stjernholm | 47ed352 | 2020-06-17 22:52:25 +0100 | [diff] [blame] | 2510 | host_supported: true, |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 2511 | installable: false, |
Martin Stjernholm | 47ed352 | 2020-06-17 22:52:25 +0100 | [diff] [blame] | 2512 | unique_host_soname: true, |
Martin Stjernholm | 89238f4 | 2020-07-10 00:14:03 +0100 | [diff] [blame] | 2513 | compile_multilib: "both", |
Martin Stjernholm | 47ed352 | 2020-06-17 22:52:25 +0100 | [diff] [blame] | 2514 | target: { |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 2515 | host: { |
| 2516 | enabled: false, |
| 2517 | }, |
Martin Stjernholm | 47ed352 | 2020-06-17 22:52:25 +0100 | [diff] [blame] | 2518 | android_arm64: { |
| 2519 | srcs: ["android/arm64/lib/mylib.so"], |
| 2520 | }, |
| 2521 | android_arm: { |
| 2522 | srcs: ["android/arm/lib/mylib.so"], |
| 2523 | }, |
| 2524 | linux_glibc_x86_64: { |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 2525 | enabled: true, |
Martin Stjernholm | 47ed352 | 2020-06-17 22:52:25 +0100 | [diff] [blame] | 2526 | srcs: ["linux_glibc/x86_64/lib/mylib-host.so"], |
| 2527 | }, |
| 2528 | linux_glibc_x86: { |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 2529 | enabled: true, |
Martin Stjernholm | 47ed352 | 2020-06-17 22:52:25 +0100 | [diff] [blame] | 2530 | srcs: ["linux_glibc/x86/lib/mylib-host.so"], |
| 2531 | }, |
| 2532 | }, |
| 2533 | } |
| 2534 | |
| 2535 | sdk_snapshot { |
| 2536 | name: "mysdk@current", |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 2537 | visibility: ["//visibility:public"], |
Martin Stjernholm | 47ed352 | 2020-06-17 22:52:25 +0100 | [diff] [blame] | 2538 | host_supported: true, |
| 2539 | native_shared_libs: ["mysdk_mylib@current"], |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 2540 | target: { |
| 2541 | host: { |
| 2542 | enabled: false, |
| 2543 | }, |
Jiyong Park | 8fe14e6 | 2020-10-19 22:47:34 +0900 | [diff] [blame] | 2544 | linux_glibc_x86_64: { |
| 2545 | enabled: true, |
| 2546 | }, |
| 2547 | linux_glibc_x86: { |
Martin Stjernholm | caa47d7 | 2020-07-11 04:52:24 +0100 | [diff] [blame] | 2548 | enabled: true, |
| 2549 | }, |
| 2550 | }, |
Martin Stjernholm | 47ed352 | 2020-06-17 22:52:25 +0100 | [diff] [blame] | 2551 | } |
| 2552 | `), |
| 2553 | checkAllCopyRules(` |
| 2554 | .intermediates/mylib/android_arm64_armv8-a_shared/mylib.so -> android/arm64/lib/mylib.so |
| 2555 | .intermediates/mylib/android_arm_armv7-a-neon_shared/mylib.so -> android/arm/lib/mylib.so |
| 2556 | .intermediates/mylib/linux_glibc_x86_64_shared/mylib-host.so -> linux_glibc/x86_64/lib/mylib-host.so |
| 2557 | .intermediates/mylib/linux_glibc_x86_shared/mylib-host.so -> linux_glibc/x86/lib/mylib-host.so |
| 2558 | `), |
| 2559 | ) |
| 2560 | } |
Martin Stjernholm | 59e0c7a | 2020-10-28 23:38:33 +0000 | [diff] [blame] | 2561 | |
| 2562 | func TestNoSanitizerMembers(t *testing.T) { |
| 2563 | result := testSdkWithCc(t, ` |
| 2564 | sdk { |
| 2565 | name: "mysdk", |
| 2566 | native_shared_libs: ["mynativelib"], |
| 2567 | } |
| 2568 | |
| 2569 | cc_library_shared { |
| 2570 | name: "mynativelib", |
| 2571 | srcs: ["Test.cpp"], |
| 2572 | export_include_dirs: ["include"], |
| 2573 | arch: { |
| 2574 | arm64: { |
| 2575 | export_system_include_dirs: ["arm64/include"], |
| 2576 | sanitize: { |
| 2577 | hwaddress: true, |
| 2578 | }, |
| 2579 | }, |
| 2580 | }, |
| 2581 | } |
| 2582 | `) |
| 2583 | |
| 2584 | result.CheckSnapshot("mysdk", "", |
Paul Duffin | 75b902a | 2021-02-22 12:13:13 +0000 | [diff] [blame^] | 2585 | checkUnversionedAndroidBpContents(` |
Martin Stjernholm | 59e0c7a | 2020-10-28 23:38:33 +0000 | [diff] [blame] | 2586 | // This is auto-generated. DO NOT EDIT. |
| 2587 | |
| 2588 | cc_prebuilt_library_shared { |
Martin Stjernholm | 59e0c7a | 2020-10-28 23:38:33 +0000 | [diff] [blame] | 2589 | name: "mynativelib", |
| 2590 | prefer: false, |
| 2591 | visibility: ["//visibility:public"], |
Martin Stjernholm | 1e04109 | 2020-11-03 00:11:09 +0000 | [diff] [blame] | 2592 | apex_available: ["//apex_available:platform"], |
Martin Stjernholm | 59e0c7a | 2020-10-28 23:38:33 +0000 | [diff] [blame] | 2593 | compile_multilib: "both", |
| 2594 | export_include_dirs: ["include/include"], |
| 2595 | arch: { |
| 2596 | arm64: { |
| 2597 | export_system_include_dirs: ["arm64/include/arm64/include"], |
| 2598 | }, |
| 2599 | arm: { |
| 2600 | srcs: ["arm/lib/mynativelib.so"], |
| 2601 | }, |
| 2602 | }, |
| 2603 | } |
Martin Stjernholm | 59e0c7a | 2020-10-28 23:38:33 +0000 | [diff] [blame] | 2604 | `), |
| 2605 | checkAllCopyRules(` |
| 2606 | include/Test.h -> include/include/Test.h |
| 2607 | arm64/include/Arm64Test.h -> arm64/include/arm64/include/Arm64Test.h |
| 2608 | .intermediates/mynativelib/android_arm_armv7-a-neon_shared/mynativelib.so -> arm/lib/mynativelib.so`), |
| 2609 | ) |
| 2610 | } |