AARLinkSources icon indicating copy to clipboard operation
AARLinkSources copied to clipboard

Automatically download all available sources

Open jenzz opened this issue 10 years ago • 9 comments

Hi there!

This is a great plugin. Thanks! :smile: What do you think of an option to automatically download available sources for all dependencies?

You could enable it like this:

aarLinkSources {
   downloadAllSources = true
}

jenzz avatar Mar 01 '15 17:03 jenzz

+1 for this feature

danielesegato avatar Apr 15 '15 13:04 danielesegato

I add this add build.gradle

apply plugin: 'aar-link-sources'

dependencies {
    aarLinkSources {
        downloadAllSources = true
    }
}

But produce error when syncing:

Error:(113, 0) Cannot convert the provided notation to an object of type Dependency: build_835xzdg018b0t9zzo5vt54ie5$_run_closure5_closure11@54e59ba1.
The following types/formats are supported:
  - Instances of Dependency.
  - String or CharSequence values, e.g. 'org.gradle:gradle-core:1.0'.
  - Maps, e.g. [group: 'org.gradle', name: 'gradle-core', version: '1.0'].
  - FileCollections, e.g. files('some.jar', 'someOther.jar').
  - Projects, e.g. project(':some:project:path').
  - ClassPathNotation, e.g. gradleApi().

Comprehensive documentation on dependency notations is available in DSL reference for DependencyHandler type.

How can I handle it?

noproxy avatar Apr 20 '15 04:04 noproxy

This would be awesome. Although I would argue that this plugin should try to do that by default, so that all you need to do is apply the plugin and everything comes down automatically.

@xujiaao thank you so much for this library, it is proving to be very useful

mikeholler avatar Apr 21 '15 17:04 mikeholler

Sorry everybody, the Plugin dose not support the feature 'downloadAllSources' currently.

It is a good suggestion, but I do not know how to implement this feature now.... :(

Thank you for your advice.

xujiaao avatar Apr 26 '15 10:04 xujiaao

+1

@xujiaao Could you look through every entry in dependencies {} and when you find compile com.something:lib:1.0.0 do what aarLinkSources would have done if it had found aarLinkSources com.something:lib:1.0.0:sources@jar?

aluxian avatar May 03 '15 10:05 aluxian

I see that this has been done by #7 (if I understand it right) and it's merged to master already. Time to cut out a release?

ChaitanyaPramod avatar Jul 03 '15 03:07 ChaitanyaPramod

I agree. But this issue should be closed nevertheless.

BTW, you can easily build and install the plugin from source then use it. Clone the repo, then gradlew install. After, add this to your build.gradle

buildscript {
    repositories {
        mavenLocal()
       // etc
    }
    dependencies {
        classpath 'AARLinkSources:plugin:unspecified' // just installed to local repo
        // etc
    }
}

WonderCsabo avatar Jul 08 '15 20:07 WonderCsabo

What do you think of an default option to automatically link the available source and doc ?Don't need add "aarLinkSources 'xxxxxsources@jar' "

damonliuchn avatar Aug 01 '15 05:08 damonliuchn

@MasonLiuChn i already implemented that.

WonderCsabo avatar Aug 01 '15 08:08 WonderCsabo