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

Redundant task. #6

Open
rhonyabdullah opened this issue May 25, 2018 · 0 comments
Open

Redundant task. #6

rhonyabdullah opened this issue May 25, 2018 · 0 comments

Comments

@rhonyabdullah
Copy link

Reading this gradle line android.libraryVariants.all

Why not instead doing this stuff ? CMIIW.

android.libraryVariants.all { variant ->
    task("${variant.name}Javadoc", type: Javadoc, dependsOn: "assemble${variant.name.capitalize()}") {
        source = variant.javaCompile.source

        title = "Rich Relevance"

        options.links("http://docs.oracle.com/javase/7/docs/api/")
        options.linksOffline("http://d.android.com/reference", "${android.sdkDirectory}/docs/reference")

        // We're excluding these generated files
        exclude '**/BuildConfig.java'
        exclude '**/R.java'
        doFirst {
            // First add all of your dependencies to the classpath, then add the android jars
            classpath = files(variant.javaCompile.classpath.files, android.getBootClasspath())
        }
    }

    task("${variant.name}JavadocJar", type: Jar, dependsOn: "${variant.name}Javadoc") {
        classifier = 'javadoc'
        from tasks["${variant.name}Javadoc"].destinationDir
    }

    // Add the Javadoc jar to the project's artifacts. This will allow us to upload it easily later
    project.artifacts.add("archives", tasks["${variant.name}JavadocJar"])
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant