diff options
author | Colin Cross <ccross@android.com> | 2019-03-05 22:25:09 -0800 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2019-03-20 19:36:13 +0000 |
commit | 8a49795df1ed87a4889f267dbd8d28c5832bb897 (patch) | |
tree | e769fe1ab955ab4420d1edf68355c2ff9a4b470e /cc | |
parent | 07e51619a2752d6a36bd149c8938b5d7cae5baa7 (diff) | |
download | build_soong-8a49795df1ed87a4889f267dbd8d28c5832bb897.tar.gz build_soong-8a49795df1ed87a4889f267dbd8d28c5832bb897.tar.bz2 build_soong-8a49795df1ed87a4889f267dbd8d28c5832bb897.zip |
Replace ctx.ExpandSources with android.PathsForModuleSrc
Move the logic from ctx.ExpandSources into android.PathsForModuleSrc
and ctx.ExpandSource into android.PathForModuleSrc, and deprecate
them. When combined with the pathDepsMutator this will let all
properties that take source paths also take filegroups or genrule
outputs, as long as they are tagged with `android:"path"`.
Test: All soong tests
Change-Id: I01625e76b5da19240e9649bf26a014eeeafcab8f
Diffstat (limited to 'cc')
-rw-r--r-- | cc/compiler.go | 2 | ||||
-rw-r--r-- | cc/library.go | 4 | ||||
-rw-r--r-- | cc/ndk_headers.go | 4 | ||||
-rw-r--r-- | cc/test.go | 4 | ||||
-rw-r--r-- | cc/test_data_test.go | 2 |
5 files changed, 8 insertions, 8 deletions
diff --git a/cc/compiler.go b/cc/compiler.go index df396e81..0ab1f018 100644 --- a/cc/compiler.go +++ b/cc/compiler.go @@ -256,7 +256,7 @@ func addToModuleList(ctx ModuleContext, key android.OnceKey, module string) { func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps PathDeps) Flags { tc := ctx.toolchain() - compiler.srcsBeforeGen = ctx.ExpandSources(compiler.Properties.Srcs, compiler.Properties.Exclude_srcs) + compiler.srcsBeforeGen = android.PathsForModuleSrcExcludes(ctx, compiler.Properties.Srcs, compiler.Properties.Exclude_srcs) compiler.srcsBeforeGen = append(compiler.srcsBeforeGen, deps.GeneratedSources...) CheckBadCompilerFlags(ctx, "cflags", compiler.Properties.Cflags) diff --git a/cc/library.go b/cc/library.go index 5df51129..8b666ed1 100644 --- a/cc/library.go +++ b/cc/library.go @@ -450,11 +450,11 @@ func (library *libraryDecorator) compile(ctx ModuleContext, flags Flags, deps Pa buildFlags := flagsToBuilderFlags(flags) if library.static() { - srcs := ctx.ExpandSources(library.Properties.Static.Srcs, nil) + srcs := android.PathsForModuleSrc(ctx, library.Properties.Static.Srcs) objs = objs.Append(compileObjs(ctx, buildFlags, android.DeviceStaticLibrary, srcs, library.baseCompiler.pathDeps, library.baseCompiler.cFlagsDeps)) } else if library.shared() { - srcs := ctx.ExpandSources(library.Properties.Shared.Srcs, nil) + srcs := android.PathsForModuleSrc(ctx, library.Properties.Shared.Srcs) objs = objs.Append(compileObjs(ctx, buildFlags, android.DeviceSharedLibrary, srcs, library.baseCompiler.pathDeps, library.baseCompiler.cFlagsDeps)) } diff --git a/cc/ndk_headers.go b/cc/ndk_headers.go index 9653a17d..5e45c1ac 100644 --- a/cc/ndk_headers.go +++ b/cc/ndk_headers.go @@ -140,7 +140,7 @@ func (m *headerModule) GenerateAndroidBuildActions(ctx android.ModuleContext) { return } - srcFiles := ctx.ExpandSources(m.properties.Srcs, m.properties.Exclude_srcs) + srcFiles := android.PathsForModuleSrcExcludes(ctx, m.properties.Srcs, m.properties.Exclude_srcs) for _, header := range srcFiles { installDir := getHeaderInstallDir(ctx, header, String(m.properties.From), String(m.properties.To)) @@ -338,7 +338,7 @@ func (m *preprocessedHeadersModule) GenerateAndroidBuildActions(ctx android.Modu preprocessor := android.PathForModuleSrc(ctx, String(m.properties.Preprocessor)) m.licensePath = android.PathForModuleSrc(ctx, String(m.properties.License)) - srcFiles := ctx.ExpandSources(m.properties.Srcs, m.properties.Exclude_srcs) + srcFiles := android.PathsForModuleSrcExcludes(ctx, m.properties.Srcs, m.properties.Exclude_srcs) installDir := getCurrentIncludePath(ctx).Join(ctx, String(m.properties.To)) for _, src := range srcFiles { installPath := installDir.Join(ctx, src.Base()) @@ -253,7 +253,7 @@ func (test *testBinary) linkerFlags(ctx ModuleContext, flags Flags) Flags { } func (test *testBinary) install(ctx ModuleContext, file android.Path) { - test.data = ctx.ExpandSources(test.Properties.Data, nil) + test.data = android.PathsForModuleSrc(ctx, test.Properties.Data) optionsMap := map[string]string{} if Bool(test.testDecorator.Properties.Isolated) { optionsMap["not-shardable"] = "true" @@ -378,7 +378,7 @@ func (benchmark *benchmarkDecorator) linkerDeps(ctx DepsContext, deps Deps) Deps } func (benchmark *benchmarkDecorator) install(ctx ModuleContext, file android.Path) { - benchmark.data = ctx.ExpandSources(benchmark.Properties.Data, nil) + benchmark.data = android.PathsForModuleSrc(ctx, benchmark.Properties.Data) benchmark.testConfig = tradefed.AutoGenNativeBenchmarkTestConfig(ctx, benchmark.Properties.Test_config, benchmark.Properties.Test_config_template, benchmark.Properties.Test_suites) diff --git a/cc/test_data_test.go b/cc/test_data_test.go index 7ba244ef..21ea765e 100644 --- a/cc/test_data_test.go +++ b/cc/test_data_test.go @@ -178,5 +178,5 @@ func newTest() android.Module { } func (test *testDataTest) GenerateAndroidBuildActions(ctx android.ModuleContext) { - test.data = ctx.ExpandSources(test.Properties.Data, nil) + test.data = android.PathsForModuleSrc(ctx, test.Properties.Data) } |