2016-10-07 07:12:58 +08: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-30 05:40:35 +08:00
|
|
|
"fmt"
|
2016-10-07 07:12:58 +08:00
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/google/blueprint"
|
|
|
|
)
|
|
|
|
|
|
|
|
var prebuiltsTests = []struct {
|
2020-07-07 09:20:40 +08:00
|
|
|
name string
|
|
|
|
replaceBp bool // modules is added to default bp boilerplate if false.
|
|
|
|
modules string
|
|
|
|
prebuilt []OsType
|
2016-10-07 07:12:58 +08:00
|
|
|
}{
|
|
|
|
{
|
|
|
|
name: "no prebuilt",
|
|
|
|
modules: `
|
|
|
|
source {
|
|
|
|
name: "bar",
|
|
|
|
}`,
|
2020-03-06 01:34:13 +08:00
|
|
|
prebuilt: nil,
|
2016-10-07 07:12:58 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "no source prebuilt not preferred",
|
|
|
|
modules: `
|
|
|
|
prebuilt {
|
|
|
|
name: "bar",
|
|
|
|
prefer: false,
|
2019-04-19 16:23:04 +08:00
|
|
|
srcs: ["prebuilt_file"],
|
2016-10-07 07:12:58 +08:00
|
|
|
}`,
|
2020-07-07 09:20:40 +08:00
|
|
|
prebuilt: []OsType{Android, BuildOs},
|
2016-10-07 07:12:58 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "no source prebuilt preferred",
|
|
|
|
modules: `
|
|
|
|
prebuilt {
|
|
|
|
name: "bar",
|
|
|
|
prefer: true,
|
2019-04-19 16:23:04 +08:00
|
|
|
srcs: ["prebuilt_file"],
|
2016-10-07 07:12:58 +08:00
|
|
|
}`,
|
2020-07-07 09:20:40 +08:00
|
|
|
prebuilt: []OsType{Android, BuildOs},
|
2016-10-07 07:12:58 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "prebuilt not preferred",
|
|
|
|
modules: `
|
|
|
|
source {
|
|
|
|
name: "bar",
|
|
|
|
}
|
2020-03-06 01:34:13 +08:00
|
|
|
|
2016-10-07 07:12:58 +08:00
|
|
|
prebuilt {
|
|
|
|
name: "bar",
|
|
|
|
prefer: false,
|
2019-04-19 16:23:04 +08:00
|
|
|
srcs: ["prebuilt_file"],
|
2016-10-07 07:12:58 +08:00
|
|
|
}`,
|
2020-03-06 01:34:13 +08:00
|
|
|
prebuilt: nil,
|
2016-10-07 07:12:58 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "prebuilt preferred",
|
|
|
|
modules: `
|
|
|
|
source {
|
|
|
|
name: "bar",
|
|
|
|
}
|
2020-03-06 01:34:13 +08:00
|
|
|
|
2016-10-07 07:12:58 +08:00
|
|
|
prebuilt {
|
|
|
|
name: "bar",
|
|
|
|
prefer: true,
|
2019-04-19 16:23:04 +08:00
|
|
|
srcs: ["prebuilt_file"],
|
2016-10-07 07:12:58 +08:00
|
|
|
}`,
|
2020-07-07 09:20:40 +08:00
|
|
|
prebuilt: []OsType{Android, BuildOs},
|
2016-10-07 07:12:58 +08:00
|
|
|
},
|
2016-10-15 06:38:43 +08:00
|
|
|
{
|
|
|
|
name: "prebuilt no file not preferred",
|
|
|
|
modules: `
|
|
|
|
source {
|
|
|
|
name: "bar",
|
|
|
|
}
|
2020-03-06 01:34:13 +08:00
|
|
|
|
2016-10-15 06:38:43 +08:00
|
|
|
prebuilt {
|
|
|
|
name: "bar",
|
|
|
|
prefer: false,
|
|
|
|
}`,
|
2020-03-06 01:34:13 +08:00
|
|
|
prebuilt: nil,
|
2016-10-15 06:38:43 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "prebuilt no file preferred",
|
|
|
|
modules: `
|
|
|
|
source {
|
|
|
|
name: "bar",
|
|
|
|
}
|
2020-03-06 01:34:13 +08:00
|
|
|
|
2016-10-15 06:38:43 +08:00
|
|
|
prebuilt {
|
|
|
|
name: "bar",
|
|
|
|
prefer: true,
|
|
|
|
}`,
|
2020-03-06 01:34:13 +08:00
|
|
|
prebuilt: nil,
|
2016-10-15 06:38:43 +08:00
|
|
|
},
|
2018-04-18 05:58:42 +08:00
|
|
|
{
|
|
|
|
name: "prebuilt file from filegroup preferred",
|
|
|
|
modules: `
|
|
|
|
filegroup {
|
|
|
|
name: "fg",
|
2019-04-19 16:23:04 +08:00
|
|
|
srcs: ["prebuilt_file"],
|
2018-04-18 05:58:42 +08:00
|
|
|
}
|
|
|
|
prebuilt {
|
|
|
|
name: "bar",
|
|
|
|
prefer: true,
|
|
|
|
srcs: [":fg"],
|
|
|
|
}`,
|
2020-07-07 09:20:40 +08:00
|
|
|
prebuilt: []OsType{Android, BuildOs},
|
2020-03-06 01:34:13 +08: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 09:20:40 +08:00
|
|
|
prebuilt: []OsType{Android},
|
2020-03-06 01:34:13 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "prebuilt file for host only",
|
|
|
|
modules: `
|
|
|
|
source {
|
|
|
|
name: "bar",
|
|
|
|
}
|
|
|
|
|
|
|
|
prebuilt {
|
|
|
|
name: "bar",
|
|
|
|
prefer: true,
|
|
|
|
target: {
|
2020-05-29 15:01:00 +08:00
|
|
|
host: {
|
2020-03-06 01:34:13 +08:00
|
|
|
srcs: ["prebuilt_file"],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}`,
|
2020-07-07 09:20:40 +08:00
|
|
|
prebuilt: []OsType{BuildOs},
|
2018-04-18 05:58:42 +08:00
|
|
|
},
|
2020-06-12 01:37:51 +08: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 09:20:40 +08: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-12 01:37:51 +08:00
|
|
|
},
|
2016-10-07 07:12:58 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func TestPrebuilts(t *testing.T) {
|
2019-12-14 12:41:13 +08:00
|
|
|
fs := map[string][]byte{
|
|
|
|
"prebuilt_file": nil,
|
|
|
|
"source_file": nil,
|
|
|
|
}
|
2016-10-15 06:38:43 +08:00
|
|
|
|
2016-10-07 07:12:58 +08:00
|
|
|
for _, test := range prebuiltsTests {
|
|
|
|
t.Run(test.name, func(t *testing.T) {
|
2020-07-07 09:20:40 +08:00
|
|
|
bp := test.modules
|
|
|
|
if !test.replaceBp {
|
|
|
|
bp = bp + `
|
|
|
|
source {
|
|
|
|
name: "foo",
|
|
|
|
deps: [":bar"],
|
|
|
|
}`
|
|
|
|
}
|
2020-03-06 01:34:13 +08:00
|
|
|
config := TestArchConfig(buildDir, nil, bp, fs)
|
2019-12-14 12:41:13 +08:00
|
|
|
|
2020-07-07 09:20:40 +08: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")
|
|
|
|
}
|
|
|
|
config.config.Targets[Windows] = []Target{
|
|
|
|
{Windows, Arch{ArchType: X86_64}, NativeBridgeDisabled, "", ""},
|
|
|
|
}
|
|
|
|
|
2020-03-06 01:34:13 +08:00
|
|
|
ctx := NewTestArchContext()
|
2020-01-14 20:42:08 +08:00
|
|
|
registerTestPrebuiltBuildComponents(ctx)
|
2019-11-23 07:25:03 +08:00
|
|
|
ctx.RegisterModuleType("filegroup", FileGroupFactory)
|
2019-12-14 12:41:13 +08:00
|
|
|
ctx.Register(config)
|
2016-10-07 07:12:58 +08:00
|
|
|
|
2019-12-14 12:41:13 +08:00
|
|
|
_, errs := ctx.ParseBlueprintsFiles("Android.bp")
|
2018-03-12 16:29:17 +08:00
|
|
|
FailIfErrored(t, errs)
|
2016-10-07 07:12:58 +08:00
|
|
|
_, errs = ctx.PrepareBuildActions(config)
|
2018-03-12 16:29:17 +08:00
|
|
|
FailIfErrored(t, errs)
|
2016-10-07 07:12:58 +08:00
|
|
|
|
2020-03-06 01:34:13 +08:00
|
|
|
for _, variant := range ctx.ModuleVariantsForTests("foo") {
|
|
|
|
foo := ctx.ModuleForTests("foo", variant)
|
2020-07-07 09:20:40 +08:00
|
|
|
t.Run(foo.Module().Target().Os.String(), func(t *testing.T) {
|
2020-03-06 01:34:13 +08:00
|
|
|
var dependsOnSourceModule, dependsOnPrebuiltModule bool
|
|
|
|
ctx.VisitDirectDeps(foo.Module(), func(m blueprint.Module) {
|
|
|
|
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 07:12:58 +08:00
|
|
|
|
2020-07-07 09:20:40 +08:00
|
|
|
moduleIsDisabled := !foo.Module().Enabled()
|
2020-03-06 01:34:13 +08:00
|
|
|
deps := foo.Module().(*sourceModule).deps
|
2020-07-07 09:20:40 +08: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-06 01:34:13 +08:00
|
|
|
}
|
2020-07-07 09:20:40 +08:00
|
|
|
|
2020-03-06 01:34:13 +08:00
|
|
|
var usingSourceFile, usingPrebuiltFile bool
|
2020-07-07 09:20:40 +08:00
|
|
|
if len(deps) > 0 && deps[0].String() == "source_file" {
|
2020-03-06 01:34:13 +08:00
|
|
|
usingSourceFile = true
|
|
|
|
}
|
2020-07-07 09:20:40 +08:00
|
|
|
if len(deps) > 0 && deps[0].String() == "prebuilt_file" {
|
2020-03-06 01:34:13 +08:00
|
|
|
usingPrebuiltFile = true
|
2017-03-18 04:14:32 +08:00
|
|
|
}
|
|
|
|
|
2020-03-06 01:34:13 +08:00
|
|
|
prebuilt := false
|
|
|
|
for _, os := range test.prebuilt {
|
2020-07-07 09:20:40 +08:00
|
|
|
if os == foo.Module().Target().Os {
|
2020-03-06 01:34:13 +08:00
|
|
|
prebuilt = true
|
|
|
|
}
|
|
|
|
}
|
2019-04-19 16:23:04 +08:00
|
|
|
|
2020-03-06 01:34:13 +08:00
|
|
|
if prebuilt {
|
2020-07-07 09:20:40 +08:00
|
|
|
if moduleIsDisabled {
|
|
|
|
t.Errorf("dependent module for prebuilt is disabled")
|
|
|
|
}
|
|
|
|
|
2020-03-06 01:34:13 +08:00
|
|
|
if !dependsOnPrebuiltModule {
|
|
|
|
t.Errorf("doesn't depend on prebuilt module")
|
|
|
|
}
|
|
|
|
if !usingPrebuiltFile {
|
|
|
|
t.Errorf("doesn't use prebuilt_file")
|
|
|
|
}
|
2016-10-07 07:12:58 +08:00
|
|
|
|
2020-03-06 01:34:13 +08:00
|
|
|
if dependsOnSourceModule {
|
|
|
|
t.Errorf("depends on source module")
|
|
|
|
}
|
|
|
|
if usingSourceFile {
|
|
|
|
t.Errorf("using source_file")
|
|
|
|
}
|
2020-07-07 09:20:40 +08:00
|
|
|
} else if !moduleIsDisabled {
|
2020-03-06 01:34:13 +08:00
|
|
|
if dependsOnPrebuiltModule {
|
|
|
|
t.Errorf("depends on prebuilt module")
|
|
|
|
}
|
|
|
|
if usingPrebuiltFile {
|
|
|
|
t.Errorf("using prebuilt_file")
|
|
|
|
}
|
2016-10-07 07:12:58 +08:00
|
|
|
|
2020-03-06 01:34:13 +08:00
|
|
|
if !dependsOnSourceModule {
|
|
|
|
t.Errorf("doesn't depend on source module")
|
|
|
|
}
|
|
|
|
if !usingSourceFile {
|
|
|
|
t.Errorf("doesn't use source_file")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
2016-10-07 07:12:58 +08:00
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-01-14 20:42:08 +08:00
|
|
|
func registerTestPrebuiltBuildComponents(ctx RegistrationContext) {
|
|
|
|
ctx.RegisterModuleType("prebuilt", newPrebuiltModule)
|
|
|
|
ctx.RegisterModuleType("source", newSourceModule)
|
2020-06-12 01:37:51 +08:00
|
|
|
ctx.RegisterModuleType("override_source", newOverrideSourceModule)
|
2020-01-14 20:42:08 +08:00
|
|
|
|
|
|
|
RegisterPrebuiltMutators(ctx)
|
2020-06-12 01:37:51 +08:00
|
|
|
ctx.PostDepsMutators(RegisterOverridePostDepsMutators)
|
2020-01-14 20:42:08 +08:00
|
|
|
}
|
|
|
|
|
2016-10-07 07:12:58 +08:00
|
|
|
type prebuiltModule struct {
|
|
|
|
ModuleBase
|
2017-08-03 02:05:49 +08:00
|
|
|
prebuilt Prebuilt
|
|
|
|
properties struct {
|
2020-03-06 01:34:13 +08:00
|
|
|
Srcs []string `android:"path,arch_variant"`
|
2017-08-03 02:05:49 +08:00
|
|
|
}
|
2019-04-19 16:23:04 +08:00
|
|
|
src Path
|
2016-10-07 07:12:58 +08:00
|
|
|
}
|
|
|
|
|
2017-06-24 06:06:31 +08:00
|
|
|
func newPrebuiltModule() Module {
|
2016-10-07 07:12:58 +08:00
|
|
|
m := &prebuiltModule{}
|
2017-08-03 02:05:49 +08:00
|
|
|
m.AddProperties(&m.properties)
|
|
|
|
InitPrebuiltModule(m, &m.properties.Srcs)
|
2020-03-06 01:34:13 +08:00
|
|
|
InitAndroidArchModule(m, HostAndDeviceDefault, MultilibCommon)
|
2017-06-24 06:06:31 +08:00
|
|
|
return m
|
2016-10-07 07:12:58 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func (p *prebuiltModule) Name() string {
|
|
|
|
return p.prebuilt.Name(p.ModuleBase.Name())
|
|
|
|
}
|
|
|
|
|
2019-04-19 16:23:04 +08:00
|
|
|
func (p *prebuiltModule) GenerateAndroidBuildActions(ctx ModuleContext) {
|
|
|
|
if len(p.properties.Srcs) >= 1 {
|
|
|
|
p.src = p.prebuilt.SingleSourcePath(ctx)
|
|
|
|
}
|
2016-10-07 07:12:58 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func (p *prebuiltModule) Prebuilt() *Prebuilt {
|
|
|
|
return &p.prebuilt
|
|
|
|
}
|
|
|
|
|
2019-05-30 05:40:35 +08: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 16:23:04 +08:00
|
|
|
}
|
|
|
|
|
2020-06-12 01:37:51 +08:00
|
|
|
type sourceModuleProperties struct {
|
|
|
|
Deps []string `android:"path,arch_variant"`
|
|
|
|
}
|
|
|
|
|
2016-10-07 07:12:58 +08:00
|
|
|
type sourceModule struct {
|
|
|
|
ModuleBase
|
2020-06-12 01:37:51 +08:00
|
|
|
OverridableModuleBase
|
|
|
|
|
|
|
|
properties sourceModuleProperties
|
2016-10-07 07:12:58 +08:00
|
|
|
dependsOnSourceModule, dependsOnPrebuiltModule bool
|
2019-04-19 16:23:04 +08:00
|
|
|
deps Paths
|
|
|
|
src Path
|
2016-10-07 07:12:58 +08:00
|
|
|
}
|
|
|
|
|
2017-06-24 06:06:31 +08:00
|
|
|
func newSourceModule() Module {
|
2016-10-07 07:12:58 +08:00
|
|
|
m := &sourceModule{}
|
2017-06-24 06:06:31 +08:00
|
|
|
m.AddProperties(&m.properties)
|
2020-03-06 01:34:13 +08:00
|
|
|
InitAndroidArchModule(m, HostAndDeviceDefault, MultilibCommon)
|
2020-06-12 01:37:51 +08:00
|
|
|
InitOverridableModule(m, nil)
|
2017-06-24 06:06:31 +08:00
|
|
|
return m
|
2016-10-07 07:12:58 +08:00
|
|
|
}
|
|
|
|
|
2020-06-12 01:37:51 +08:00
|
|
|
func (s *sourceModule) OverridablePropertiesDepsMutator(ctx BottomUpMutatorContext) {
|
2019-04-19 16:23:04 +08:00
|
|
|
// s.properties.Deps are annotated with android:path, so they are
|
|
|
|
// automatically added to the dependency by pathDeps mutator
|
2016-10-07 07:12:58 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func (s *sourceModule) GenerateAndroidBuildActions(ctx ModuleContext) {
|
2019-04-19 16:23:04 +08: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 07:12:58 +08:00
|
|
|
}
|
2020-06-12 01:37:51 +08: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
|
|
|
|
}
|