Move globbing to Blueprint

Move Soong's globbing-with-dependencies support into Blueprint so it can
be used for subdirs= lines in Android.bp files.

Blueprint has a slight change in behavior around subname= lines, it now
always uses the subname and doesn't fall back to Blueprints.  To support
the Blueprints files in build/blueprint, use them directly with build=.

Test: build, add source file that matches glob, rebuild
Change-Id: Ifd0b0d3bc061aae0a16d6c7ca9a1cd8672656b4d
diff --git a/java/resources.go b/java/resources.go
index a4783b8..60dc934 100644
--- a/java/resources.go
+++ b/java/resources.go
@@ -17,6 +17,8 @@
 import (
 	"path/filepath"
 
+	"github.com/google/blueprint/bootstrap"
+
 	"android/soong/android"
 )
 
@@ -54,13 +56,13 @@
 			continue
 		}
 		resourceDir := android.PathForModuleSrc(ctx, resourceDir)
-		dirs := ctx.Glob("java_resources", resourceDir.String(), nil)
+		dirs := ctx.Glob(resourceDir.String(), nil)
 		for _, dir := range dirs {
 			fileListFile := android.ResPathWithName(ctx, dir, "resources.list")
 			depFile := fileListFile.String() + ".d"
 
-			glob := filepath.Join(dir.String(), "**/*")
-			android.GlobRule(ctx, glob, excludes, fileListFile.String(), depFile)
+			pattern := filepath.Join(dir.String(), "**/*")
+			bootstrap.GlobFile(ctx, pattern, excludes, fileListFile.String(), depFile)
 			jarSpecs = append(jarSpecs, jarSpec{fileListFile, dir})
 		}
 	}