当前位置: 首页>>代码示例>>Java>>正文


Java StandardJavadocDocletOptions类代码示例

本文整理汇总了Java中org.gradle.external.javadoc.StandardJavadocDocletOptions的典型用法代码示例。如果您正苦于以下问题:Java StandardJavadocDocletOptions类的具体用法?Java StandardJavadocDocletOptions怎么用?Java StandardJavadocDocletOptions使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


StandardJavadocDocletOptions类属于org.gradle.external.javadoc包,在下文中一共展示了StandardJavadocDocletOptions类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: configureJavadoc

import org.gradle.external.javadoc.StandardJavadocDocletOptions; //导入依赖的package包/类
public static void configureJavadoc(@Nonnull final Project project, @Nonnull final Javadoc javadoc) {
    final StdProjectExtension extension = project.getRootProject().getExtensions().getByType(StdProjectExtension.class);
    final StandardJavadocDocletOptions javadocOptions = (StandardJavadocDocletOptions) javadoc.getOptions();
    javadoc.doFirst(new Action<Task>() {
        @Override
        public void execute(Task t) {
            if (!t.getProject().getGradle().getStartParameter().isOffline())
                javadocOptions.setLinks(extension.javadocLinks);
            javadocOptions.setLinkSource(extension.javadocLinkSource);
            if (!extension.javadocGroups.isEmpty())
                javadocOptions.setGroups(extension.javadocGroups);
            if (JavaVersion.current().isJava8Compatible())
                if (extension.javadocQuiet)
                    javadocOptions.addStringOption("Xdoclint:none", "-quiet");
        }
    });
}
 
开发者ID:shevek,项目名称:gradle-stdproject-plugin,代码行数:18,代码来源:StdTaskConfiguration.java

示例2: apply

import org.gradle.external.javadoc.StandardJavadocDocletOptions; //导入依赖的package包/类
@Override
public void apply(Project project) {
    project.getTasks().withType(Javadoc.class, javadoc -> {

        StandardJavadocDocletOptions options = (StandardJavadocDocletOptions) javadoc.getOptions();

        options.charSet("UTF-8");
        options.docEncoding("UTF-8");
        options.setEncoding("UTF-8");
    });
}
 
开发者ID:freefair,项目名称:gradle-plugins,代码行数:12,代码来源:JavadocUtf8Plugin.java

示例3: addLink

import org.gradle.external.javadoc.StandardJavadocDocletOptions; //导入依赖的package包/类
private void addLink(Javadoc javadoc, String link) {
    MinimalJavadocOptions options = javadoc.getOptions();
    if (options instanceof StandardJavadocDocletOptions) {
        StandardJavadocDocletOptions docletOptions = (StandardJavadocDocletOptions) options;
        Logger logger = javadoc.getLogger();
        List<String> links = docletOptions.getLinks();

        if (!links.contains(link)) {
            logger.debug("Adding '{}' to {}", link, javadoc);
            links.add(link);
        } else {
            logger.info("Not adding '{}' to {} because it's already present", link, javadoc);
        }
    }
}
 
开发者ID:freefair,项目名称:gradle-plugins,代码行数:16,代码来源:JavadocLinksPlugin.java

示例4: apply

import org.gradle.external.javadoc.StandardJavadocDocletOptions; //导入依赖的package包/类
@Test
public void apply() {
    project.getPlugins().apply(JavaPlugin.class);
    project.getPlugins().apply(JavadocUtf8Plugin.class);

    Javadoc javadoc = (Javadoc) project.getTasks().getByName(JavaPlugin.JAVADOC_TASK_NAME);
    StandardJavadocDocletOptions options = (StandardJavadocDocletOptions) javadoc.getOptions();

    assertThat(options.getDocEncoding()).isEqualToIgnoringCase("UTF-8");
    assertThat(options.getEncoding()).isEqualToIgnoringCase("UTF-8");
    assertThat(options.getCharSet()).isEqualToIgnoringCase("UTF-8");
}
 
开发者ID:freefair,项目名称:gradle-plugins,代码行数:13,代码来源:JavadocUtf8PluginTest.java

示例5: configureJavadocTask

import org.gradle.external.javadoc.StandardJavadocDocletOptions; //导入依赖的package包/类
public static void configureJavadocTask(final Javadoc pTask, final DependencyConfig pDepConfig)
{
    final Project project = pTask.getProject();
    final BuildUtil buildUtil = new BuildUtil(project);

    pTask.setTitle(buildUtil.getLongName() + " v" + project.getVersion());
    final StandardJavadocDocletOptions options = (StandardJavadocDocletOptions) pTask.getOptions();
    options.setEncoding(StandardCharsets.UTF_8.toString());
    options.setDocEncoding(StandardCharsets.UTF_8.toString());
    options.setCharSet(StandardCharsets.UTF_8.toString());
    options.setAuthor(false);
    options.setUse(true);
    options.setNoDeprecated(true);
    options.setWindowTitle(buildUtil.getLongName());
    options.setSplitIndex(false);
    options.setHeader(buildUtil.getLongName());
    options.setLinks(pDepConfig.getJavadocLinks());

    pTask.setSource(buildUtil.getSourceSet(SourceSet.MAIN_SOURCE_SET_NAME).getAllJava()
        .plus(buildUtil.getSourceSet(BuildUtil.SONARQUBE_SOURCE_SET_NAME).getAllJava()));
    pTask.setClasspath(new ClasspathBuilder(project)
        .buildClassPath(pDepConfig, null, false, buildUtil.getSourceSet(SourceSet.MAIN_SOURCE_SET_NAME),
            buildUtil.getSourceSet(BuildUtil.SONARQUBE_SOURCE_SET_NAME)));

    // javadoc does not inherit the proxy settings (https://issues.gradle.org/browse/GRADLE-1228)
    if (System.getProperty("http.proxyHost") != null) {
        options.jFlags("-DproxyHost=" + System.getProperty("http.proxyHost"),
            "-DproxyPort=" + System.getProperty("http.proxyPort"),
            "-DproxyUser=" + System.getProperty("http.proxyUser"),
            "-DproxyPassword=" + System.getProperty("http.proxyPassword"));
    }
}
 
开发者ID:checkstyle-addons,项目名称:checkstyle-addons,代码行数:33,代码来源:JavadocTask.java

示例6: generate

import org.gradle.external.javadoc.StandardJavadocDocletOptions; //导入依赖的package包/类
@TaskAction
protected void generate() {
    final File destinationDir = getDestinationDir();

    if (options.getDestinationDirectory() == null) {
        options.destinationDirectory(destinationDir);
    }

    options.classpath(new ArrayList<File>(getClasspath().getFiles()));

    if (!GUtil.isTrue(options.getWindowTitle()) && GUtil.isTrue(getTitle())) {
        options.windowTitle(getTitle());
    }
    if (options instanceof StandardJavadocDocletOptions) {
        StandardJavadocDocletOptions docletOptions = (StandardJavadocDocletOptions) options;
        if (!GUtil.isTrue(docletOptions.getDocTitle()) && GUtil.isTrue(getTitle())) {
            docletOptions.setDocTitle(getTitle());
        }
    }

    if (maxMemory != null) {
        final List<String> jFlags = options.getJFlags();
        final Iterator<String> jFlagsIt = jFlags.iterator();
        boolean containsXmx = false;
        while (!containsXmx && jFlagsIt.hasNext()) {
            final String jFlag = jFlagsIt.next();
            if (jFlag.startsWith("-Xmx")) {
                containsXmx = true;
            }
        }
        if (!containsXmx) {
            options.jFlags("-Xmx" + maxMemory);
        }
    }

    List<String> sourceNames = new ArrayList<String>();
    for (File sourceFile : getSource()) {
        sourceNames.add(sourceFile.getAbsolutePath());
    }
    options.setSourceNames(sourceNames);

    executeExternalJavadoc();
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:44,代码来源:Javadoc.java

示例7: getJavadocTask

import org.gradle.external.javadoc.StandardJavadocDocletOptions; //导入依赖的package包/类
public Javadoc getJavadocTask(Project project, BaseVariant variant) {

        if (!javadocTasks.containsKey(variant.getName())) {

            Javadoc task = project.getTasks().create("javadoc" + capitalize((CharSequence) variant.getName()), Javadoc.class, javadoc -> {
                javadoc.setDescription("Generate Javadoc for the " + variant.getName() + " variant");
                javadoc.setGroup(JavaBasePlugin.DOCUMENTATION_GROUP);

                javadoc.dependsOn(variant.getJavaCompiler());

                if (variant.getJavaCompiler() instanceof JavaCompile) {
                    JavaCompile javacTask = (JavaCompile) variant.getJavaCompiler();

                    javadoc.setSource(javacTask.getSource());

                    javadoc.setClasspath(project.files(javacTask.getDestinationDir()).plus(javacTask.getClasspath()));
                    javadoc.getOptions().setSource(javacTask.getSourceCompatibility());
                } else {
                    getProject().getLogger().warn("Failed to configure {}. Unsupported Compiler: {}", javadoc.getName(), variant.getJavaCompiler().getClass().getName());
                }

                //javadoc.exclude '**/BuildConfig.java'
                javadoc.exclude("**/R.java");

                javadoc.getOptions().encoding("UTF-8");
                javadoc.getOptions().setBootClasspath(getAndroidExtension().getBootClasspath());

                if (javadoc.getOptions() instanceof StandardJavadocDocletOptions) {
                    StandardJavadocDocletOptions realOptions = (StandardJavadocDocletOptions) javadoc.getOptions();

                    realOptions.docEncoding("UTF-8");
                    realOptions.charSet("UTF-8");

                    Serializable javaVersion = GUtil.elvis(Jvm.current().getJavaVersion().getMajorVersion(), '8');
                    realOptions.links("http://docs.oracle.com/javase/" + javaVersion + "/docs/api/");
                    realOptions.linksOffline("http://developer.android.com/reference/", getAndroidExtension().getSdkDirectory() + "/docs/reference");
                }

                javadoc.setFailOnError(false);

                File docsDir;
                if (project.hasProperty("docsDir")) {
                    docsDir = (File) project.property("docsDir");
                } else {
                    docsDir = new File(project.getBuildDir(), "docs");
                }
                File javadocDir = new File(docsDir, "javadoc");
                javadoc.setDestinationDir(new File(javadocDir, variant.getDirName()));
            });

            javadocTasks.put(variant.getName(), task);
        }

        return javadocTasks.get(variant.getName());
    }
 
开发者ID:freefair,项目名称:android-gradle-plugins,代码行数:56,代码来源:AndroidJavadocPlugin.java


注:本文中的org.gradle.external.javadoc.StandardJavadocDocletOptions类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。