android.libraryVariants.all { variant -> def name = variant.name task "javadoc$name"(type: Javadoc) { description = "Generates javadoc for build $name" destinationDir = new File(destinationDir, variant.baseName) source = variant.sourceSets.collect { it.java.sourceFiles }.inject { m, i -> m + i } classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) options.windowTitle("Mapbox Maps SDK for Android $VERSION_NAME Reference") options.docTitle("Mapbox Maps SDK for Android $VERSION_NAME") options.header("Mapbox Maps SDK for Android $VERSION_NAME Reference") options.bottom("© 2015–2019 Mapbox. All rights reserved.") options.links("http://docs.oracle.com/javase/7/docs/api/") options.linksOffline "http://d.android.com/reference","${android.sdkDirectory}/docs/reference" options.overview("src/main/java/overview.html") options.group("Mapbox Android SDK", "com.mapbox.*") exclude '**/R.java', '**/BuildConfig.java', '**/**.java.ejs', '**/**.html' } }