2016-10-07 01:12:58 +02:00
|
|
|
// Copyright 2016 Google Inc. All rights reserved.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
|
|
|
|
package android
|
|
|
|
|
|
|
|
import (
|
2019-05-29 23:40:35 +02:00
|
|
|
"fmt"
|
2016-10-07 01:12:58 +02:00
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/google/blueprint"
|
|
|
|
)
|
|
|
|
|
|
|
|
var prebuiltsTests = []struct {
|
2020-07-07 03:20:40 +02:00
|
|
|
name string
|
|
|
|
replaceBp bool // modules is added to default bp boilerplate if false.
|
|
|
|
modules string
|
|
|
|
prebuilt []OsType
|
2016-10-07 01:12:58 +02:00
|
|
|
}{
|
|
|
|
{
|
|
|
|
name: "no prebuilt",
|
|
|
|
modules: `
|
|
|
|
source {
|
|
|
|
name: "bar",
|
|
|
|
}`,
|
2020-03-05 18:34:13 +01:00
|
|
|
prebuilt: nil,
|
2016-10-07 01:12:58 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "no source prebuilt not preferred",
|
|
|
|
modules: `
|
|
|
|
prebuilt {
|
|
|
|
name: "bar",
|
|
|
|
prefer: false,
|
2019-04-19 10:23:04 +02:00
|
|
|
srcs: ["prebuilt_file"],
|
2016-10-07 01:12:58 +02:00
|
|
|
}`,
|
2020-07-07 03:20:40 +02:00
|
|
|
prebuilt: []OsType{Android, BuildOs},
|
2016-10-07 01:12:58 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "no source prebuilt preferred",
|
|
|
|
modules: `
|
|
|
|
prebuilt {
|
|
|
|
name: "bar",
|
|
|
|
prefer: true,
|
2019-04-19 10:23:04 +02:00
|
|
|
srcs: ["prebuilt_file"],
|
2016-10-07 01:12:58 +02:00
|
|
|
}`,
|
2020-07-07 03:20:40 +02:00
|
|
|
prebuilt: []OsType{Android, BuildOs},
|
2016-10-07 01:12:58 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "prebuilt not preferred",
|
|
|
|
modules: `
|
|
|
|
source {
|
|
|
|
name: "bar",
|
|
|
|
}
|
2020-03-05 18:34:13 +01:00
|
|
|
|
2016-10-07 01:12:58 +02:00
|
|
|
prebuilt {
|
|
|
|
name: "bar",
|
|
|
|
prefer: false,
|
2019-04-19 10:23:04 +02:00
|
|
|
srcs: ["prebuilt_file"],
|
2016-10-07 01:12:58 +02:00
|
|
|
}`,
|
2020-03-05 18:34:13 +01:00
|
|
|
prebuilt: nil,
|
2016-10-07 01:12:58 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "prebuilt preferred",
|
|
|
|
modules: `
|
|
|
|
source {
|
|
|
|
name: "bar",
|
|
|
|
}
|
2020-03-05 18:34:13 +01:00
|
|
|
|
2016-10-07 01:12:58 +02:00
|
|
|
prebuilt {
|
|
|
|
name: "bar",
|
|
|
|
prefer: true,
|
2019-04-19 10:23:04 +02:00
|
|
|
srcs: ["prebuilt_file"],
|
2016-10-07 01:12:58 +02:00
|
|
|
}`,
|
2020-07-07 03:20:40 +02:00
|
|
|
prebuilt: []OsType{Android, BuildOs},
|
2016-10-07 01:12:58 +02:00
|
|
|
},
|
2016-10-15 00:38:43 +02:00
|
|
|
{
|
|
|
|
name: "prebuilt no file not preferred",
|
|
|
|
modules: `
|
|
|
|
source {
|
|
|
|
name: "bar",
|
|
|
|
}
|
2020-03-05 18:34:13 +01:00
|
|
|
|
2016-10-15 00:38:43 +02:00
|
|
|
prebuilt {
|
|
|
|
name: "bar",
|
|
|
|
prefer: false,
|
|
|
|
}`,
|
2020-03-05 18:34:13 +01:00
|
|
|
prebuilt: nil,
|
2016-10-15 00:38:43 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "prebuilt no file preferred",
|
|
|
|
modules: `
|
|
|
|
source {
|
|
|
|
name: "bar",
|
|
|
|
}
|
2020-03-05 18:34:13 +01:00
|
|
|
|
2016-10-15 00:38:43 +02:00
|
|
|
prebuilt {
|
|
|
|
name: "bar",
|
|
|
|
prefer: true,
|
|
|
|
}`,
|
2020-03-05 18:34:13 +01:00
|
|
|
prebuilt: nil,
|
2016-10-15 00:38:43 +02:00
|
|
|
},
|
2018-04-17 23:58:42 +02:00
|
|
|
{
|
|
|
|
name: "prebuilt file from filegroup preferred",
|
|
|
|
modules: `
|
|
|
|
filegroup {
|
|
|
|
name: "fg",
|
2019-04-19 10:23:04 +02:00
|
|
|
srcs: ["prebuilt_file"],
|
2018-04-17 23:58:42 +02:00
|
|
|
}
|
|
|
|
prebuilt {
|
|
|
|
name: "bar",
|
|
|
|
prefer: true,
|
|
|
|
srcs: [":fg"],
|
|
|
|
}`,
|
2020-07-07 03:20:40 +02:00
|
|
|
prebuilt: []OsType{Android, BuildOs},
|
2020-03-05 18:34:13 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "prebuilt module for device only",
|
|
|
|
modules: `
|
|
|
|
source {
|
|
|
|
name: "bar",
|
|
|
|
}
|
|
|
|
|
|
|
|
prebuilt {
|
|
|
|
name: "bar",
|
|
|
|
host_supported: false,
|
|
|
|
prefer: true,
|
|
|
|
srcs: ["prebuilt_file"],
|
|
|
|
}`,
|
2020-07-07 03:20:40 +02:00
|
|
|
prebuilt: []OsType{Android},
|
2020-03-05 18:34:13 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "prebuilt file for host only",
|
|
|
|
modules: `
|
|
|
|
source {
|
|
|
|
name: "bar",
|
|
|
|
}
|
|
|
|
|
|
|
|
prebuilt {
|
|
|
|
name: "bar",
|
|
|
|
prefer: true,
|
|
|
|
target: {
|
2020-05-29 09:01:00 +02:00
|
|
|
host: {
|
2020-03-05 18:34:13 +01:00
|
|
|
srcs: ["prebuilt_file"],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}`,
|
2020-07-07 03:20:40 +02:00
|
|
|
prebuilt: []OsType{BuildOs},
|
2018-04-17 23:58:42 +02:00
|
|
|
},
|
2020-06-11 19:37:51 +02:00
|
|
|
{
|
|
|
|
name: "prebuilt override not preferred",
|
|
|
|
modules: `
|
|
|
|
source {
|
|
|
|
name: "baz",
|
|
|
|
}
|
|
|
|
|
|
|
|
override_source {
|
|
|
|
name: "bar",
|
|
|
|
base: "baz",
|
|
|
|
}
|
|
|
|
|
|
|
|
prebuilt {
|
|
|
|
name: "bar",
|
|
|
|
prefer: false,
|
|
|
|
srcs: ["prebuilt_file"],
|
|
|
|
}`,
|
|
|
|
prebuilt: nil,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "prebuilt override preferred",
|
|
|
|
modules: `
|
|
|
|
source {
|
|
|
|
name: "baz",
|
|
|
|
}
|
|
|
|
|
|
|
|
override_source {
|
|
|
|
name: "bar",
|
|
|
|
base: "baz",
|
|
|
|
}
|
|
|
|
|
|
|
|
prebuilt {
|
|
|
|
name: "bar",
|
|
|
|
prefer: true,
|
|
|
|
srcs: ["prebuilt_file"],
|
|
|
|
}`,
|
2020-07-07 03:20:40 +02:00
|
|
|
prebuilt: []OsType{Android, BuildOs},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "prebuilt including default-disabled OS",
|
|
|
|
replaceBp: true,
|
|
|
|
modules: `
|
|
|
|
source {
|
|
|
|
name: "foo",
|
|
|
|
deps: [":bar"],
|
|
|
|
target: {
|
|
|
|
windows: {
|
|
|
|
enabled: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
source {
|
|
|
|
name: "bar",
|
|
|
|
target: {
|
|
|
|
windows: {
|
|
|
|
enabled: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
prebuilt {
|
|
|
|
name: "bar",
|
|
|
|
prefer: true,
|
|
|
|
srcs: ["prebuilt_file"],
|
|
|
|
target: {
|
|
|
|
windows: {
|
|
|
|
enabled: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}`,
|
|
|
|
prebuilt: []OsType{Android, BuildOs, Windows},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "fall back to source for default-disabled OS",
|
|
|
|
replaceBp: true,
|
|
|
|
modules: `
|
|
|
|
source {
|
|
|
|
name: "foo",
|
|
|
|
deps: [":bar"],
|
|
|
|
target: {
|
|
|
|
windows: {
|
|
|
|
enabled: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
source {
|
|
|
|
name: "bar",
|
|
|
|
target: {
|
|
|
|
windows: {
|
|
|
|
enabled: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
prebuilt {
|
|
|
|
name: "bar",
|
|
|
|
prefer: true,
|
|
|
|
srcs: ["prebuilt_file"],
|
|
|
|
}`,
|
|
|
|
prebuilt: []OsType{Android, BuildOs},
|
2020-06-11 19:37:51 +02:00
|
|
|
},
|
2016-10-07 01:12:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func TestPrebuilts(t *testing.T) {
|
2021-02-24 02:49:52 +01:00
|
|
|
fs := MockFS{
|
2019-12-14 05:41:13 +01:00
|
|
|
"prebuilt_file": nil,
|
|
|
|
"source_file": nil,
|
|
|
|
}
|
2016-10-15 00:38:43 +02:00
|
|
|
|
2016-10-07 01:12:58 +02:00
|
|
|
for _, test := range prebuiltsTests {
|
|
|
|
t.Run(test.name, func(t *testing.T) {
|
2020-07-07 03:20:40 +02:00
|
|
|
bp := test.modules
|
|
|
|
if !test.replaceBp {
|
|
|
|
bp = bp + `
|
|
|
|
source {
|
|
|
|
name: "foo",
|
|
|
|
deps: [":bar"],
|
|
|
|
}`
|
|
|
|
}
|
2019-12-14 05:41:13 +01:00
|
|
|
|
2020-07-07 03:20:40 +02:00
|
|
|
// Add windows to the target list to test the logic when a variant is
|
|
|
|
// disabled by default.
|
|
|
|
if !Windows.DefaultDisabled {
|
|
|
|
t.Errorf("windows is assumed to be disabled by default")
|
|
|
|
}
|
2016-10-07 01:12:58 +02:00
|
|
|
|
2021-03-20 01:36:14 +01:00
|
|
|
result := GroupFixturePreparers(
|
2021-02-24 02:49:52 +01:00
|
|
|
PrepareForTestWithArchMutator,
|
|
|
|
PrepareForTestWithPrebuilts,
|
|
|
|
PrepareForTestWithOverrides,
|
|
|
|
PrepareForTestWithFilegroup,
|
|
|
|
// Add a Windows target to the configuration.
|
|
|
|
FixtureModifyConfig(func(config Config) {
|
|
|
|
config.Targets[Windows] = []Target{
|
|
|
|
{Windows, Arch{ArchType: X86_64}, NativeBridgeDisabled, "", "", true},
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
fs.AddToFixture(),
|
|
|
|
FixtureRegisterWithContext(registerTestPrebuiltModules),
|
|
|
|
).RunTestWithBp(t, bp)
|
2016-10-07 01:12:58 +02:00
|
|
|
|
2021-02-24 02:49:52 +01:00
|
|
|
for _, variant := range result.ModuleVariantsForTests("foo") {
|
|
|
|
foo := result.ModuleForTests("foo", variant)
|
2020-07-07 03:20:40 +02:00
|
|
|
t.Run(foo.Module().Target().Os.String(), func(t *testing.T) {
|
2020-03-05 18:34:13 +01:00
|
|
|
var dependsOnSourceModule, dependsOnPrebuiltModule bool
|
2021-02-24 02:49:52 +01:00
|
|
|
result.VisitDirectDeps(foo.Module(), func(m blueprint.Module) {
|
2020-03-05 18:34:13 +01:00
|
|
|
if _, ok := m.(*sourceModule); ok {
|
|
|
|
dependsOnSourceModule = true
|
|
|
|
}
|
|
|
|
if p, ok := m.(*prebuiltModule); ok {
|
|
|
|
dependsOnPrebuiltModule = true
|
|
|
|
if !p.Prebuilt().properties.UsePrebuilt {
|
|
|
|
t.Errorf("dependency on prebuilt module not marked used")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
2016-10-07 01:12:58 +02:00
|
|
|
|
2020-07-07 03:20:40 +02:00
|
|
|
moduleIsDisabled := !foo.Module().Enabled()
|
2020-03-05 18:34:13 +01:00
|
|
|
deps := foo.Module().(*sourceModule).deps
|
2020-07-07 03:20:40 +02:00
|
|
|
if moduleIsDisabled {
|
|
|
|
if len(deps) > 0 {
|
|
|
|
t.Errorf("disabled module got deps: %v", deps)
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if len(deps) != 1 {
|
|
|
|
t.Errorf("deps does not have single path, but is %v", deps)
|
|
|
|
}
|
2020-03-05 18:34:13 +01:00
|
|
|
}
|
2020-07-07 03:20:40 +02:00
|
|
|
|
2020-03-05 18:34:13 +01:00
|
|
|
var usingSourceFile, usingPrebuiltFile bool
|
2020-07-07 03:20:40 +02:00
|
|
|
if len(deps) > 0 && deps[0].String() == "source_file" {
|
2020-03-05 18:34:13 +01:00
|
|
|
usingSourceFile = true
|
|
|
|
}
|
2020-07-07 03:20:40 +02:00
|
|
|
if len(deps) > 0 && deps[0].String() == "prebuilt_file" {
|
2020-03-05 18:34:13 +01:00
|
|
|
usingPrebuiltFile = true
|
2017-03-17 21:14:32 +01:00
|
|
|
}
|
|
|
|
|
2020-03-05 18:34:13 +01:00
|
|
|
prebuilt := false
|
|
|
|
for _, os := range test.prebuilt {
|
2020-07-07 03:20:40 +02:00
|
|
|
if os == foo.Module().Target().Os {
|
2020-03-05 18:34:13 +01:00
|
|
|
prebuilt = true
|
|
|
|
}
|
|
|
|
}
|
2019-04-19 10:23:04 +02:00
|
|
|
|
2020-03-05 18:34:13 +01:00
|
|
|
if prebuilt {
|
2020-07-07 03:20:40 +02:00
|
|
|
if moduleIsDisabled {
|
|
|
|
t.Errorf("dependent module for prebuilt is disabled")
|
|
|
|
}
|
|
|
|
|
2020-03-05 18:34:13 +01:00
|
|
|
if !dependsOnPrebuiltModule {
|
|
|
|
t.Errorf("doesn't depend on prebuilt module")
|
|
|
|
}
|
|
|
|
if !usingPrebuiltFile {
|
|
|
|
t.Errorf("doesn't use prebuilt_file")
|
|
|
|
}
|
2016-10-07 01:12:58 +02:00
|
|
|
|
2020-03-05 18:34:13 +01:00
|
|
|
if dependsOnSourceModule {
|
|
|
|
t.Errorf("depends on source module")
|
|
|
|
}
|
|
|
|
if usingSourceFile {
|
|
|
|
t.Errorf("using source_file")
|
|
|
|
}
|
2020-07-07 03:20:40 +02:00
|
|
|
} else if !moduleIsDisabled {
|
2020-03-05 18:34:13 +01:00
|
|
|
if dependsOnPrebuiltModule {
|
|
|
|
t.Errorf("depends on prebuilt module")
|
|
|
|
}
|
|
|
|
if usingPrebuiltFile {
|
|
|
|
t.Errorf("using prebuilt_file")
|
|
|
|
}
|
2016-10-07 01:12:58 +02:00
|
|
|
|
2020-03-05 18:34:13 +01:00
|
|
|
if !dependsOnSourceModule {
|
|
|
|
t.Errorf("doesn't depend on source module")
|
|
|
|
}
|
|
|
|
if !usingSourceFile {
|
|
|
|
t.Errorf("doesn't use source_file")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
2016-10-07 01:12:58 +02:00
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-01-14 13:42:08 +01:00
|
|
|
func registerTestPrebuiltBuildComponents(ctx RegistrationContext) {
|
2021-02-24 02:49:52 +01:00
|
|
|
registerTestPrebuiltModules(ctx)
|
2020-01-14 13:42:08 +01:00
|
|
|
|
|
|
|
RegisterPrebuiltMutators(ctx)
|
2020-06-11 19:37:51 +02:00
|
|
|
ctx.PostDepsMutators(RegisterOverridePostDepsMutators)
|
2020-01-14 13:42:08 +01:00
|
|
|
}
|
|
|
|
|
2021-02-27 12:59:02 +01:00
|
|
|
var prepareForTestWithFakePrebuiltModules = FixtureRegisterWithContext(registerTestPrebuiltModules)
|
|
|
|
|
2021-02-24 02:49:52 +01:00
|
|
|
func registerTestPrebuiltModules(ctx RegistrationContext) {
|
|
|
|
ctx.RegisterModuleType("prebuilt", newPrebuiltModule)
|
|
|
|
ctx.RegisterModuleType("source", newSourceModule)
|
|
|
|
ctx.RegisterModuleType("override_source", newOverrideSourceModule)
|
|
|
|
}
|
|
|
|
|
2016-10-07 01:12:58 +02:00
|
|
|
type prebuiltModule struct {
|
|
|
|
ModuleBase
|
2017-08-02 20:05:49 +02:00
|
|
|
prebuilt Prebuilt
|
|
|
|
properties struct {
|
2020-03-05 18:34:13 +01:00
|
|
|
Srcs []string `android:"path,arch_variant"`
|
2017-08-02 20:05:49 +02:00
|
|
|
}
|
2019-04-19 10:23:04 +02:00
|
|
|
src Path
|
2016-10-07 01:12:58 +02:00
|
|
|
}
|
|
|
|
|
2017-06-24 00:06:31 +02:00
|
|
|
func newPrebuiltModule() Module {
|
2016-10-07 01:12:58 +02:00
|
|
|
m := &prebuiltModule{}
|
2017-08-02 20:05:49 +02:00
|
|
|
m.AddProperties(&m.properties)
|
|
|
|
InitPrebuiltModule(m, &m.properties.Srcs)
|
2020-03-05 18:34:13 +01:00
|
|
|
InitAndroidArchModule(m, HostAndDeviceDefault, MultilibCommon)
|
2017-06-24 00:06:31 +02:00
|
|
|
return m
|
2016-10-07 01:12:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func (p *prebuiltModule) Name() string {
|
|
|
|
return p.prebuilt.Name(p.ModuleBase.Name())
|
|
|
|
}
|
|
|
|
|
2019-04-19 10:23:04 +02:00
|
|
|
func (p *prebuiltModule) GenerateAndroidBuildActions(ctx ModuleContext) {
|
|
|
|
if len(p.properties.Srcs) >= 1 {
|
|
|
|
p.src = p.prebuilt.SingleSourcePath(ctx)
|
|
|
|
}
|
2016-10-07 01:12:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func (p *prebuiltModule) Prebuilt() *Prebuilt {
|
|
|
|
return &p.prebuilt
|
|
|
|
}
|
|
|
|
|
2019-05-29 23:40:35 +02:00
|
|
|
func (p *prebuiltModule) OutputFiles(tag string) (Paths, error) {
|
|
|
|
switch tag {
|
|
|
|
case "":
|
|
|
|
return Paths{p.src}, nil
|
|
|
|
default:
|
|
|
|
return nil, fmt.Errorf("unsupported module reference tag %q", tag)
|
|
|
|
}
|
2019-04-19 10:23:04 +02:00
|
|
|
}
|
|
|
|
|
2020-06-11 19:37:51 +02:00
|
|
|
type sourceModuleProperties struct {
|
|
|
|
Deps []string `android:"path,arch_variant"`
|
|
|
|
}
|
|
|
|
|
2016-10-07 01:12:58 +02:00
|
|
|
type sourceModule struct {
|
|
|
|
ModuleBase
|
2020-06-11 19:37:51 +02:00
|
|
|
OverridableModuleBase
|
|
|
|
|
|
|
|
properties sourceModuleProperties
|
2016-10-07 01:12:58 +02:00
|
|
|
dependsOnSourceModule, dependsOnPrebuiltModule bool
|
2019-04-19 10:23:04 +02:00
|
|
|
deps Paths
|
|
|
|
src Path
|
2016-10-07 01:12:58 +02:00
|
|
|
}
|
|
|
|
|
2017-06-24 00:06:31 +02:00
|
|
|
func newSourceModule() Module {
|
2016-10-07 01:12:58 +02:00
|
|
|
m := &sourceModule{}
|
2017-06-24 00:06:31 +02:00
|
|
|
m.AddProperties(&m.properties)
|
2020-03-05 18:34:13 +01:00
|
|
|
InitAndroidArchModule(m, HostAndDeviceDefault, MultilibCommon)
|
2020-06-11 19:37:51 +02:00
|
|
|
InitOverridableModule(m, nil)
|
2017-06-24 00:06:31 +02:00
|
|
|
return m
|
2016-10-07 01:12:58 +02:00
|
|
|
}
|
|
|
|
|
2020-06-11 19:37:51 +02:00
|
|
|
func (s *sourceModule) OverridablePropertiesDepsMutator(ctx BottomUpMutatorContext) {
|
2019-04-19 10:23:04 +02:00
|
|
|
// s.properties.Deps are annotated with android:path, so they are
|
|
|
|
// automatically added to the dependency by pathDeps mutator
|
2016-10-07 01:12:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func (s *sourceModule) GenerateAndroidBuildActions(ctx ModuleContext) {
|
2019-04-19 10:23:04 +02:00
|
|
|
s.deps = PathsForModuleSrc(ctx, s.properties.Deps)
|
|
|
|
s.src = PathForModuleSrc(ctx, "source_file")
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *sourceModule) Srcs() Paths {
|
|
|
|
return Paths{s.src}
|
2016-10-07 01:12:58 +02:00
|
|
|
}
|
2020-06-11 19:37:51 +02:00
|
|
|
|
|
|
|
type overrideSourceModule struct {
|
|
|
|
ModuleBase
|
|
|
|
OverrideModuleBase
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o *overrideSourceModule) GenerateAndroidBuildActions(_ ModuleContext) {
|
|
|
|
}
|
|
|
|
|
|
|
|
func newOverrideSourceModule() Module {
|
|
|
|
m := &overrideSourceModule{}
|
|
|
|
m.AddProperties(&sourceModuleProperties{})
|
|
|
|
|
|
|
|
InitAndroidArchModule(m, HostAndDeviceDefault, MultilibCommon)
|
|
|
|
InitOverrideModule(m)
|
|
|
|
return m
|
|
|
|
}
|