diff options
Diffstat (limited to 'runners/maven-plugin')
-rw-r--r-- | runners/maven-plugin/build.gradle | 56 | ||||
-rw-r--r-- | runners/maven-plugin/src/main/kotlin/DokkaMojo.kt | 52 |
2 files changed, 32 insertions, 76 deletions
diff --git a/runners/maven-plugin/build.gradle b/runners/maven-plugin/build.gradle index 0e8d6a4d..79a8c22b 100644 --- a/runners/maven-plugin/build.gradle +++ b/runners/maven-plugin/build.gradle @@ -1,4 +1,5 @@ import groovy.io.FileType +import org.jetbrains.CorrectShadowPublishing import org.jetbrains.CrossPlatformExec import java.nio.file.Files @@ -27,6 +28,7 @@ dependencies { shadow "org.codehaus.plexus:plexus-utils:$plexus_utils_version" shadow "org.codehaus.plexus:plexus-archiver:$plexus_archiver_version" shadow "org.apache.maven.plugin-tools:maven-plugin-annotations:$maven_plugin_tools_version" + shadow "com.github.olivergondza:maven-jdk-tools-wrapper:0.1" } task generatePom() { @@ -92,64 +94,14 @@ apply plugin: 'maven-publish' publishing { publications { - dokkaMavenPlugin(MavenPublication) { publication -> + dokkaMavenPlugin(MavenPublication) { MavenPublication publication -> artifactId = 'dokka-maven-plugin' artifact sourceJar { classifier "sources" } - project.shadow.component(publication) - - pom.withXml { - Node root = asNode() - - def dependency = new XmlParser().parseText(''' - <dependency> - <groupId>com.sun</groupId> - <artifactId>tools</artifactId> - <version>1.8.0</version> - <scope>system</scope> - <systemPath>${toolsjar}</systemPath> - </dependency> - ''') - - root.children().find { - return it.name() == "dependencies" - }.append(dependency) - - def profiles = new XmlParser().parseText(''' - <profiles> - <profile> - <id>default-profile</id> - <activation> - <activeByDefault>true</activeByDefault> - <file> - <exists>${java.home}/../lib/tools.jar</exists> - </file> - </activation> - <properties> - <toolsjar>${java.home}/../lib/tools.jar</toolsjar> - </properties> - </profile> - <profile> - <id>mac-profile</id> - <activation> - <activeByDefault>false</activeByDefault> - <file> - <exists>${java.home}/../Classes/classes.jar</exists> - </file> - </activation> - <properties> - <toolsjar>${java.home}/../Classes/classes.jar</toolsjar> - </properties> - </profile> - </profiles> - ''') - root.append(profiles) - } - - + CorrectShadowPublishing.configure(publication, project) } } } diff --git a/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt b/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt index 09da90c6..a2771306 100644 --- a/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt +++ b/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt @@ -36,9 +36,6 @@ abstract class AbstractDokkaMojo : AbstractMojo() { class SourceRoot : DokkaConfiguration.SourceRoot { @Parameter(required = true) override var path: String = "" - - @Parameter - override var platforms: List<String> = emptyList() } class PackageOptions : DokkaConfiguration.PackageOptions { @@ -104,6 +101,9 @@ abstract class AbstractDokkaMojo : AbstractMojo() { @Parameter(defaultValue = "false") var noStdlibLink: Boolean = false + @Parameter(defaultValue = "false") + var noJdkLink: Boolean = false + @Parameter var cacheRoot: String? = null @@ -122,29 +122,33 @@ abstract class AbstractDokkaMojo : AbstractMojo() { return } - val gen = DokkaGenerator( - MavenDokkaLogger(log), - classpath, - sourceDirectories.map { SourceRootImpl(it) } + sourceRoots, - samplesDirs, - includeDirs + includes, - moduleName, - DocumentationOptions(getOutDir(), getOutFormat(), - sourceLinks = sourceLinks.map { SourceLinkDefinitionImpl(it.dir, it.url, it.urlSuffix) }, - jdkVersion = jdkVersion, - skipDeprecated = skipDeprecated, - skipEmptyPackages = skipEmptyPackages, - reportUndocumented = reportNotDocumented, - impliedPlatforms = impliedPlatforms, - perPackageOptions = perPackageOptions, - externalDocumentationLinks = externalDocumentationLinks.map { it.build() }, - noStdlibLink = noStdlibLink, - cacheRoot = cacheRoot, - languageVersion = languageVersion, - apiVersion = apiVersion - ) + val passConfiguration = PassConfigurationImpl( + sourceLinks = sourceLinks.map { SourceLinkDefinitionImpl(it.dir, it.url, it.urlSuffix) }, + jdkVersion = jdkVersion, + skipDeprecated = skipDeprecated, + skipEmptyPackages = skipEmptyPackages, + reportUndocumented = reportNotDocumented, + perPackageOptions = perPackageOptions, + externalDocumentationLinks = externalDocumentationLinks.map { it.build() }, + noStdlibLink = noStdlibLink, + noJdkLink = noJdkLink, + languageVersion = languageVersion, + apiVersion = apiVersion + + ) + + val configuration = DokkaConfigurationImpl( + outputDir = getOutDir(), + format = getOutFormat(), + impliedPlatforms = impliedPlatforms, + cacheRoot = cacheRoot, + passesConfigurations = listOf( + passConfiguration + ) ) + val gen = DokkaGenerator(configuration, MavenDokkaLogger(log)) + gen.generate() } } |