Add maven url to repositories in build.gradle


#1

To add crashlytics support I need to add maven { url 'https://maven.fabric.io/public' } to repositories both in buildscript and allprojects. Please add support in build.gradle.


#2

Hey Bjørn-Olav!

Thanks for the suggestion; I’ve created an internal issue.

Stay tuned!


#3

The fix for this is in for review, this should be in the next release.


#4

This was released but I though I should come back and say that for other google-weary travelers

the top build.gradle file looks like this:

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
       jcenter()
       mavenCentral()
       @(Gradle.BuildScript.Repository:Join('\n'))
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.0'
        @(Gradle.Dependency.ClassPath:Join('\n', 'classpath \'', '\''))
    }
}

allprojects {
    repositories {
        jcenter()
        mavenCentral()
        @(Gradle.AllProjects.Repository:Join('\n'))
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

so you can use Gradle.BuildScript.Repository, Gradle.Dependency.ClassPath & Gradle.AllProjects.Repository

Here is an example uno attribute:

[Require("Gradle.BuildScript.Repository", "FOOBAR")]