Add ability to build unbundled builds.

This adds ability to build using jcenter instead of local prebuilts
directory. This is needed for special unbundled checkouts of support
library that use remote maven to get all of its dependencies.

Bug: 72221688
Test: local build of support lib
Change-Id: I711dfe3efd21a3d930c57a103957d9e0e52d0c16
diff --git a/build.gradle b/build.gradle
index 3866c13..106d916 100644
--- a/build.gradle
+++ b/build.gradle
@@ -44,13 +44,18 @@
 }
 
 /*
- * If prebuilts are available, use them. Otherwise, attempt to compile against
- * the full source trees.
+ * If prebuilts are available, use them. Else, if this is unbundled build use jcenter().
+ * Finally, if none of that is true, attempt to compile against the full source trees.
  */
 File m2repo = file('../../prebuilts/tools/common/m2/repository')
-if (m2repo.exists()) {
+boolean unbundleBuild = (new File("unbundled-build")).exists()
+
+if (m2repo.exists() || unbundleBuild) {
     repositories {
         maven { url m2repo.absolutePath }
+        if (unbundleBuild) {
+            jcenter()
+        }
     }
 
     dependencies {