Adding a Gradle repository for "Add Reference" dialog

How do I add a Gradle repository in such a way that the “Add Reference” dialog in Water can use it? Specifically, I’m trying to add Google’s maven repository:

<GradleRepository Include="https://maven.google.com/" />

If I add the above line to my project config file directly, I don’t seem to get the massive benefit of pulling in recursive dependencies (that seems to be a feature of the “Add Reference” dialog rather than a build-time feature – please correct me if I’m wrong). Also when I add it to my project config file, I still don’t see the repo’s libraries in the “Add Reference” dialog.

Is there any way to add a repository for the “Add Reference” dialog to display?

(Incidentally, it would be nice to have Google’s maven repo added by default for Android projects, as Android Studio now includes it by default and Google hosts a lot of their core libraries here now).

Matt,

I’m afraid right now you can’t. The dialog only supports the standard local file based repositories because, frankly, supporting remoter repositories of the size of the Gradle and NuGet ones requires me to rethink the UI for his to best integrate incremental searching for packages by names that are not shown in a flat list (as there’d be too many to download the whole list efficiently). That’s on my list, but I just haven’t gotten around to it yet :(.

The GradleRepository tag in the project only affects build time (and in-IDE referent resolving), yes. Packages in that repository that your project already has a reference to will be found in that repository, both when building and when working in the IDE.

Once the above is implemented, the repository would of course also contribute to what’s shown in the dialog.

Right now, in additional to not working for http:// based repositories but only local ones, the list of repositories used is hardcoded in EBuild, with <GradleRepository> being the only way to add custom ones, on a per-project basis. Since he Manage References dialog doesn’t support https:// repositories yet, making that list configurable was a low priority (but is of course on the list).

It is. These three repositories ar reconfigured by default, plus any local m2repository repository folders in there Android SDK install:

—marc

I know the feeling :slight_smile: Looking forward to this feature being added, as I’m really appreciating having Gradle reference support!

Thanks, good to know. Seems like the documentation on Package References needs to be updated then:

Repositories

… For Android, that are jcenter.bintray.com and repo1.maven.org/maven2 , as well as any local repositories in disk in the extras folder of the Android SDK install.

Oops, indeed. done.