Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AAR library assembling #20

Open
iqorqua opened this issue Feb 27, 2020 · 0 comments
Open

AAR library assembling #20

iqorqua opened this issue Feb 27, 2020 · 0 comments

Comments

@iqorqua
Copy link

iqorqua commented Feb 27, 2020

Hi! I'm appologise for of-topic question, but how do you managed assembling of your project to .aar, which contains all sources and documentation? I'm trying to do same thing with my project, but still have no result. Sources are avalible after adding .jar in addition to .aar.
Then i cloned your project and tryed to build .aar from it's sources and got same result. As a conclusion -- i`m doing something wrong...

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

task javadoc(type: Javadoc) {
    failOnError  false
    source = android.sourceSets.main.java.sourceFiles
    classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
    classpath += configurations.compile
}
task addMySourcesToAar(type: Jar) {
    archiveName "ttsmanager.aar"
    destinationDir file("build")
    from zipTree("build/outputs/aar/ttsmanager-release.aar")
    from fileTree("build").include("libs/ttsmanager-sources.jar")
}
afterEvaluate { project ->
    project.tasks.preBuild.dependsOn sourceJar
    project.addMySourcesToAar.dependsOn build
}
artifacts {
    javadoc
    archives addMySourcesToAar.archivePath
}

Can you help me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant