blob: d775ac356f088816e1c98e5fb6778ea8e15e75c0 [file] [log] [blame]
Colin Crossce75d2c2016-10-06 16:12:58 -07001// Copyright 2016 Google Inc. All rights reserved.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package android
16
17import (
Colin Cross41955e82019-05-29 14:40:35 -070018 "fmt"
Colin Crossce75d2c2016-10-06 16:12:58 -070019 "testing"
20
21 "github.com/google/blueprint"
22)
23
Colin Cross0c66bc62021-07-20 09:47:41 -070024func TestPrebuilts(t *testing.T) {
25 buildOS := TestArchConfig(t.TempDir(), nil, "", nil).BuildOS
Martin Stjernholm009a9dc2020-03-05 17:34:13 +000026
Colin Cross0c66bc62021-07-20 09:47:41 -070027 var prebuiltsTests = []struct {
28 name string
29 replaceBp bool // modules is added to default bp boilerplate if false.
30 modules string
31 prebuilt []OsType
32 preparer FixturePreparer
33 }{
34 {
35 name: "no prebuilt",
36 modules: `
37 source {
38 name: "bar",
39 }`,
40 prebuilt: nil,
41 },
42 {
43 name: "no source prebuilt not preferred",
44 modules: `
45 prebuilt {
46 name: "bar",
47 prefer: false,
48 srcs: ["prebuilt_file"],
49 }`,
50 prebuilt: []OsType{Android, buildOS},
51 },
52 {
53 name: "no source prebuilt preferred",
54 modules: `
55 prebuilt {
56 name: "bar",
57 prefer: true,
58 srcs: ["prebuilt_file"],
59 }`,
60 prebuilt: []OsType{Android, buildOS},
61 },
62 {
63 name: "prebuilt not preferred",
64 modules: `
65 source {
66 name: "bar",
67 }
Martin Stjernholm009a9dc2020-03-05 17:34:13 +000068
Colin Cross0c66bc62021-07-20 09:47:41 -070069 prebuilt {
70 name: "bar",
71 prefer: false,
72 srcs: ["prebuilt_file"],
73 }`,
74 prebuilt: nil,
75 },
76 {
77 name: "prebuilt preferred",
78 modules: `
79 source {
80 name: "bar",
81 }
Martin Stjernholm009a9dc2020-03-05 17:34:13 +000082
Colin Cross0c66bc62021-07-20 09:47:41 -070083 prebuilt {
84 name: "bar",
85 prefer: true,
86 srcs: ["prebuilt_file"],
87 }`,
88 prebuilt: []OsType{Android, buildOS},
89 },
90 {
91 name: "prebuilt no file not preferred",
92 modules: `
93 source {
94 name: "bar",
95 }
Martin Stjernholm009a9dc2020-03-05 17:34:13 +000096
Colin Cross0c66bc62021-07-20 09:47:41 -070097 prebuilt {
98 name: "bar",
99 prefer: false,
100 }`,
101 prebuilt: nil,
102 },
103 {
104 name: "prebuilt no file preferred",
105 modules: `
106 source {
107 name: "bar",
108 }
Martin Stjernholm009a9dc2020-03-05 17:34:13 +0000109
Colin Cross0c66bc62021-07-20 09:47:41 -0700110 prebuilt {
111 name: "bar",
112 prefer: true,
113 }`,
114 prebuilt: nil,
115 },
116 {
117 name: "prebuilt file from filegroup preferred",
118 modules: `
119 filegroup {
120 name: "fg",
121 srcs: ["prebuilt_file"],
122 }
123 prebuilt {
124 name: "bar",
125 prefer: true,
126 srcs: [":fg"],
127 }`,
128 prebuilt: []OsType{Android, buildOS},
129 },
130 {
131 name: "prebuilt module for device only",
132 modules: `
133 source {
134 name: "bar",
135 }
Martin Stjernholm009a9dc2020-03-05 17:34:13 +0000136
Colin Cross0c66bc62021-07-20 09:47:41 -0700137 prebuilt {
138 name: "bar",
139 host_supported: false,
140 prefer: true,
141 srcs: ["prebuilt_file"],
142 }`,
143 prebuilt: []OsType{Android},
144 },
145 {
146 name: "prebuilt file for host only",
147 modules: `
148 source {
149 name: "bar",
150 }
Jaewoong Jungfb25a642020-06-11 10:37:51 -0700151
Colin Cross0c66bc62021-07-20 09:47:41 -0700152 prebuilt {
153 name: "bar",
154 prefer: true,
155 target: {
156 host: {
157 srcs: ["prebuilt_file"],
Liz Kammer69d64132021-06-24 13:03:06 -0400158 },
159 },
Colin Cross0c66bc62021-07-20 09:47:41 -0700160 }`,
161 prebuilt: []OsType{buildOS},
162 },
163 {
164 name: "prebuilt override not preferred",
165 modules: `
166 source {
167 name: "baz",
168 }
Paul Duffin0c52c7b2021-07-06 17:15:25 +0100169
Colin Cross0c66bc62021-07-20 09:47:41 -0700170 override_source {
171 name: "bar",
172 base: "baz",
173 }
Paul Duffin0c52c7b2021-07-06 17:15:25 +0100174
Colin Cross0c66bc62021-07-20 09:47:41 -0700175 prebuilt {
176 name: "bar",
177 prefer: false,
178 srcs: ["prebuilt_file"],
179 }`,
180 prebuilt: nil,
181 },
182 {
183 name: "prebuilt override preferred",
184 modules: `
185 source {
186 name: "baz",
187 }
Paul Duffin0c52c7b2021-07-06 17:15:25 +0100188
Colin Cross0c66bc62021-07-20 09:47:41 -0700189 override_source {
190 name: "bar",
191 base: "baz",
192 }
Colin Crossce75d2c2016-10-06 16:12:58 -0700193
Colin Cross0c66bc62021-07-20 09:47:41 -0700194 prebuilt {
195 name: "bar",
196 prefer: true,
197 srcs: ["prebuilt_file"],
198 }`,
199 prebuilt: []OsType{Android, buildOS},
200 },
201 {
202 name: "prebuilt including default-disabled OS",
203 replaceBp: true,
204 modules: `
205 source {
206 name: "foo",
207 deps: [":bar"],
208 target: {
209 windows: {
210 enabled: true,
211 },
212 },
213 }
214
215 source {
216 name: "bar",
217 target: {
218 windows: {
219 enabled: true,
220 },
221 },
222 }
223
224 prebuilt {
225 name: "bar",
226 prefer: true,
227 srcs: ["prebuilt_file"],
228 target: {
229 windows: {
230 enabled: true,
231 },
232 },
233 }`,
234 prebuilt: []OsType{Android, buildOS, Windows},
235 },
236 {
237 name: "fall back to source for default-disabled OS",
238 replaceBp: true,
239 modules: `
240 source {
241 name: "foo",
242 deps: [":bar"],
243 target: {
244 windows: {
245 enabled: true,
246 },
247 },
248 }
249
250 source {
251 name: "bar",
252 target: {
253 windows: {
254 enabled: true,
255 },
256 },
257 }
258
259 prebuilt {
260 name: "bar",
261 prefer: true,
262 srcs: ["prebuilt_file"],
263 }`,
264 prebuilt: []OsType{Android, buildOS},
265 },
266 {
267 name: "prebuilt properties customizable",
268 replaceBp: true,
269 modules: `
270 source {
271 name: "foo",
272 deps: [":bar"],
273 }
274
275 soong_config_module_type {
276 name: "prebuilt_with_config",
277 module_type: "prebuilt",
278 config_namespace: "any_namespace",
279 bool_variables: ["bool_var"],
280 properties: ["prefer"],
281 }
282
283 prebuilt_with_config {
284 name: "bar",
285 prefer: true,
286 srcs: ["prebuilt_file"],
287 soong_config_variables: {
288 bool_var: {
289 prefer: false,
290 conditions_default: {
291 prefer: true,
292 },
293 },
294 },
295 }`,
296 prebuilt: []OsType{Android, buildOS},
297 },
Colin Cross0c66bc62021-07-20 09:47:41 -0700298 }
299
Paul Duffin35816122021-02-24 01:49:52 +0000300 fs := MockFS{
Colin Cross98be1bb2019-12-13 20:41:13 -0800301 "prebuilt_file": nil,
302 "source_file": nil,
303 }
Colin Cross0d614dd2016-10-14 15:38:43 -0700304
Colin Crossce75d2c2016-10-06 16:12:58 -0700305 for _, test := range prebuiltsTests {
306 t.Run(test.name, func(t *testing.T) {
Martin Stjernholmf4677322020-07-07 02:20:40 +0100307 bp := test.modules
308 if !test.replaceBp {
309 bp = bp + `
310 source {
311 name: "foo",
312 deps: [":bar"],
313 }`
314 }
Colin Cross98be1bb2019-12-13 20:41:13 -0800315
Martin Stjernholmf4677322020-07-07 02:20:40 +0100316 // Add windows to the target list to test the logic when a variant is
317 // disabled by default.
318 if !Windows.DefaultDisabled {
319 t.Errorf("windows is assumed to be disabled by default")
320 }
Martin Stjernholmf4677322020-07-07 02:20:40 +0100321
Paul Duffin30ac3e72021-03-20 00:36:14 +0000322 result := GroupFixturePreparers(
Paul Duffin35816122021-02-24 01:49:52 +0000323 PrepareForTestWithArchMutator,
324 PrepareForTestWithPrebuilts,
325 PrepareForTestWithOverrides,
326 PrepareForTestWithFilegroup,
327 // Add a Windows target to the configuration.
328 FixtureModifyConfig(func(config Config) {
329 config.Targets[Windows] = []Target{
330 {Windows, Arch{ArchType: X86_64}, NativeBridgeDisabled, "", "", true},
331 }
332 }),
333 fs.AddToFixture(),
334 FixtureRegisterWithContext(registerTestPrebuiltModules),
Paul Duffin0c52c7b2021-07-06 17:15:25 +0100335 OptionalFixturePreparer(test.preparer),
Paul Duffin35816122021-02-24 01:49:52 +0000336 ).RunTestWithBp(t, bp)
Colin Crossce75d2c2016-10-06 16:12:58 -0700337
Paul Duffin35816122021-02-24 01:49:52 +0000338 for _, variant := range result.ModuleVariantsForTests("foo") {
339 foo := result.ModuleForTests("foo", variant)
Martin Stjernholmf4677322020-07-07 02:20:40 +0100340 t.Run(foo.Module().Target().Os.String(), func(t *testing.T) {
Martin Stjernholm009a9dc2020-03-05 17:34:13 +0000341 var dependsOnSourceModule, dependsOnPrebuiltModule bool
Paul Duffin35816122021-02-24 01:49:52 +0000342 result.VisitDirectDeps(foo.Module(), func(m blueprint.Module) {
Martin Stjernholm009a9dc2020-03-05 17:34:13 +0000343 if _, ok := m.(*sourceModule); ok {
344 dependsOnSourceModule = true
345 }
346 if p, ok := m.(*prebuiltModule); ok {
347 dependsOnPrebuiltModule = true
348 if !p.Prebuilt().properties.UsePrebuilt {
349 t.Errorf("dependency on prebuilt module not marked used")
350 }
351 }
352 })
Colin Crossce75d2c2016-10-06 16:12:58 -0700353
Cole Fausta963b942024-04-11 17:43:00 -0700354 moduleIsDisabled := !foo.Module().Enabled(PanickingConfigAndErrorContext(result.TestContext))
Martin Stjernholm009a9dc2020-03-05 17:34:13 +0000355 deps := foo.Module().(*sourceModule).deps
Martin Stjernholmf4677322020-07-07 02:20:40 +0100356 if moduleIsDisabled {
357 if len(deps) > 0 {
358 t.Errorf("disabled module got deps: %v", deps)
359 }
360 } else {
361 if len(deps) != 1 {
362 t.Errorf("deps does not have single path, but is %v", deps)
363 }
Colin Crossc3e7fa62017-03-17 13:14:32 -0700364 }
Martin Stjernholmf4677322020-07-07 02:20:40 +0100365
Martin Stjernholm009a9dc2020-03-05 17:34:13 +0000366 var usingSourceFile, usingPrebuiltFile bool
Martin Stjernholmf4677322020-07-07 02:20:40 +0100367 if len(deps) > 0 && deps[0].String() == "source_file" {
Martin Stjernholm009a9dc2020-03-05 17:34:13 +0000368 usingSourceFile = true
369 }
Martin Stjernholmf4677322020-07-07 02:20:40 +0100370 if len(deps) > 0 && deps[0].String() == "prebuilt_file" {
Martin Stjernholm009a9dc2020-03-05 17:34:13 +0000371 usingPrebuiltFile = true
372 }
Colin Crossc3e7fa62017-03-17 13:14:32 -0700373
Martin Stjernholm009a9dc2020-03-05 17:34:13 +0000374 prebuilt := false
375 for _, os := range test.prebuilt {
Martin Stjernholmf4677322020-07-07 02:20:40 +0100376 if os == foo.Module().Target().Os {
Martin Stjernholm009a9dc2020-03-05 17:34:13 +0000377 prebuilt = true
378 }
379 }
Jiyong Parkd4671112019-04-19 17:23:04 +0900380
Martin Stjernholm009a9dc2020-03-05 17:34:13 +0000381 if prebuilt {
Martin Stjernholmf4677322020-07-07 02:20:40 +0100382 if moduleIsDisabled {
383 t.Errorf("dependent module for prebuilt is disabled")
384 }
385
Martin Stjernholm009a9dc2020-03-05 17:34:13 +0000386 if !dependsOnPrebuiltModule {
387 t.Errorf("doesn't depend on prebuilt module")
388 }
389 if !usingPrebuiltFile {
390 t.Errorf("doesn't use prebuilt_file")
391 }
Colin Crossce75d2c2016-10-06 16:12:58 -0700392
Martin Stjernholm009a9dc2020-03-05 17:34:13 +0000393 if dependsOnSourceModule {
394 t.Errorf("depends on source module")
395 }
396 if usingSourceFile {
397 t.Errorf("using source_file")
398 }
Martin Stjernholmf4677322020-07-07 02:20:40 +0100399 } else if !moduleIsDisabled {
Martin Stjernholm009a9dc2020-03-05 17:34:13 +0000400 if dependsOnPrebuiltModule {
401 t.Errorf("depends on prebuilt module")
402 }
403 if usingPrebuiltFile {
404 t.Errorf("using prebuilt_file")
405 }
Colin Crossce75d2c2016-10-06 16:12:58 -0700406
Martin Stjernholm009a9dc2020-03-05 17:34:13 +0000407 if !dependsOnSourceModule {
408 t.Errorf("doesn't depend on source module")
409 }
410 if !usingSourceFile {
411 t.Errorf("doesn't use source_file")
412 }
413 }
414 })
Colin Crossce75d2c2016-10-06 16:12:58 -0700415 }
416 })
417 }
Colin Crossce75d2c2016-10-06 16:12:58 -0700418}
419
Spandan Dase3fcb412023-10-26 20:48:02 +0000420func testPrebuiltErrorWithFixture(t *testing.T, expectedError, bp string, fixture FixturePreparer) {
Jooyung Hanebaa5732023-05-02 11:43:14 +0900421 t.Helper()
422 fs := MockFS{
423 "prebuilt_file": nil,
424 }
425 GroupFixturePreparers(
426 PrepareForTestWithArchMutator,
427 PrepareForTestWithPrebuilts,
428 PrepareForTestWithOverrides,
429 fs.AddToFixture(),
430 FixtureRegisterWithContext(registerTestPrebuiltModules),
Spandan Dase3fcb412023-10-26 20:48:02 +0000431 OptionalFixturePreparer(fixture),
Jooyung Hanebaa5732023-05-02 11:43:14 +0900432 ).
433 ExtendWithErrorHandler(FixtureExpectsAtLeastOneErrorMatchingPattern(expectedError)).
434 RunTestWithBp(t, bp)
Spandan Dase3fcb412023-10-26 20:48:02 +0000435
436}
437
438func testPrebuiltError(t *testing.T, expectedError, bp string) {
439 testPrebuiltErrorWithFixture(t, expectedError, bp, nil)
Jooyung Hanebaa5732023-05-02 11:43:14 +0900440}
441
442func TestPrebuiltShouldNotChangePartition(t *testing.T) {
443 testPrebuiltError(t, `partition is different`, `
444 source {
445 name: "foo",
446 vendor: true,
447 }
448 prebuilt {
449 name: "foo",
450 prefer: true,
451 srcs: ["prebuilt_file"],
452 }`)
453}
454
455func TestPrebuiltShouldNotChangePartition_WithOverride(t *testing.T) {
456 testPrebuiltError(t, `partition is different`, `
457 source {
458 name: "foo",
459 vendor: true,
460 }
461 override_source {
462 name: "bar",
463 base: "foo",
464 }
465 prebuilt {
466 name: "bar",
467 prefer: true,
468 srcs: ["prebuilt_file"],
469 }`)
470}
471
Paul Duffin78ac5b92020-01-14 12:42:08 +0000472func registerTestPrebuiltBuildComponents(ctx RegistrationContext) {
Paul Duffin35816122021-02-24 01:49:52 +0000473 registerTestPrebuiltModules(ctx)
Paul Duffin78ac5b92020-01-14 12:42:08 +0000474
475 RegisterPrebuiltMutators(ctx)
Jaewoong Jungfb25a642020-06-11 10:37:51 -0700476 ctx.PostDepsMutators(RegisterOverridePostDepsMutators)
Paul Duffin78ac5b92020-01-14 12:42:08 +0000477}
478
Paul Duffincfd33742021-02-27 11:59:02 +0000479var prepareForTestWithFakePrebuiltModules = FixtureRegisterWithContext(registerTestPrebuiltModules)
480
Paul Duffin35816122021-02-24 01:49:52 +0000481func registerTestPrebuiltModules(ctx RegistrationContext) {
482 ctx.RegisterModuleType("prebuilt", newPrebuiltModule)
483 ctx.RegisterModuleType("source", newSourceModule)
484 ctx.RegisterModuleType("override_source", newOverrideSourceModule)
Jingwen Chena47f28d2021-11-02 16:43:57 +0000485 ctx.RegisterModuleType("soong_config_module_type", SoongConfigModuleTypeFactory)
486 ctx.RegisterModuleType("soong_config_string_variable", SoongConfigStringVariableDummyFactory)
487 ctx.RegisterModuleType("soong_config_bool_variable", SoongConfigBoolVariableDummyFactory)
Spandan Dase3fcb412023-10-26 20:48:02 +0000488 RegisterApexContributionsBuildComponents(ctx)
Paul Duffin35816122021-02-24 01:49:52 +0000489}
490
Colin Crossce75d2c2016-10-06 16:12:58 -0700491type prebuiltModule struct {
492 ModuleBase
Colin Cross74d73e22017-08-02 11:05:49 -0700493 prebuilt Prebuilt
494 properties struct {
Martin Stjernholm009a9dc2020-03-05 17:34:13 +0000495 Srcs []string `android:"path,arch_variant"`
Colin Cross74d73e22017-08-02 11:05:49 -0700496 }
Jiyong Parkd4671112019-04-19 17:23:04 +0900497 src Path
Colin Crossce75d2c2016-10-06 16:12:58 -0700498}
499
Colin Cross36242852017-06-23 15:06:31 -0700500func newPrebuiltModule() Module {
Colin Crossce75d2c2016-10-06 16:12:58 -0700501 m := &prebuiltModule{}
Colin Cross74d73e22017-08-02 11:05:49 -0700502 m.AddProperties(&m.properties)
503 InitPrebuiltModule(m, &m.properties.Srcs)
Martin Stjernholm009a9dc2020-03-05 17:34:13 +0000504 InitAndroidArchModule(m, HostAndDeviceDefault, MultilibCommon)
Colin Cross36242852017-06-23 15:06:31 -0700505 return m
Colin Crossce75d2c2016-10-06 16:12:58 -0700506}
507
508func (p *prebuiltModule) Name() string {
509 return p.prebuilt.Name(p.ModuleBase.Name())
510}
511
Jiyong Parkd4671112019-04-19 17:23:04 +0900512func (p *prebuiltModule) GenerateAndroidBuildActions(ctx ModuleContext) {
513 if len(p.properties.Srcs) >= 1 {
514 p.src = p.prebuilt.SingleSourcePath(ctx)
515 }
Colin Crossce75d2c2016-10-06 16:12:58 -0700516}
517
518func (p *prebuiltModule) Prebuilt() *Prebuilt {
519 return &p.prebuilt
520}
521
Colin Cross41955e82019-05-29 14:40:35 -0700522func (p *prebuiltModule) OutputFiles(tag string) (Paths, error) {
523 switch tag {
524 case "":
525 return Paths{p.src}, nil
526 default:
527 return nil, fmt.Errorf("unsupported module reference tag %q", tag)
528 }
Jiyong Parkd4671112019-04-19 17:23:04 +0900529}
530
Jaewoong Jungfb25a642020-06-11 10:37:51 -0700531type sourceModuleProperties struct {
532 Deps []string `android:"path,arch_variant"`
533}
534
Colin Crossce75d2c2016-10-06 16:12:58 -0700535type sourceModule struct {
536 ModuleBase
Jaewoong Jungfb25a642020-06-11 10:37:51 -0700537 OverridableModuleBase
538
539 properties sourceModuleProperties
Colin Crossce75d2c2016-10-06 16:12:58 -0700540 dependsOnSourceModule, dependsOnPrebuiltModule bool
Jiyong Parkd4671112019-04-19 17:23:04 +0900541 deps Paths
542 src Path
Colin Crossce75d2c2016-10-06 16:12:58 -0700543}
544
Colin Cross36242852017-06-23 15:06:31 -0700545func newSourceModule() Module {
Colin Crossce75d2c2016-10-06 16:12:58 -0700546 m := &sourceModule{}
Colin Cross36242852017-06-23 15:06:31 -0700547 m.AddProperties(&m.properties)
Martin Stjernholm009a9dc2020-03-05 17:34:13 +0000548 InitAndroidArchModule(m, HostAndDeviceDefault, MultilibCommon)
Jaewoong Jungfb25a642020-06-11 10:37:51 -0700549 InitOverridableModule(m, nil)
Colin Cross36242852017-06-23 15:06:31 -0700550 return m
Colin Crossce75d2c2016-10-06 16:12:58 -0700551}
552
Jaewoong Jungfb25a642020-06-11 10:37:51 -0700553func (s *sourceModule) OverridablePropertiesDepsMutator(ctx BottomUpMutatorContext) {
Jiyong Parkd4671112019-04-19 17:23:04 +0900554 // s.properties.Deps are annotated with android:path, so they are
555 // automatically added to the dependency by pathDeps mutator
Colin Crossce75d2c2016-10-06 16:12:58 -0700556}
557
558func (s *sourceModule) GenerateAndroidBuildActions(ctx ModuleContext) {
Jiyong Parkd4671112019-04-19 17:23:04 +0900559 s.deps = PathsForModuleSrc(ctx, s.properties.Deps)
560 s.src = PathForModuleSrc(ctx, "source_file")
561}
562
563func (s *sourceModule) Srcs() Paths {
564 return Paths{s.src}
Colin Crossce75d2c2016-10-06 16:12:58 -0700565}
Jaewoong Jungfb25a642020-06-11 10:37:51 -0700566
567type overrideSourceModule struct {
568 ModuleBase
569 OverrideModuleBase
570}
571
572func (o *overrideSourceModule) GenerateAndroidBuildActions(_ ModuleContext) {
573}
574
575func newOverrideSourceModule() Module {
576 m := &overrideSourceModule{}
577 m.AddProperties(&sourceModuleProperties{})
578
579 InitAndroidArchModule(m, HostAndDeviceDefault, MultilibCommon)
580 InitOverrideModule(m)
581 return m
582}
Spandan Dase3fcb412023-10-26 20:48:02 +0000583
584func TestPrebuiltErrorCannotListBothSourceAndPrebuiltInContributions(t *testing.T) {
585 selectMainlineModuleContritbutions := GroupFixturePreparers(
586 FixtureModifyProductVariables(func(variables FixtureProductVariables) {
587 variables.BuildFlags = map[string]string{
588 "RELEASE_APEX_CONTRIBUTIONS_ADSERVICES": "my_apex_contributions",
589 }
590 }),
591 )
Spandan Das3576e762024-01-03 18:57:03 +0000592 testPrebuiltErrorWithFixture(t, `Found duplicate variations of the same module in apex_contributions: foo and prebuilt_foo. Please remove one of these`, `
Spandan Dase3fcb412023-10-26 20:48:02 +0000593 source {
594 name: "foo",
595 }
596 prebuilt {
597 name: "foo",
598 srcs: ["prebuilt_file"],
599 }
600 apex_contributions {
601 name: "my_apex_contributions",
602 api_domain: "my_mainline_module",
603 contents: [
604 "foo",
605 "prebuilt_foo",
606 ],
607 }
608 all_apex_contributions {
609 name: "all_apex_contributions",
610 }
611 `, selectMainlineModuleContritbutions)
612}