Add source file provider for genrule/srcs, python libraries and rust libraries.

Ignore-AOSP-First: CPing test_spec rule to udc-mainline-prod to support migration of test targets. Cherry pick of:aosp/2786121

Change-Id: I2d7d4684a10c15aeecc27b8db800ab27a807d2e2
Merged-In: I2d7d4684a10c15aeecc27b8db800ab27a807d2e2
diff --git a/android/Android.bp b/android/Android.bp
index 35d5c19..641c438 100644
--- a/android/Android.bp
+++ b/android/Android.bp
@@ -88,7 +88,6 @@
         "singleton.go",
         "singleton_module.go",
         "soong_config_modules.go",
-        "source_file_provider.go",
         "test_asserts.go",
         "test_suites.go",
         "testing.go",
diff --git a/android/filegroup.go b/android/filegroup.go
index 121368d..66aa154 100644
--- a/android/filegroup.go
+++ b/android/filegroup.go
@@ -237,6 +237,7 @@
 	if fg.properties.Path != nil {
 		fg.srcs = PathsWithModuleSrcSubDir(ctx, fg.srcs, String(fg.properties.Path))
 	}
+	ctx.SetProvider(blueprint.SrcsFileProviderKey, blueprint.SrcsFileProviderData{SrcPaths: fg.srcs.Strings()})
 }
 
 func (fg *fileGroup) Srcs() Paths {
diff --git a/android/source_file_provider.go b/android/source_file_provider.go
deleted file mode 100644
index 80bde2a..0000000
--- a/android/source_file_provider.go
+++ /dev/null
@@ -1,11 +0,0 @@
-package android
-
-import (
-	"github.com/google/blueprint"
-)
-
-type SrcsFileProviderData struct {
-	SrcPaths Paths
-}
-
-var SrcsFileProviderKey = blueprint.NewProvider(SrcsFileProviderData{})