Janusz
Janusz

Reputation: 189464

How to publish Android .aar sources to make Android Studio automatically find them?

I'm publishing libraries to an internal Sonatype Nexus repository.

Android Studio has a feature that automatically finds the correct source for a library that is referenced through gradle. I publish the sources for our aar as a separate jar to the nexus. But Android Studio is not picking them up.

How do I have to publish the sources to make them available in Android Studio?

Upvotes: 13

Views: 4030

Answers (2)

Real.Xu
Real.Xu

Reputation: 229

I have wrote a gradle plugin for this function. Hope it will help you.

----- edit ------

How to publish Android .aar sources?

android {

    task sourcesJar(type: Jar) {
        classifier = 'sources'
        from android.sourceSets.main.java.srcDirs
    }

    artifacts {
        archives sourcesJar
    }

    uploadArchives {
        repositories {
            mavenDeployer {
                ...
            }
        }
    }
}

Upvotes: 3

Xavier Ducrohet
Xavier Ducrohet

Reputation: 28539

It's not possible at the moment.

Upvotes: 3

Related Questions