* Used in incremental builds of multimodule projects.
*
* @param delayTemplateSubstitution the delay
* @return this operation instance
*/
public DokkaOperation delayTemplateSubstitution(Boolean delayTemplateSubstitution) {
delayTemplateSubstitution_ = delayTemplateSubstitution;
return this;
}
/**
* Part of the {@link #execute execute} operation, constructs the command list to use for building the process.
*
* @since 1.5
*/
@Override
protected List
* Sets the {@link #sourceSet sourceSet}, {@link SourceSet#jdkVersion jdkVersion}, {@link #moduleName moduleName}
* and {@link SourceSet#classpath(String...) classpath} from the project.
*
* @param project the project to configure the operation from
*/
@Override
public DokkaOperation fromProject(BaseProject project) {
project_ = project;
sourceSet_ = new SourceSet()
.src(new File(project.srcMainDirectory(), "kotlin").getAbsolutePath())
.classpath(project.compileClasspathJars())
.classpath(project.providedClasspathJars());
if (project.javaRelease() != null) {
sourceSet_ = sourceSet_.jdkVersion(project.javaRelease());
}
moduleName_ = project.name();
return this;
}
/**
* Sets whether to fail documentation generation if Dokka has emitted a warning or an error.
*
* Whether to fail documentation generation if Dokka has emitted a warning or an error. The process waits until all
* errors and warnings have been emitted first.
*
* This setting works well with {@link SourceSet#reportUndocumented}
*
* @param failOnWarning {@code true} or {@code false}
* @return this operation instance
*/
public DokkaOperation failOnWarning(Boolean failOnWarning) {
failOnWarning_ = failOnWarning;
return this;
}
/**
* Set the global external documentation links.
*
* @param url the external documentation URL
* @param packageListUrl the external documentation package list URL
* @return this operation instance
*/
public DokkaOperation globalLinks(String url, String packageListUrl) {
globalLinks_.put(url, packageListUrl);
return this;
}
/**
* Set the global external documentation links.
*
* @param globalLinks the map of global links
* @return this operation instance
* @see #globalSrcLink(String...) #globalSrcLink(String...)#globalSrcLink(String...)
*/
public DokkaOperation globalLinks(Map
* Using format:
*
* Using format:
*
* The contents of specified files are parsed and embedded into documentation as module and package descriptions.
*
* This can be configured on per-package basis.
*
* @param files one or more files
* @return this operation instance
*/
public DokkaOperation includes(String... files) {
includes_.addAll(Arrays.asList(files));
return this;
}
/**
* Sets the Markdown files that contain module and package documentation.
*
* The contents of specified files are parsed and embedded into documentation as module and package descriptions.
*
* This can be configured on per-package basis.
*
* @param files the list of files
* @return this operation instance
*/
public DokkaOperation includes(Collection
* The display name used to refer to the module. It is used for the table of contents, navigation, logging, etc.
*
* @param moduleName the project/module name
* @return this operation instance
*/
public DokkaOperation moduleName(String moduleName) {
moduleName_ = moduleName;
return this;
}
/**
* Set the documented version.
*
* @param version the version
* @return this operation instance
*/
public DokkaOperation moduleVersion(String version) {
moduleVersion_ = version;
return this;
}
/**
* Sets whether to suppress obvious functions such as inherited from
* kotlin.Any and {@link java.lang.Object}.
*
* A function is considered to be obvious if it is:
*
* This includes package-lists used for generating external documentation links. For example, to make classes from
* the standard library clickable.
*
* Setting this to true can significantly speed up build times in certain cases, but can also worsen documentation
* quality and user experience. For example, by not resolving class/member links from your dependencies, including
* the standard library.
*
* Note: You can cache fetched files locally and provide them to Dokka as local paths.
*
* @param offlineMode the offline mode
* @return this operation instance
* @see SourceSet#externalDocumentationLinks(String, String)
*/
public DokkaOperation offlineMode(Boolean offlineMode) {
offlineMode_ = offlineMode;
return this;
}
/**
* Sets the output directory path, {@code ./dokka} by default.
*
* The directory to where documentation is generated, regardless of output format.
*
* @param outputDir the output directory
* @return this operation instance
*/
public DokkaOperation outputDir(File outputDir) {
outputDir_ = outputDir;
return this;
}
/**
* Sets the output directory path, {@code ./dokka} by default.
*
* @param outputDir the output directory
* @return this operation instance
*/
public DokkaOperation outputDir(String outputDir) {
outputDir_ = new File(outputDir);
return this;
}
/**
* Sets the Dokka {@link OutputFormat output format}.
*
* @param format The {@link OutputFormat output format}
* @return this operation instance
*/
public DokkaOperation outputFormat(OutputFormat format) {
pluginsClasspath_.clear();
if (format.equals(OutputFormat.JAVADOC)) {
pluginsClasspath_.addAll(CompileKotlinOperation.getJarList(project_.libBldDirectory(),
JAVADOC_PLUGIN_REGEXP));
} else if (format.equals(OutputFormat.HTML)) {
pluginsClasspath_.addAll(CompileKotlinOperation.getJarList(project_.libBldDirectory(),
HTML_PLUGIN_REGEXP));
} else if (format.equals(OutputFormat.MARKDOWN)) {
pluginsClasspath_.addAll(CompileKotlinOperation.getJarList(project_.libBldDirectory(),
GFM_PLUGIN_REGEXP));
} else if (format.equals(OutputFormat.JEKYLL)) {
pluginsClasspath_.addAll(CompileKotlinOperation.getJarList(project_.libBldDirectory(),
JEKYLL_PLUGIN_REGEXP));
}
return this;
}
/**
* Sets the configuration for Dokka plugins.
*
* @param name The fully-qualified plugin name
* @param jsonConfiguration The plugin JSON configuration
* @return this operation instance
*/
public DokkaOperation pluginConfigurations(String name, String jsonConfiguration) {
pluginsConfiguration_.put(name, jsonConfiguration);
return this;
}
/**
* Sets the configuration for Dokka plugins.
*
* @param pluginConfiguratione the map of configurations
* @return this operation instance
* @see #pluginConfigurations(String, String)
*/
public DokkaOperation pluginConfigurations(Map
* Individual and additional configuration of Kotlin source sets.
*
* @param sourceSet the source set configurations
* @return this operation instance
*/
public DokkaOperation sourceSet(SourceSet sourceSet) {
sourceSet_ = sourceSet;
return this;
}
/**
* Sets whether to suppress inherited members that aren't explicitly overridden in a given class.
*
* @param suppressInheritedMembers {@code true} or {@code false}
* @return this operation instance
*/
public DokkaOperation suppressInheritedMembers(Boolean suppressInheritedMembers) {
suppressInheritedMembers_ = suppressInheritedMembers;
return this;
}
}
*
*
* @param options ome pr more package configurations
* @return this operation instance
*/
public DokkaOperation globalPackageOptions(String... options) {
globalPackageOptions_.addAll(Arrays.asList(options));
return this;
}
/**
* Sets the global list of package configurations.
*
*
*
* @param options the list of package configurations
* @return this operation instance
*/
public DokkaOperation globalPackageOptions(Collection
*
*
* @param noSuppressObviousFunctions {@code true} or {@code false}
* @return this operation instance
*/
public DokkaOperation noSuppressObviousFunctions(Boolean noSuppressObviousFunctions) {
noSuppressObviousFunctions_ = noSuppressObviousFunctions;
return this;
}
/**
* Sets whether to resolve remote files/links over network.
*