Android Studio-Gradle生成特定的Javadoc文件 [英] Android Studio - Gradle generate specific javadoc files

查看:209
本文介绍了Android Studio-Gradle生成特定的Javadoc文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要为包含3个模块的项目生成一些Javadoc,并且只需要每个模块中的特定文件即可.

I need to generate some javadoc for a project that contains 3 modules, and I only need specific files from each module.

在Android Studio中,我可以转到工具->生成JavaDoc,然后设置自定义范围,并有选择地选择所需的文件,然后将它们聚合到单个javadoc文件夹中,但这不适用于我们的自动构建.

In Android Studio I can go Tools -> Generate JavaDoc and then set custom scope, and selectively choose the files I want and it aggregates them into a single javadoc folder, but this won't work for our automated build.

我不知道如何在gradle命令行上做到这一点?

I can't figure out how to do this on the gradle command line?

每个例子都是该任务的一些变体

Every example is some variation of this task

task javadoc(type: Javadoc) {
    source = android.sourceSets.main.java.srcDirs
    classpath+=project.files(android.getBootClasspath().join(File.pathSeparator))
    destinationDir = file("../javadoc/")
    failOnError false
}

这将为整个模块生成javadoc.我不知道如何只获取我想要的文件?

This generates the javadoc for the entire module. I can't figure out how to get only the files I want?

推荐答案

您似乎可以按照以下方式进行操作

It looks like you can do it the following way

task javadoc(type: Javadoc) {
    source = android.sourceSets.main.java.srcDirs
    classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
    destinationDir = file("../javadoc/")
    include("**/ClassFile1.java")
    include("**/ClassFile2.java")
    failOnError false
}

这篇关于Android Studio-Gradle生成特定的Javadoc文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆