Merge "Change module type text to HTML in build docs."
diff --git a/Android.bp b/Android.bp
index 94b4f7e..c0a1aeb 100644
--- a/Android.bp
+++ b/Android.bp
@@ -56,6 +56,7 @@
         "android/neverallow.go",
         "android/onceper.go",
         "android/package_ctx.go",
+        "android/path_properties.go",
         "android/paths.go",
         "android/prebuilt.go",
         "android/prebuilt_etc.go",
@@ -80,6 +81,7 @@
         "android/namespace_test.go",
         "android/neverallow_test.go",
         "android/onceper_test.go",
+        "android/path_properties_test.go",
         "android/paths_test.go",
         "android/prebuilt_test.go",
         "android/prebuilt_etc_test.go",
diff --git a/android/filegroup.go b/android/filegroup.go
index b284ce0..76af804 100644
--- a/android/filegroup.go
+++ b/android/filegroup.go
@@ -26,9 +26,9 @@
 
 type fileGroupProperties struct {
 	// srcs lists files that will be included in this filegroup
-	Srcs []string
+	Srcs []string `android:"path"`
 
-	Exclude_srcs []string
+	Exclude_srcs []string `android:"path"`
 
 	// The base path to the files.  May be used by other modules to determine which portion
 	// of the path to use.  For example, when a filegroup is used as data in a cc_test rule,
@@ -59,11 +59,6 @@
 	return module
 }
 
-func (fg *fileGroup) DepsMutator(ctx BottomUpMutatorContext) {
-	ExtractSourcesDeps(ctx, fg.properties.Srcs)
-	ExtractSourcesDeps(ctx, fg.properties.Exclude_srcs)
-}
-
 func (fg *fileGroup) GenerateAndroidBuildActions(ctx ModuleContext) {
 	fg.srcs = ctx.ExpandSourcesSubDir(fg.properties.Srcs, fg.properties.Exclude_srcs, String(fg.properties.Path))
 }
diff --git a/android/module.go b/android/module.go
index 218df22..c1f3e79 100644
--- a/android/module.go
+++ b/android/module.go
@@ -260,16 +260,16 @@
 	Recovery *bool
 
 	// init.rc files to be installed if this module is installed
-	Init_rc []string
+	Init_rc []string `android:"path"`
 
 	// VINTF manifest fragments to be installed if this module is installed
-	Vintf_fragments []string
+	Vintf_fragments []string `android:"path"`
 
 	// names of other modules to install if this module is installed
 	Required []string `android:"arch_variant"`
 
 	// relative path to a file to include in the list of notices for the device
-	Notice *string
+	Notice *string `android:"path"`
 
 	Dist struct {
 		// copy the output of this module to the $DIST_DIR when `dist` is specified on the
@@ -1358,6 +1358,8 @@
 
 // Adds necessary dependencies to satisfy filegroup or generated sources modules listed in srcFiles
 // using ":module" syntax, if any.
+//
+// Deprecated: tag the property with `android:"path"` instead.
 func ExtractSourcesDeps(ctx BottomUpMutatorContext, srcFiles []string) {
 	var deps []string
 	set := make(map[string]bool)
@@ -1378,6 +1380,8 @@
 
 // Adds necessary dependencies to satisfy filegroup or generated sources modules specified in s
 // using ":module" syntax, if any.
+//
+// Deprecated: tag the property with `android:"path"` instead.
 func ExtractSourceDeps(ctx BottomUpMutatorContext, s *string) {
 	if s != nil {
 		if m := SrcIsModule(*s); m != "" {
@@ -1390,14 +1394,14 @@
 	Srcs() Paths
 }
 
-// Returns a list of paths expanded from globs and modules referenced using ":module" syntax.
-// ExtractSourcesDeps must have already been called during the dependency resolution phase.
+// Returns a list of paths expanded from globs and modules referenced using ":module" syntax.  The property must
+// be tagged with `android:"path" to support automatic source module dependency resolution.
 func (ctx *androidModuleContext) ExpandSources(srcFiles, excludes []string) Paths {
 	return ctx.ExpandSourcesSubDir(srcFiles, excludes, "")
 }
 
-// Returns a single path expanded from globs and modules referenced using ":module" syntax.
-// ExtractSourceDeps must have already been called during the dependency resolution phase.
+// Returns a single path expanded from globs and modules referenced using ":module" syntax.  The property must
+// be tagged with `android:"path" to support automatic source module dependency resolution.
 func (ctx *androidModuleContext) ExpandSource(srcFile, prop string) Path {
 	srcFiles := ctx.ExpandSourcesSubDir([]string{srcFile}, nil, "")
 	if len(srcFiles) == 1 {
@@ -1416,8 +1420,8 @@
 }
 
 // Returns an optional single path expanded from globs and modules referenced using ":module" syntax if
-// the srcFile is non-nil.
-// ExtractSourceDeps must have already been called during the dependency resolution phase.
+// the srcFile is non-nil.  The property must be tagged with `android:"path" to support automatic source module
+// dependency resolution.
 func (ctx *androidModuleContext) ExpandOptionalSource(srcFile *string, prop string) OptionalPath {
 	if srcFile != nil {
 		return OptionalPathForPath(ctx.ExpandSource(*srcFile, prop))
@@ -1437,7 +1441,11 @@
 		if m := SrcIsModule(e); m != "" {
 			module := ctx.GetDirectDepWithTag(m, SourceDepTag)
 			if module == nil {
-				// Error will have been handled by ExtractSourcesDeps
+				if ctx.Config().AllowMissingDependencies() {
+					ctx.AddMissingDependencies([]string{m})
+				} else {
+					ctx.ModuleErrorf(`missing dependency on %q, is the property annotated with android:"path"?`, m)
+				}
 				continue
 			}
 			if srcProducer, ok := module.(SourceFileProducer); ok {
@@ -1454,7 +1462,11 @@
 		if m := SrcIsModule(s); m != "" {
 			module := ctx.GetDirectDepWithTag(m, SourceDepTag)
 			if module == nil {
-				// Error will have been handled by ExtractSourcesDeps
+				if ctx.Config().AllowMissingDependencies() {
+					ctx.AddMissingDependencies([]string{m})
+				} else {
+					ctx.ModuleErrorf(`missing dependency on %q, is the property annotated with android:"path"?`, m)
+				}
 				continue
 			}
 			if srcProducer, ok := module.(SourceFileProducer); ok {
diff --git a/android/mutator.go b/android/mutator.go
index 509b67f..6c9f17a 100644
--- a/android/mutator.go
+++ b/android/mutator.go
@@ -91,6 +91,7 @@
 }
 
 var postDeps = []RegisterMutatorFunc{
+	registerPathDepsMutator,
 	RegisterPrebuiltsPostDepsMutators,
 	registerNeverallowMutator,
 }
@@ -211,11 +212,6 @@
 func depsMutator(ctx BottomUpMutatorContext) {
 	if m, ok := ctx.Module().(Module); ok && m.Enabled() {
 		m.DepsMutator(ctx)
-
-		// For filegroup-based notice file references.
-		if m.base().commonProperties.Notice != nil {
-			ExtractSourceDeps(ctx, m.base().commonProperties.Notice)
-		}
 	}
 }
 
diff --git a/android/path_properties.go b/android/path_properties.go
new file mode 100644
index 0000000..5d89709
--- /dev/null
+++ b/android/path_properties.go
@@ -0,0 +1,123 @@
+// Copyright 2019 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 (
+	"fmt"
+	"reflect"
+
+	"github.com/google/blueprint/proptools"
+)
+
+func registerPathDepsMutator(ctx RegisterMutatorsContext) {
+	ctx.BottomUp("pathdeps", pathDepsMutator).Parallel()
+}
+
+// The pathDepsMutator automatically adds dependencies on any module that is listed with ":module" syntax in a
+// property that is tagged with android:"path".
+func pathDepsMutator(ctx BottomUpMutatorContext) {
+	m := ctx.Module().(Module)
+	if m == nil {
+		return
+	}
+
+	props := m.base().customizableProperties
+
+	for _, ps := range props {
+		pathProperties := pathPropertiesForPropertyStruct(ctx, ps)
+		pathProperties = FirstUniqueStrings(pathProperties)
+
+		var deps []string
+		for _, s := range pathProperties {
+			if m := SrcIsModule(s); m != "" {
+				deps = append(deps, m)
+			}
+		}
+
+		ctx.AddDependency(ctx.Module(), SourceDepTag, deps...)
+	}
+}
+
+// pathPropertiesForPropertyStruct uses the indexes of properties that are tagged with android:"path" to extract
+// all their values from a property struct, returning them as a single slice of strings..
+func pathPropertiesForPropertyStruct(ctx BottomUpMutatorContext, ps interface{}) []string {
+	v := reflect.ValueOf(ps)
+	if v.Kind() != reflect.Ptr || v.Elem().Kind() != reflect.Struct {
+		panic(fmt.Errorf("type %s is not a pointer to a struct", v.Type()))
+	}
+	if v.IsNil() {
+		return nil
+	}
+	v = v.Elem()
+
+	pathPropertyIndexes := pathPropertyIndexesForPropertyStruct(ps)
+
+	var ret []string
+
+	for _, i := range pathPropertyIndexes {
+		sv := fieldByIndex(v, i)
+		if !sv.IsValid() {
+			continue
+		}
+
+		if sv.Kind() == reflect.Ptr {
+			if sv.IsNil() {
+				continue
+			}
+			sv = sv.Elem()
+		}
+		switch sv.Kind() {
+		case reflect.String:
+			ret = append(ret, sv.String())
+		case reflect.Slice:
+			ret = append(ret, sv.Interface().([]string)...)
+		default:
+			panic(fmt.Errorf(`field %s in type %s has tag android:"path" but is not a string or slice of strings, it is a %s`,
+				v.Type().FieldByIndex(i).Name, v.Type(), sv.Type()))
+		}
+	}
+
+	return ret
+}
+
+// fieldByIndex is like reflect.Value.FieldByIndex, but returns an invalid reflect.Value when traversing a nil pointer
+// to a struct.
+func fieldByIndex(v reflect.Value, index []int) reflect.Value {
+	if len(index) == 1 {
+		return v.Field(index[0])
+	}
+	for _, x := range index {
+		if v.Kind() == reflect.Ptr {
+			if v.IsNil() {
+				return reflect.Value{}
+			}
+			v = v.Elem()
+		}
+		v = v.Field(x)
+	}
+	return v
+}
+
+var pathPropertyIndexesCache OncePer
+
+// pathPropertyIndexesForPropertyStruct returns a list of all of the indexes of properties in property struct type that
+// are tagged with android:"path".  Each index is a []int suitable for passing to reflect.Value.FieldByIndex.  The value
+// is cached in a global cache by type.
+func pathPropertyIndexesForPropertyStruct(ps interface{}) [][]int {
+	key := NewCustomOnceKey(reflect.TypeOf(ps))
+	return pathPropertyIndexesCache.Once(key, func() interface{} {
+		return proptools.PropertyIndexesWithTag(ps, "android", "path")
+	}).([][]int)
+}
diff --git a/android/path_properties_test.go b/android/path_properties_test.go
new file mode 100644
index 0000000..6471a3c
--- /dev/null
+++ b/android/path_properties_test.go
@@ -0,0 +1,120 @@
+// Copyright 2019 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 (
+	"io/ioutil"
+	"os"
+	"reflect"
+	"testing"
+)
+
+type pathDepsMutatorTestModule struct {
+	ModuleBase
+	props struct {
+		Foo string   `android:"path"`
+		Bar []string `android:"path"`
+		Baz *string  `android:"path"`
+		Qux string
+	}
+
+	sourceDeps []string
+}
+
+func pathDepsMutatorTestModuleFactory() Module {
+	module := &pathDepsMutatorTestModule{}
+	module.AddProperties(&module.props)
+	InitAndroidModule(module)
+	return module
+}
+
+func (p *pathDepsMutatorTestModule) GenerateAndroidBuildActions(ctx ModuleContext) {
+	ctx.VisitDirectDepsWithTag(SourceDepTag, func(dep Module) {
+		p.sourceDeps = append(p.sourceDeps, ctx.OtherModuleName(dep))
+	})
+}
+
+func TestPathDepsMutator(t *testing.T) {
+	tests := []struct {
+		name string
+		bp   string
+		deps []string
+	}{
+		{
+			name: "all",
+			bp: `
+			test {
+				name: "foo",
+				foo: ":a",
+				bar: [":b"],
+				baz: ":c",
+				qux: ":d",
+			}`,
+			deps: []string{"a", "b", "c"},
+		},
+	}
+
+	buildDir, err := ioutil.TempDir("", "soong_path_properties_test")
+	if err != nil {
+		t.Fatal(err)
+	}
+	defer os.RemoveAll(buildDir)
+
+	for _, test := range tests {
+		t.Run(test.name, func(t *testing.T) {
+			config := TestConfig(buildDir, nil)
+			ctx := NewTestContext()
+
+			ctx.RegisterModuleType("test", ModuleFactoryAdaptor(pathDepsMutatorTestModuleFactory))
+			ctx.RegisterModuleType("filegroup", ModuleFactoryAdaptor(FileGroupFactory))
+
+			bp := test.bp + `
+				filegroup {
+					name: "a",
+				}
+				
+				filegroup {
+					name: "b",
+				}
+    	
+				filegroup {
+					name: "c",
+				}
+    	
+				filegroup {
+					name: "d",
+				}
+			`
+
+			mockFS := map[string][]byte{
+				"Android.bp": []byte(bp),
+			}
+
+			ctx.MockFileSystem(mockFS)
+
+			ctx.Register()
+			_, errs := ctx.ParseFileList(".", []string{"Android.bp"})
+			FailIfErrored(t, errs)
+			_, errs = ctx.PrepareBuildActions(config)
+			FailIfErrored(t, errs)
+
+			m := ctx.ModuleForTests("foo", "").Module().(*pathDepsMutatorTestModule)
+
+			if g, w := m.sourceDeps, test.deps; !reflect.DeepEqual(g, w) {
+				t.Errorf("want deps %q, got %q", w, g)
+			}
+		})
+	}
+}
diff --git a/android/paths_test.go b/android/paths_test.go
index 20a00a0..cadf371 100644
--- a/android/paths_test.go
+++ b/android/paths_test.go
@@ -17,6 +17,8 @@
 import (
 	"errors"
 	"fmt"
+	"io/ioutil"
+	"os"
 	"reflect"
 	"strings"
 	"testing"
@@ -692,6 +694,147 @@
 	}
 }
 
+type expandSourcesTestModule struct {
+	ModuleBase
+	props struct {
+		Srcs         []string `android:"path"`
+		Exclude_srcs []string `android:"path"`
+	}
+
+	srcs Paths
+	rels []string
+}
+
+func expandSourcesTestModuleFactory() Module {
+	module := &expandSourcesTestModule{}
+	module.AddProperties(&module.props)
+	InitAndroidModule(module)
+	return module
+}
+
+func (p *expandSourcesTestModule) GenerateAndroidBuildActions(ctx ModuleContext) {
+	p.srcs = ctx.ExpandSources(p.props.Srcs, p.props.Exclude_srcs)
+
+	for _, src := range p.srcs {
+		p.rels = append(p.rels, src.Rel())
+	}
+}
+
+func TestExpandSources(t *testing.T) {
+	tests := []struct {
+		name string
+		bp   string
+		srcs []string
+		rels []string
+	}{
+		{
+			name: "path",
+			bp: `
+			test {
+				name: "foo",
+				srcs: ["src/b"],
+			}`,
+			srcs: []string{"foo/src/b"},
+			rels: []string{"src/b"},
+		},
+		{
+			name: "glob",
+			bp: `
+			test {
+				name: "foo",
+				srcs: [
+					"src/*",
+					"src/e/*",
+				],
+			}`,
+			srcs: []string{"foo/src/b", "foo/src/c", "foo/src/d", "foo/src/e/e"},
+			rels: []string{"src/b", "src/c", "src/d", "src/e/e"},
+		},
+		{
+			name: "recursive glob",
+			bp: `
+			test {
+				name: "foo",
+				srcs: ["src/**/*"],
+			}`,
+			srcs: []string{"foo/src/b", "foo/src/c", "foo/src/d", "foo/src/e/e"},
+			rels: []string{"src/b", "src/c", "src/d", "src/e/e"},
+		},
+		{
+			name: "filegroup",
+			bp: `
+			test {
+				name: "foo",
+				srcs: [":a"],
+			}`,
+			srcs: []string{"fg/src/a"},
+			rels: []string{"src/a"},
+		},
+		{
+			name: "special characters glob",
+			bp: `
+			test {
+				name: "foo",
+				srcs: ["src_special/*"],
+			}`,
+			srcs: []string{"foo/src_special/$"},
+			rels: []string{"src_special/$"},
+		},
+	}
+
+	buildDir, err := ioutil.TempDir("", "soong_path_for_module_src_test")
+	if err != nil {
+		t.Fatal(err)
+	}
+	defer os.RemoveAll(buildDir)
+
+	for _, test := range tests {
+		t.Run(test.name, func(t *testing.T) {
+			config := TestConfig(buildDir, nil)
+			ctx := NewTestContext()
+
+			ctx.RegisterModuleType("test", ModuleFactoryAdaptor(expandSourcesTestModuleFactory))
+			ctx.RegisterModuleType("filegroup", ModuleFactoryAdaptor(FileGroupFactory))
+
+			fgBp := `
+				filegroup {
+					name: "a",
+					srcs: ["src/a"],
+				}
+			`
+
+			mockFS := map[string][]byte{
+				"fg/Android.bp":     []byte(fgBp),
+				"foo/Android.bp":    []byte(test.bp),
+				"fg/src/a":          nil,
+				"foo/src/b":         nil,
+				"foo/src/c":         nil,
+				"foo/src/d":         nil,
+				"foo/src/e/e":       nil,
+				"foo/src_special/$": nil,
+			}
+
+			ctx.MockFileSystem(mockFS)
+
+			ctx.Register()
+			_, errs := ctx.ParseFileList(".", []string{"fg/Android.bp", "foo/Android.bp"})
+			FailIfErrored(t, errs)
+			_, errs = ctx.PrepareBuildActions(config)
+			FailIfErrored(t, errs)
+
+			m := ctx.ModuleForTests("foo", "").Module().(*expandSourcesTestModule)
+
+			if g, w := m.srcs.Strings(), test.srcs; !reflect.DeepEqual(g, w) {
+				t.Errorf("want srcs %q, got %q", w, g)
+			}
+
+			if g, w := m.rels, test.rels; !reflect.DeepEqual(g, w) {
+				t.Errorf("want rels %q, got %q", w, g)
+			}
+		})
+	}
+}
+
 func ExampleOutputPath_ReplaceExtension() {
 	ctx := &configErrorWrapper{
 		config: TestConfig("out", nil),
diff --git a/android/prebuilt.go b/android/prebuilt.go
index 47c5cf5..ea4870d 100644
--- a/android/prebuilt.go
+++ b/android/prebuilt.go
@@ -137,9 +137,6 @@
 		} else {
 			m.SkipInstall()
 		}
-		if len(*p.srcs) > 0 {
-			ExtractSourceDeps(ctx, &(*p.srcs)[0])
-		}
 	}
 }
 
diff --git a/android/prebuilt_etc.go b/android/prebuilt_etc.go
index c58cc4f..6c8fb31 100644
--- a/android/prebuilt_etc.go
+++ b/android/prebuilt_etc.go
@@ -35,7 +35,7 @@
 
 type prebuiltEtcProperties struct {
 	// Source file of this prebuilt.
-	Src *string `android:"arch_variant"`
+	Src *string `android:"path,arch_variant"`
 
 	// optional subdirectory under which this file is installed into
 	Sub_dir *string `android:"arch_variant"`
@@ -85,9 +85,6 @@
 	if p.properties.Src == nil {
 		ctx.PropertyErrorf("src", "missing prebuilt source file")
 	}
-
-	// To support ":modulename" in src
-	ExtractSourceDeps(ctx, p.properties.Src)
 }
 
 func (p *PrebuiltEtc) SourceFilePath(ctx ModuleContext) Path {
diff --git a/android/prebuilt_test.go b/android/prebuilt_test.go
index b30ca1a..319c15d 100644
--- a/android/prebuilt_test.go
+++ b/android/prebuilt_test.go
@@ -196,7 +196,7 @@
 	ModuleBase
 	prebuilt   Prebuilt
 	properties struct {
-		Srcs []string
+		Srcs []string `android:"path"`
 	}
 }
 
diff --git a/android/sh_binary.go b/android/sh_binary.go
index 3915193..eaedc9f 100644
--- a/android/sh_binary.go
+++ b/android/sh_binary.go
@@ -32,7 +32,7 @@
 
 type shBinaryProperties struct {
 	// Source file of this prebuilt.
-	Src *string `android:"arch_variant"`
+	Src *string `android:"path,arch_variant"`
 
 	// optional subdirectory under which this file is installed into
 	Sub_dir *string `android:"arch_variant"`
@@ -61,9 +61,6 @@
 	if s.properties.Src == nil {
 		ctx.PropertyErrorf("src", "missing prebuilt source file")
 	}
-
-	// To support ":modulename" in src
-	ExtractSourceDeps(ctx, s.properties.Src)
 }
 
 func (s *ShBinary) SourceFilePath(ctx ModuleContext) Path {
diff --git a/android/testing.go b/android/testing.go
index b4008af..7f443a3 100644
--- a/android/testing.go
+++ b/android/testing.go
@@ -37,6 +37,8 @@
 
 	ctx.SetNameInterface(nameResolver)
 
+	ctx.postDeps = append(ctx.postDeps, registerPathDepsMutator)
+
 	return ctx
 }
 
diff --git a/androidmk/cmd/androidmk/androidmk_test.go b/androidmk/cmd/androidmk/androidmk_test.go
index 98d4506..2976a0c 100644
--- a/androidmk/cmd/androidmk/androidmk_test.go
+++ b/androidmk/cmd/androidmk/androidmk_test.go
@@ -1075,6 +1075,25 @@
 // Comment line 2
 `,
 	},
+	{
+		desc: "Merge with variable reference",
+		in: `
+include $(CLEAR_VARS)
+LOCAL_MODULE := foo
+LOCAL_STATIC_ANDROID_LIBRARIES := $(FOO)
+LOCAL_STATIC_JAVA_LIBRARIES := javalib
+LOCAL_JAVA_RESOURCE_DIRS := $(FOO)
+include $(BUILD_PACKAGE)
+`,
+		expected: `
+android_app {
+	name: "foo",
+	static_libs: FOO,
+	static_libs: ["javalib"],
+	java_resource_dirs: FOO,
+}
+`,
+	},
 }
 
 func TestEndToEnd(t *testing.T) {
diff --git a/apex/apex.go b/apex/apex.go
index f72eef3..341968b 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -212,11 +212,11 @@
 type apexBundleProperties struct {
 	// Json manifest file describing meta info of this APEX bundle. Default:
 	// "apex_manifest.json"
-	Manifest *string
+	Manifest *string `android:"path"`
 
 	// AndroidManifest.xml file used for the zip container of this APEX bundle.
 	// If unspecified, a default one is automatically generated.
-	AndroidManifest *string
+	AndroidManifest *string `android:"path"`
 
 	// Determines the file contexts file for setting security context to each file in this APEX bundle.
 	// Specifically, when this is set to <value>, /system/sepolicy/apex/<value>_file_contexts file is
@@ -525,14 +525,6 @@
 	if cert != "" {
 		ctx.AddDependency(ctx.Module(), certificateTag, cert)
 	}
-
-	if String(a.properties.Manifest) != "" {
-		android.ExtractSourceDeps(ctx, a.properties.Manifest)
-	}
-
-	if String(a.properties.AndroidManifest) != "" {
-		android.ExtractSourceDeps(ctx, a.properties.AndroidManifest)
-	}
 }
 
 func (a *apexBundle) getCertString(ctx android.BaseContext) string {
diff --git a/bpf/bpf.go b/bpf/bpf.go
index 4b0d510..01e98f1 100644
--- a/bpf/bpf.go
+++ b/bpf/bpf.go
@@ -44,7 +44,7 @@
 )
 
 type BpfProperties struct {
-	Srcs         []string
+	Srcs         []string `android:"path"`
 	Cflags       []string
 	Include_dirs []string
 }
@@ -95,10 +95,6 @@
 	}
 }
 
-func (bpf *bpf) DepsMutator(ctx android.BottomUpMutatorContext) {
-	android.ExtractSourcesDeps(ctx, bpf.properties.Srcs)
-}
-
 func (bpf *bpf) AndroidMk() android.AndroidMkData {
 	return android.AndroidMkData{
 		Custom: func(w io.Writer, name, prefix, moduleDir string, data android.AndroidMkData) {
diff --git a/bpfix/bpfix/bpfix.go b/bpfix/bpfix/bpfix.go
index ba6435e..706c0ec 100644
--- a/bpfix/bpfix/bpfix.go
+++ b/bpfix/bpfix/bpfix.go
@@ -786,6 +786,14 @@
 }
 
 func mergeProperties(a, b *parser.Property, buf []byte, patchlist *parser.PatchList) error {
+	// The value of one of the properties may be a variable reference with no type assigned
+	// Bail out in this case. Soong will notice duplicate entries and will tell to merge them.
+	if _, isVar := a.Value.(*parser.Variable); isVar {
+		return nil
+	}
+	if _, isVar := b.Value.(*parser.Variable); isVar {
+		return nil
+	}
 	if a.Value.Type() != b.Value.Type() {
 		return fmt.Errorf("type mismatch when merging properties %q: %s and %s", a.Name, a.Value.Type(), b.Value.Type())
 	}
diff --git a/cc/compiler.go b/cc/compiler.go
index 53a60c7..df396e8 100644
--- a/cc/compiler.go
+++ b/cc/compiler.go
@@ -31,11 +31,11 @@
 	// list of source files used to compile the C/C++ module.  May be .c, .cpp, or .S files.
 	// srcs may reference the outputs of other modules that produce source files like genrule
 	// or filegroup using the syntax ":module".
-	Srcs []string `android:"arch_variant"`
+	Srcs []string `android:"path,arch_variant"`
 
 	// list of source files that should not be used to build the C/C++ module.
 	// This is most useful in the arch/multilib variants to remove non-common files
-	Exclude_srcs []string `android:"arch_variant"`
+	Exclude_srcs []string `android:"path,arch_variant"`
 
 	// list of module-specific flags that will be used for C and C++ compiles.
 	Cflags []string `android:"arch_variant"`
@@ -136,11 +136,11 @@
 		Vendor struct {
 			// list of source files that should only be used in the
 			// vendor variant of the C/C++ module.
-			Srcs []string
+			Srcs []string `android:"path"`
 
 			// list of source files that should not be used to
 			// build the vendor variant of the C/C++ module.
-			Exclude_srcs []string
+			Exclude_srcs []string `android:"path"`
 
 			// List of additional cflags that should be used to build the vendor
 			// variant of the C/C++ module.
@@ -149,11 +149,11 @@
 		Recovery struct {
 			// list of source files that should only be used in the
 			// recovery variant of the C/C++ module.
-			Srcs []string
+			Srcs []string `android:"path"`
 
 			// list of source files that should not be used to
 			// build the recovery variant of the C/C++ module.
-			Exclude_srcs []string
+			Exclude_srcs []string `android:"path"`
 
 			// List of additional cflags that should be used to build the recovery
 			// variant of the C/C++ module.
@@ -221,9 +221,6 @@
 	deps.GeneratedSources = append(deps.GeneratedSources, compiler.Properties.Generated_sources...)
 	deps.GeneratedHeaders = append(deps.GeneratedHeaders, compiler.Properties.Generated_headers...)
 
-	android.ExtractSourcesDeps(ctx, compiler.Properties.Srcs)
-	android.ExtractSourcesDeps(ctx, compiler.Properties.Exclude_srcs)
-
 	if compiler.hasSrcExt(".proto") {
 		deps = protoDeps(ctx, deps, &compiler.Proto, Bool(compiler.Properties.Proto.Static))
 	}
diff --git a/cc/library.go b/cc/library.go
index cf18ebf..71a9df6 100644
--- a/cc/library.go
+++ b/cc/library.go
@@ -30,8 +30,8 @@
 )
 
 type StaticSharedLibraryProperties struct {
-	Srcs   []string `android:"arch_variant"`
-	Cflags []string `android:"arch_variant"`
+	Srcs   []string `android:"path,arch_variant"`
+	Cflags []string `android:"path,arch_variant"`
 
 	Enabled            *bool    `android:"arch_variant"`
 	Whole_static_libs  []string `android:"arch_variant"`
@@ -48,11 +48,11 @@
 	Shared StaticSharedLibraryProperties `android:"arch_variant"`
 
 	// local file name to pass to the linker as -unexported_symbols_list
-	Unexported_symbols_list *string `android:"arch_variant"`
+	Unexported_symbols_list *string `android:"path,arch_variant"`
 	// local file name to pass to the linker as -force_symbols_not_weak_list
-	Force_symbols_not_weak_list *string `android:"arch_variant"`
+	Force_symbols_not_weak_list *string `android:"path,arch_variant"`
 	// local file name to pass to the linker as -force_symbols_weak_list
-	Force_symbols_weak_list *string `android:"arch_variant"`
+	Force_symbols_weak_list *string `android:"path,arch_variant"`
 
 	// rename host libraries to prevent overlap with system installed libraries
 	Unique_host_soname *bool
@@ -77,7 +77,7 @@
 	Stubs struct {
 		// Relative path to the symbol map. The symbol map provides the list of
 		// symbols that are exported for stubs variant of this library.
-		Symbol_file *string
+		Symbol_file *string `android:"path"`
 
 		// List versions to generate stubs libs for.
 		Versions []string
@@ -97,7 +97,7 @@
 	Header_abi_checker struct {
 		// Path to a symbol file that specifies the symbols to be included in the generated
 		// ABI dump file
-		Symbol_file *string
+		Symbol_file *string `android:"path"`
 
 		// Symbol versions that should be ignored from the symbol file
 		Exclude_symbol_versions []string
@@ -526,12 +526,6 @@
 func (library *libraryDecorator) compilerDeps(ctx DepsContext, deps Deps) Deps {
 	deps = library.baseCompiler.compilerDeps(ctx, deps)
 
-	if library.static() {
-		android.ExtractSourcesDeps(ctx, library.Properties.Static.Srcs)
-	} else if library.shared() {
-		android.ExtractSourcesDeps(ctx, library.Properties.Shared.Srcs)
-	}
-
 	return deps
 }
 
@@ -596,10 +590,6 @@
 		deps.ReexportStaticLibHeaders = removeListFromList(deps.ReexportStaticLibHeaders, library.baseLinker.Properties.Target.Recovery.Exclude_static_libs)
 	}
 
-	android.ExtractSourceDeps(ctx, library.Properties.Unexported_symbols_list)
-	android.ExtractSourceDeps(ctx, library.Properties.Force_symbols_not_weak_list)
-	android.ExtractSourceDeps(ctx, library.Properties.Force_symbols_weak_list)
-
 	return deps
 }
 
diff --git a/cc/linker.go b/cc/linker.go
index 9d4a0e8..fd958ba 100644
--- a/cc/linker.go
+++ b/cc/linker.go
@@ -149,7 +149,7 @@
 	Pack_relocations *bool `android:"arch_variant"`
 
 	// local file name to pass to the linker as --version_script
-	Version_script *string `android:"arch_variant"`
+	Version_script *string `android:"path,arch_variant"`
 
 	// Local file name to pass to the linker as --symbol-ordering-file
 	Symbol_ordering_file *string `android:"arch_variant"`
@@ -281,16 +281,6 @@
 		deps.LateStaticLibs = append(deps.LateStaticLibs, "libwinpthread")
 	}
 
-	// Version_script is not needed when linking stubs lib where the version
-	// script is created from the symbol map file.
-	if !linker.dynamicProperties.BuildStubs {
-		android.ExtractSourceDeps(ctx, linker.Properties.Version_script)
-		android.ExtractSourceDeps(ctx,
-			linker.Properties.Target.Vendor.Version_script)
-	}
-
-	android.ExtractSourceDeps(ctx, linker.Properties.Symbol_ordering_file)
-
 	return deps
 }
 
diff --git a/cc/ndk_headers.go b/cc/ndk_headers.go
index c0ce9c3..2024180 100644
--- a/cc/ndk_headers.go
+++ b/cc/ndk_headers.go
@@ -70,13 +70,13 @@
 	To *string
 
 	// List of headers to install. Glob compatible. Common case is "include/**/*.h".
-	Srcs []string
+	Srcs []string `android:"path"`
 
 	// Source paths that should be excluded from the srcs glob.
-	Exclude_srcs []string
+	Exclude_srcs []string `android:"path"`
 
 	// Path to the NOTICE file associated with the headers.
-	License *string
+	License *string `android:"path"`
 
 	// True if this API is not yet ready to be shipped in the NDK. It will be
 	// available in the platform for testing, but will be excluded from the
diff --git a/cc/prebuilt.go b/cc/prebuilt.go
index 686a85a..4c893d4 100644
--- a/cc/prebuilt.go
+++ b/cc/prebuilt.go
@@ -33,7 +33,7 @@
 	android.Prebuilt
 
 	properties struct {
-		Srcs []string `android:"arch_variant"`
+		Srcs []string `android:"path,arch_variant"`
 
 		// Check the prebuilt ELF files (e.g. DT_SONAME, DT_NEEDED, resolution of undefined
 		// symbols, etc), default true.
diff --git a/cc/test.go b/cc/test.go
index 3ecc419..f0274e9 100644
--- a/cc/test.go
+++ b/cc/test.go
@@ -42,7 +42,7 @@
 
 	// list of files or filegroup modules that provide data that should be installed alongside
 	// the test
-	Data []string
+	Data []string `android:"path"`
 
 	// list of compatibility suites (for example "cts", "vts") that the module should be
 	// installed into.
@@ -50,11 +50,11 @@
 
 	// the name of the test configuration (for example "AndroidTest.xml") that should be
 	// installed with the module.
-	Test_config *string `android:"arch_variant"`
+	Test_config *string `android:"path,arch_variant"`
 
 	// the name of the test configuration template (for example "AndroidTestTemplate.xml") that
 	// should be installed with the module.
-	Test_config_template *string `android:"arch_variant"`
+	Test_config_template *string `android:"path,arch_variant"`
 }
 
 func init() {
@@ -241,10 +241,6 @@
 }
 
 func (test *testBinary) linkerDeps(ctx DepsContext, deps Deps) Deps {
-	android.ExtractSourcesDeps(ctx, test.Properties.Data)
-	android.ExtractSourceDeps(ctx, test.Properties.Test_config)
-	android.ExtractSourceDeps(ctx, test.Properties.Test_config_template)
-
 	deps = test.testDecorator.linkerDeps(ctx, deps)
 	deps = test.binaryDecorator.linkerDeps(ctx, deps)
 	return deps
@@ -338,7 +334,7 @@
 type BenchmarkProperties struct {
 	// list of files or filegroup modules that provide data that should be installed alongside
 	// the test
-	Data []string
+	Data []string `android:"path"`
 
 	// list of compatibility suites (for example "cts", "vts") that the module should be
 	// installed into.
@@ -346,11 +342,11 @@
 
 	// the name of the test configuration (for example "AndroidTest.xml") that should be
 	// installed with the module.
-	Test_config *string `android:"arch_variant"`
+	Test_config *string `android:"path,arch_variant"`
 
 	// the name of the test configuration template (for example "AndroidTestTemplate.xml") that
 	// should be installed with the module.
-	Test_config_template *string `android:"arch_variant"`
+	Test_config_template *string `android:"path,arch_variant"`
 }
 
 type benchmarkDecorator struct {
@@ -376,10 +372,6 @@
 }
 
 func (benchmark *benchmarkDecorator) linkerDeps(ctx DepsContext, deps Deps) Deps {
-	android.ExtractSourcesDeps(ctx, benchmark.Properties.Data)
-	android.ExtractSourceDeps(ctx, benchmark.Properties.Test_config)
-	android.ExtractSourceDeps(ctx, benchmark.Properties.Test_config_template)
-
 	deps = benchmark.binaryDecorator.linkerDeps(ctx, deps)
 	deps.StaticLibs = append(deps.StaticLibs, "libgoogle-benchmark")
 	return deps
diff --git a/cc/test_data_test.go b/cc/test_data_test.go
index eead25b..7ba244e 100644
--- a/cc/test_data_test.go
+++ b/cc/test_data_test.go
@@ -166,7 +166,7 @@
 	android.ModuleBase
 	data       android.Paths
 	Properties struct {
-		Data []string
+		Data []string `android:"path"`
 	}
 }
 
@@ -177,10 +177,6 @@
 	return m
 }
 
-func (test *testDataTest) DepsMutator(ctx android.BottomUpMutatorContext) {
-	android.ExtractSourcesDeps(ctx, test.Properties.Data)
-}
-
 func (test *testDataTest) GenerateAndroidBuildActions(ctx android.ModuleContext) {
 	test.data = ctx.ExpandSources(test.Properties.Data, nil)
 }
diff --git a/genrule/genrule.go b/genrule/genrule.go
index 47d88c3..f265eb6 100644
--- a/genrule/genrule.go
+++ b/genrule/genrule.go
@@ -83,16 +83,16 @@
 	Tools []string
 
 	// Local file that is used as the tool
-	Tool_files []string
+	Tool_files []string `android:"path"`
 
 	// List of directories to export generated headers from
 	Export_include_dirs []string
 
 	// list of input files
-	Srcs []string `android:"arch_variant"`
+	Srcs []string `android:"path,arch_variant"`
 
 	// input files to exclude
-	Exclude_srcs []string `android:"arch_variant"`
+	Exclude_srcs []string `android:"path,arch_variant"`
 }
 
 type Module struct {
@@ -143,8 +143,6 @@
 }
 
 func (g *Module) DepsMutator(ctx android.BottomUpMutatorContext) {
-	android.ExtractSourcesDeps(ctx, g.properties.Srcs)
-	android.ExtractSourcesDeps(ctx, g.properties.Tool_files)
 	if g, ok := ctx.Module().(*Module); ok {
 		for _, tool := range g.properties.Tools {
 			tag := hostToolDependencyTag{label: tool}
diff --git a/java/aar.go b/java/aar.go
index c30632e..3f13e59 100644
--- a/java/aar.go
+++ b/java/aar.go
@@ -64,10 +64,10 @@
 	Resource_dirs []string
 
 	// list of zip files containing Android resources.
-	Resource_zips []string
+	Resource_zips []string `android:"path"`
 
 	// path to AndroidManifest.xml.  If unset, defaults to "AndroidManifest.xml".
-	Manifest *string
+	Manifest *string `android:"path"`
 }
 
 type aapt struct {
@@ -180,8 +180,6 @@
 	if sdkDep.frameworkResModule != "" {
 		ctx.AddVariationDependencies(nil, frameworkResTag, sdkDep.frameworkResModule)
 	}
-
-	android.ExtractSourcesDeps(ctx, a.aaptProperties.Resource_zips)
 }
 
 func (a *aapt) buildActions(ctx android.ModuleContext, sdkContext sdkContext, extraLinkFlags ...string) {
@@ -406,7 +404,7 @@
 //
 
 type AARImportProperties struct {
-	Aars []string
+	Aars []string `android:"path"`
 
 	Sdk_version     *string
 	Min_sdk_version *string
diff --git a/java/app.go b/java/app.go
index 2ff6c98..8a422fc 100644
--- a/java/app.go
+++ b/java/app.go
@@ -459,9 +459,6 @@
 }
 
 func (a *AndroidTest) DepsMutator(ctx android.BottomUpMutatorContext) {
-	android.ExtractSourceDeps(ctx, a.testProperties.Test_config)
-	android.ExtractSourceDeps(ctx, a.testProperties.Test_config_template)
-	android.ExtractSourcesDeps(ctx, a.testProperties.Data)
 	a.AndroidApp.DepsMutator(ctx)
 	if a.appTestProperties.Instrumentation_for != nil {
 		// The android_app dependency listed in instrumentation_for needs to be added to the classpath for javac,
diff --git a/java/droiddoc.go b/java/droiddoc.go
index 5611791..777cd9c 100644
--- a/java/droiddoc.go
+++ b/java/droiddoc.go
@@ -157,7 +157,7 @@
 type JavadocProperties struct {
 	// list of source files used to compile the Java module.  May be .java, .logtags, .proto,
 	// or .aidl files.
-	Srcs []string `android:"arch_variant"`
+	Srcs []string `android:"path,arch_variant"`
 
 	// list of directories rooted at the Android.bp file that will
 	// be added to the search paths for finding source files when passing package names.
@@ -166,7 +166,7 @@
 	// list of source files that should not be used to build the Java module.
 	// This is most useful in the arch/multilib variants to remove non-common files
 	// filegroup or genrule can be included within this property.
-	Exclude_srcs []string `android:"arch_variant"`
+	Exclude_srcs []string `android:"path,arch_variant"`
 
 	// list of java libraries that will be in the classpath.
 	Libs []string `android:"arch_variant"`
@@ -205,7 +205,7 @@
 	Java_version *string
 
 	// local files that are used within user customized droiddoc options.
-	Arg_files []string
+	Arg_files []string `android:"path"`
 
 	// user customized droiddoc args.
 	// Available variables for substitution:
@@ -220,12 +220,12 @@
 type ApiToCheck struct {
 	// path to the API txt file that the new API extracted from source code is checked
 	// against. The path can be local to the module or from other module (via :module syntax).
-	Api_file *string
+	Api_file *string `android:"path"`
 
 	// path to the API txt file that the new @removed API extractd from source code is
 	// checked against. The path can be local to the module or from other module (via
 	// :module syntax).
-	Removed_api_file *string
+	Removed_api_file *string `android:"path"`
 
 	// Arguments to the apicheck tool.
 	Args *string
@@ -243,11 +243,11 @@
 
 	// proofread file contains all of the text content of the javadocs concatenated into one file,
 	// suitable for spell-checking and other goodness.
-	Proofread_file *string
+	Proofread_file *string `android:"path"`
 
 	// a todo file lists the program elements that are missing documentation.
 	// At some point, this might be improved to show more warnings.
-	Todo_file *string
+	Todo_file *string `android:"path"`
 
 	// directory under current module source that provide additional resources (images).
 	Resourcesdir *string
@@ -260,14 +260,14 @@
 	Write_sdk_values *bool
 
 	// index.html under current module will be copied to docs out dir, if not null.
-	Static_doc_index_redirect *string
+	Static_doc_index_redirect *string `android:"path"`
 
 	// source.properties under current module will be copied to docs out dir, if not null.
-	Static_doc_properties *string
+	Static_doc_properties *string `android:"path"`
 
 	// a list of files under current module source dir which contains known tags in Java sources.
 	// filegroup or genrule can be included within this property.
-	Knowntags []string
+	Knowntags []string `android:"path"`
 
 	// the tag name used to distinguish if the API files belong to public/system/test.
 	Api_tag_name *string
@@ -360,7 +360,7 @@
 	}
 
 	// user can specify the version of previous released API file in order to do compatibility check.
-	Previous_api *string
+	Previous_api *string `android:"path"`
 
 	// is set to true, Metalava will allow framework SDK to contain annotations.
 	Annotations_enabled *bool
@@ -556,14 +556,6 @@
 	if j.properties.Srcs_lib != nil {
 		ctx.AddVariationDependencies(nil, srcsLibTag, *j.properties.Srcs_lib)
 	}
-
-	android.ExtractSourcesDeps(ctx, j.properties.Srcs)
-
-	// exclude_srcs may contain filegroup or genrule.
-	android.ExtractSourcesDeps(ctx, j.properties.Exclude_srcs)
-
-	// arg_files may contains filegroup or genrule.
-	android.ExtractSourcesDeps(ctx, j.properties.Arg_files)
 }
 
 func (j *Javadoc) genWhitelistPathPrefixes(whitelistPathPrefixes map[string]bool) {
@@ -873,27 +865,6 @@
 	if String(d.properties.Custom_template) != "" {
 		ctx.AddDependency(ctx.Module(), droiddocTemplateTag, String(d.properties.Custom_template))
 	}
-
-	// knowntags may contain filegroup or genrule.
-	android.ExtractSourcesDeps(ctx, d.properties.Knowntags)
-
-	if String(d.properties.Static_doc_index_redirect) != "" {
-		android.ExtractSourceDeps(ctx, d.properties.Static_doc_index_redirect)
-	}
-
-	if String(d.properties.Static_doc_properties) != "" {
-		android.ExtractSourceDeps(ctx, d.properties.Static_doc_properties)
-	}
-
-	if apiCheckEnabled(d.properties.Check_api.Current, "current") {
-		android.ExtractSourceDeps(ctx, d.properties.Check_api.Current.Api_file)
-		android.ExtractSourceDeps(ctx, d.properties.Check_api.Current.Removed_api_file)
-	}
-
-	if apiCheckEnabled(d.properties.Check_api.Last_released, "last_released") {
-		android.ExtractSourceDeps(ctx, d.properties.Check_api.Last_released.Api_file)
-		android.ExtractSourceDeps(ctx, d.properties.Check_api.Last_released.Removed_api_file)
-	}
 }
 
 func (d *Droiddoc) initBuilderFlags(ctx android.ModuleContext, implicits *android.Paths,
@@ -1318,20 +1289,6 @@
 		ignoreMissingModules(ctx, &d.properties.Check_api.Last_released)
 	}
 
-	if apiCheckEnabled(d.properties.Check_api.Current, "current") {
-		android.ExtractSourceDeps(ctx, d.properties.Check_api.Current.Api_file)
-		android.ExtractSourceDeps(ctx, d.properties.Check_api.Current.Removed_api_file)
-	}
-
-	if apiCheckEnabled(d.properties.Check_api.Last_released, "last_released") {
-		android.ExtractSourceDeps(ctx, d.properties.Check_api.Last_released.Api_file)
-		android.ExtractSourceDeps(ctx, d.properties.Check_api.Last_released.Removed_api_file)
-	}
-
-	if String(d.properties.Previous_api) != "" {
-		android.ExtractSourceDeps(ctx, d.properties.Previous_api)
-	}
-
 	if len(d.properties.Merge_annotations_dirs) != 0 {
 		for _, mergeAnnotationsDir := range d.properties.Merge_annotations_dirs {
 			ctx.AddDependency(ctx.Module(), metalavaMergeAnnotationsDirTag, mergeAnnotationsDir)
@@ -1344,13 +1301,6 @@
 		}
 	}
 
-	if String(d.properties.Validate_nullability_from_list) != "" {
-		android.ExtractSourceDeps(ctx, d.properties.Validate_nullability_from_list)
-	}
-	if String(d.properties.Check_nullability_warnings) != "" {
-		android.ExtractSourceDeps(ctx, d.properties.Check_nullability_warnings)
-	}
-
 	if len(d.properties.Api_levels_annotations_dirs) != 0 {
 		for _, apiLevelsAnnotationsDir := range d.properties.Api_levels_annotations_dirs {
 			ctx.AddDependency(ctx.Module(), metalavaAPILevelsAnnotationsDirTag, apiLevelsAnnotationsDir)
diff --git a/java/hiddenapi_singleton.go b/java/hiddenapi_singleton.go
index ceafb59..86531eb 100644
--- a/java/hiddenapi_singleton.go
+++ b/java/hiddenapi_singleton.go
@@ -183,8 +183,8 @@
 		Text("list").
 		FlagForEachInput("--boot-dex=", bootDexJars).
 		FlagWithInputList("--public-stub-classpath=", publicStubPaths, ":").
-		FlagWithInputList("--public-stub-classpath=", systemStubPaths, ":").
-		FlagWithInputList("--public-stub-classpath=", testStubPaths, ":").
+		FlagWithInputList("--system-stub-classpath=", systemStubPaths, ":").
+		FlagWithInputList("--test-stub-classpath=", testStubPaths, ":").
 		FlagWithInputList("--core-platform-stub-classpath=", corePlatformStubPaths, ":").
 		FlagWithOutput("--out-api-flags=", tempPath)
 
diff --git a/java/java.go b/java/java.go
index 0e1ae23..dcd6dbe 100644
--- a/java/java.go
+++ b/java/java.go
@@ -62,11 +62,11 @@
 type CompilerProperties struct {
 	// list of source files used to compile the Java module.  May be .java, .logtags, .proto,
 	// or .aidl files.
-	Srcs []string `android:"arch_variant"`
+	Srcs []string `android:"path,arch_variant"`
 
 	// list of source files that should not be used to build the Java module.
 	// This is most useful in the arch/multilib variants to remove non-common files
-	Exclude_srcs []string `android:"arch_variant"`
+	Exclude_srcs []string `android:"path,arch_variant"`
 
 	// list of directories containing Java resources
 	Java_resource_dirs []string `android:"arch_variant"`
@@ -75,10 +75,10 @@
 	Exclude_java_resource_dirs []string `android:"arch_variant"`
 
 	// list of files to use as Java resources
-	Java_resources []string `android:"arch_variant"`
+	Java_resources []string `android:"path,arch_variant"`
 
 	// list of files that should be excluded from java_resources and java_resource_dirs
-	Exclude_java_resources []string `android:"arch_variant"`
+	Exclude_java_resources []string `android:"path,arch_variant"`
 
 	// don't build against the default libraries (bootclasspath, ext, and framework for device
 	// targets)
@@ -100,10 +100,10 @@
 	Static_libs []string `android:"arch_variant"`
 
 	// manifest file to be included in resulting jar
-	Manifest *string
+	Manifest *string `android:"path"`
 
 	// if not blank, run jarjar using the specified rules file
-	Jarjar_rules *string `android:"arch_variant"`
+	Jarjar_rules *string `android:"path,arch_variant"`
 
 	// If not blank, set the java version passed to javac as -source and -target
 	Java_version *string
@@ -126,7 +126,7 @@
 
 	Openjdk9 struct {
 		// List of source files that should only be used when passing -source 1.9
-		Srcs []string
+		Srcs []string `android:"path"`
 
 		// List of javac flags that should only be used when passing -source 1.9
 		Javacflags []string
@@ -172,7 +172,7 @@
 	Instrument bool `blueprint:"mutated"`
 
 	// List of files to include in the META-INF/services folder of the resulting jar.
-	Services []string `android:"arch_variant"`
+	Services []string `android:"path,arch_variant"`
 }
 
 type CompilerDeviceProperties struct {
@@ -241,7 +241,7 @@
 		Proguard_flags []string
 
 		// Specifies the locations of files containing proguard flags.
-		Proguard_flags_files []string
+		Proguard_flags_files []string `android:"path"`
 	}
 
 	// When targeting 1.9, override the modules to use with --system
@@ -478,13 +478,6 @@
 		{Mutator: "arch", Variation: ctx.Config().BuildOsCommonVariant},
 	}, pluginTag, j.properties.Plugins...)
 
-	android.ExtractSourcesDeps(ctx, j.properties.Srcs)
-	android.ExtractSourcesDeps(ctx, j.properties.Exclude_srcs)
-	android.ExtractSourcesDeps(ctx, j.properties.Java_resources)
-	android.ExtractSourceDeps(ctx, j.properties.Manifest)
-	android.ExtractSourceDeps(ctx, j.properties.Jarjar_rules)
-	android.ExtractSourcesDeps(ctx, j.properties.Services)
-
 	if j.hasSrcExt(".proto") {
 		protoDeps(ctx, &j.protoProperties)
 	}
@@ -1530,15 +1523,15 @@
 
 	// the name of the test configuration (for example "AndroidTest.xml") that should be
 	// installed with the module.
-	Test_config *string `android:"arch_variant"`
+	Test_config *string `android:"path,arch_variant"`
 
 	// the name of the test configuration template (for example "AndroidTestTemplate.xml") that
 	// should be installed with the module.
-	Test_config_template *string `android:"arch_variant"`
+	Test_config_template *string `android:"path,arch_variant"`
 
 	// list of files or filegroup modules that provide data that should be installed alongside
 	// the test
-	Data []string
+	Data []string `android:"path"`
 }
 
 type Test struct {
@@ -1557,13 +1550,6 @@
 	j.Library.GenerateAndroidBuildActions(ctx)
 }
 
-func (j *Test) DepsMutator(ctx android.BottomUpMutatorContext) {
-	j.deps(ctx)
-	android.ExtractSourceDeps(ctx, j.testProperties.Test_config)
-	android.ExtractSourceDeps(ctx, j.testProperties.Test_config_template)
-	android.ExtractSourcesDeps(ctx, j.testProperties.Data)
-}
-
 // java_test builds a and links sources into a `.jar` file for the device, and possibly for the host as well, and
 // creates an `AndroidTest.xml` file to allow running the test with `atest` or a `TEST_MAPPING` file.
 //
@@ -1614,7 +1600,7 @@
 
 type binaryProperties struct {
 	// installable script to execute the resulting jar
-	Wrapper *string
+	Wrapper *string `android:"path"`
 
 	// Name of the class containing main to be inserted into the manifest as Main-Class.
 	Main_class *string
@@ -1670,8 +1656,6 @@
 func (j *Binary) DepsMutator(ctx android.BottomUpMutatorContext) {
 	if ctx.Arch().ArchType == android.Common {
 		j.deps(ctx)
-	} else {
-		android.ExtractSourceDeps(ctx, j.binaryProperties.Wrapper)
 	}
 }
 
@@ -1724,7 +1708,7 @@
 //
 
 type ImportProperties struct {
-	Jars []string
+	Jars []string `android:"path"`
 
 	Sdk_version *string
 
@@ -1775,7 +1759,6 @@
 }
 
 func (j *Import) DepsMutator(ctx android.BottomUpMutatorContext) {
-	android.ExtractSourcesDeps(ctx, j.properties.Jars)
 	ctx.AddVariationDependencies(nil, libTag, j.properties.Libs...)
 }
 
diff --git a/python/python.go b/python/python.go
index 4445f40..6d16020 100644
--- a/python/python.go
+++ b/python/python.go
@@ -43,11 +43,11 @@
 	// non-empty list of .py files under this strict Python version.
 	// srcs may reference the outputs of other modules that produce source files like genrule
 	// or filegroup using the syntax ":module".
-	Srcs []string `android:"arch_variant"`
+	Srcs []string `android:"path,arch_variant"`
 
 	// list of source files that should not be used to build the Python module.
 	// This is most useful in the arch/multilib variants to remove non-common files
-	Exclude_srcs []string `android:"arch_variant"`
+	Exclude_srcs []string `android:"path,arch_variant"`
 
 	// list of the Python libraries under this Python version.
 	Libs []string `android:"arch_variant"`
@@ -74,15 +74,15 @@
 	// srcs may reference the outputs of other modules that produce source files like genrule
 	// or filegroup using the syntax ":module".
 	// Srcs has to be non-empty.
-	Srcs []string `android:"arch_variant"`
+	Srcs []string `android:"path,arch_variant"`
 
 	// list of source files that should not be used to build the C/C++ module.
 	// This is most useful in the arch/multilib variants to remove non-common files
-	Exclude_srcs []string `android:"arch_variant"`
+	Exclude_srcs []string `android:"path,arch_variant"`
 
 	// list of files or filegroup modules that provide data that should be installed alongside
 	// the test. the file extension can be arbitrary except for (.py).
-	Data []string `android:"arch_variant"`
+	Data []string `android:"path,arch_variant"`
 
 	// list of the Python libraries compatible both with Python2 and Python3.
 	Libs []string `android:"arch_variant"`
@@ -288,21 +288,11 @@
 }
 
 func (p *Module) DepsMutator(ctx android.BottomUpMutatorContext) {
-	// deps from "data".
-	android.ExtractSourcesDeps(ctx, p.properties.Data)
-	// deps from "srcs".
-	android.ExtractSourcesDeps(ctx, p.properties.Srcs)
-	android.ExtractSourcesDeps(ctx, p.properties.Exclude_srcs)
-
 	if p.hasSrcExt(ctx, protoExt) && p.Name() != "libprotobuf-python" {
 		ctx.AddVariationDependencies(nil, pythonLibTag, "libprotobuf-python")
 	}
 	switch p.properties.Actual_version {
 	case pyVersion2:
-		// deps from "version.py2.srcs" property.
-		android.ExtractSourcesDeps(ctx, p.properties.Version.Py2.Srcs)
-		android.ExtractSourcesDeps(ctx, p.properties.Version.Py2.Exclude_srcs)
-
 		ctx.AddVariationDependencies(nil, pythonLibTag,
 			uniqueLibs(ctx, p.properties.Libs, "version.py2.libs",
 				p.properties.Version.Py2.Libs)...)
@@ -334,10 +324,6 @@
 		}
 
 	case pyVersion3:
-		// deps from "version.py3.srcs" property.
-		android.ExtractSourcesDeps(ctx, p.properties.Version.Py3.Srcs)
-		android.ExtractSourcesDeps(ctx, p.properties.Version.Py3.Exclude_srcs)
-
 		ctx.AddVariationDependencies(nil, pythonLibTag,
 			uniqueLibs(ctx, p.properties.Libs, "version.py3.libs",
 				p.properties.Version.Py3.Libs)...)
diff --git a/ui/build/dumpvars.go b/ui/build/dumpvars.go
index d644f5f..7f0b784 100644
--- a/ui/build/dumpvars.go
+++ b/ui/build/dumpvars.go
@@ -204,6 +204,7 @@
 		"BUILD_BROKEN_PHONY_TARGETS",
 
 		// Not used, but useful to be in the soong.log
+		"BOARD_VNDK_VERSION",
 		"BUILD_BROKEN_ANDROIDMK_EXPORTS",
 		"BUILD_BROKEN_DUP_COPY_HEADERS",
 		"BUILD_BROKEN_ENG_DEBUG_TAGS",
diff --git a/xml/xml.go b/xml/xml.go
index 218d73c..d89327f 100644
--- a/xml/xml.go
+++ b/xml/xml.go
@@ -58,7 +58,7 @@
 
 type prebuiltEtcXmlProperties struct {
 	// Optional DTD that will be used to validate the xml file.
-	Schema *string
+	Schema *string `android:"path"`
 }
 
 type prebuiltEtcXml struct {
@@ -73,9 +73,6 @@
 
 func (p *prebuiltEtcXml) DepsMutator(ctx android.BottomUpMutatorContext) {
 	p.PrebuiltEtc.DepsMutator(ctx)
-
-	// To support ":modulename" in schema
-	android.ExtractSourceDeps(ctx, p.properties.Schema)
 }
 
 func (p *prebuiltEtcXml) GenerateAndroidBuildActions(ctx android.ModuleContext) {