org.gradle.api.tasks.javadoc.Javadoc.getDestinationDir()方法的使用及代码示例

x33g5p2x  于2022-01-22 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(148)

本文整理了Java中org.gradle.api.tasks.javadoc.Javadoc.getDestinationDir()方法的一些代码示例,展示了Javadoc.getDestinationDir()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Javadoc.getDestinationDir()方法的具体详情如下:
包路径:org.gradle.api.tasks.javadoc.Javadoc
类名称:Javadoc
方法名:getDestinationDir

Javadoc.getDestinationDir介绍

暂无

代码示例

代码示例来源:origin: gradle.plugin.com.github.skazzyy.gradle.plugins/sources-gradle-plugin

protected void createSourcesJars(final Project project) {
  final JavaPluginConvention javaPluginConvention = project.getConvention().getPlugin(JavaPluginConvention.class);
  Task sourcesJar = project.getTasks().create("sourcesJar", Jar.class, jar -> {
    jar.setDescription("Creates a jar with the sources");
    jar.setClassifier("sources");
    jar.from(javaPluginConvention.getSourceSets().getByName("main").getAllSource());
  });
  Task javadocJar = project.getTasks().create("javadocJar", Jar.class, jar -> {
    jar.setDescription("Creates a javadoc jar");
    jar.setClassifier("javadoc");
    Javadoc javadoc = (Javadoc) project.getTasks().getByName(JavaPlugin.JAVADOC_TASK_NAME);
    jar.from(javadoc.getDestinationDir());
    jar.dependsOn(javadoc);
  });
  Task testsJar = project.getTasks().create("testsJar", Jar.class, jar -> {
    jar.setDescription("Creates a jar containing all the source and classes for the tests");
    jar.setClassifier("tests");
    SourceSet test = javaPluginConvention.getSourceSets().getByName("test");
    jar.from(test.getAllJava());
    jar.from(test.getOutput());
  });
  project.getArtifacts().add(Dependency.ARCHIVES_CONFIGURATION, sourcesJar);
  project.getArtifacts().add(Dependency.ARCHIVES_CONFIGURATION, javadocJar);
  project.getArtifacts().add(Dependency.ARCHIVES_CONFIGURATION, testsJar);
}

代码示例来源:origin: io.freefair.gradle/android-gradle-plugins

@Override
  protected void withAndroid(TestedExtension extension) {
    super.withAndroid(extension);

    getAndroidVariants().all(variant -> {

      AndroidJavadocPlugin androidJavadocPlugin = getProject().getPlugins().findPlugin(AndroidJavadocPlugin.class);
      Javadoc javadocTask = androidJavadocPlugin.getJavadocTask(getProject(), variant);

      Jar javadocJarTask = getProject().getTasks().create("javadoc" + capitalize((CharSequence) variant.getName()) + "Jar", Jar.class, jar -> {
        jar.dependsOn(javadocTask);

        jar.setDescription("Generate the javadoc jar for the " + variant.getName() + " variant");
        jar.setGroup("jar");

        jar.setAppendix(variant.getName());
        jar.setClassifier("javadoc");
        jar.from(javadocTask.getDestinationDir());
      });

      allJavadocJarTask.dependsOn(javadocJarTask);

      if (publishVariant(variant)) {
        getProject().getArtifacts().add(Dependency.ARCHIVES_CONFIGURATION, javadocJarTask);
      }
    });
  }
}

相关文章