15
votes

Using Android studio version 0.1.3 and version 0.4.2 of the android gradle plugin. I noticed that its not pulling in sources for any of my dependencies. i used a third party android plugin before on eclipse that did that and usually with maven you can configure it to do that too. Anyone know how you can enable the android plugin or android studio to pull sources and javadoc for artifacts?

Another issue that i'm having is i've created a configuration for provided scope like this

configurations {
    provided
}

android.applicationVariants.each { variant ->
    variant.javaCompile.classpath += configurations.provided
}

Which works perfectly in gradle but android studio is not adding this to its classpath. Anyone know how to get around that? I've tried the idea gradle plugin like this

idea {
    module {
        downloadJavadoc = true
        downloadSources = true

        scopes.PROVIDED.plus += configurations.provided
    }
}

but it doesn't work without the java plugin when trying to modify scopes. Also the settings for downloading javadoc and sources didn't work either

I'm really disappointed in how badly android studio and new gradle build system fits together, really want to switch but at this rate its just not a reality

3
Common! Isn't there anybody that likes having sources and javadoc for his libs?? I am pissed off I cannot add maven dependencies to Android studio project and get the javadocs. :(Monitus
I posted the problems I have, seems quite the same as yours: stackoverflow.com/questions/17426628/…Monitus

3 Answers

0
votes

You can use the AARLinkSources gradle plugin to download dependency sources.

0
votes

AARLinkSources gradle plugin works well. But it seems like that the original repository is invalid now, try this(found here):

buildscript {
    repositories {
        maven { url 'https://jitpack.io' }
    }

    dependencies {
        classpath 'com.github.xujiaao:AARLinkSources:cd832ed1ba'
    }
}
-3
votes

Android studio 0.4.2 still in beta stage. I had many problems from which I couldn't run the application imported from eclipse. I think we should stick to eclipse for now. Still we can't depend on an unfinished software. Wait for the ver 1.0 and will be done nicely as all google products.