diff options
author | Simon Ogorodnik <sem-oro@yandex.ru> | 2016-11-01 02:10:32 +0300 |
---|---|---|
committer | Simon Ogorodnik <Simon.Ogorodnik@jetbrains.com> | 2016-11-01 14:46:01 +0300 |
commit | 769701f99a1aefbc9d385c1938c9c7d3a7b2e38e (patch) | |
tree | c3ea4802d9e627c90870808aba9343eb224a114c /maven-plugin | |
parent | 08bcaa257f7b48929af6ee29007dd6f0d7bb1b52 (diff) | |
download | dokka-769701f99a1aefbc9d385c1938c9c7d3a7b2e38e.tar.gz dokka-769701f99a1aefbc9d385c1938c9c7d3a7b2e38e.tar.bz2 dokka-769701f99a1aefbc9d385c1938c9c7d3a7b2e38e.zip |
Total build refactoring, prepare for new development iteration
Removed old and useless build helpers
Remove old .xml's from .idea and add .idea/shelf to .gitignore
build-docs.xml fixed, dokka_version set to 0.9.10
Diffstat (limited to 'maven-plugin')
-rw-r--r-- | maven-plugin/dokka-maven-plugin.iml | 46 | ||||
-rw-r--r-- | maven-plugin/pom.xml | 181 | ||||
-rw-r--r-- | maven-plugin/src/main/kotlin/DokkaMojo.kt | 179 | ||||
-rw-r--r-- | maven-plugin/src/main/kotlin/MavenDokkaLogger.kt | 18 |
4 files changed, 0 insertions, 424 deletions
diff --git a/maven-plugin/dokka-maven-plugin.iml b/maven-plugin/dokka-maven-plugin.iml deleted file mode 100644 index 1c05c571..00000000 --- a/maven-plugin/dokka-maven-plugin.iml +++ /dev/null @@ -1,46 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4"> - <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5" inherit-compiler-output="false"> - <output url="file://$MODULE_DIR$/target/classes" /> - <output-test url="file://$MODULE_DIR$/target/test-classes" /> - <content url="file://$MODULE_DIR$"> - <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" /> - <sourceFolder url="file://$MODULE_DIR$/src/main/kotlin" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/target/generated-sources/plugin" isTestSource="false" generated="true" /> - <excludeFolder url="file://$MODULE_DIR$/target/archive-tmp" /> - <excludeFolder url="file://$MODULE_DIR$/target/lib" /> - <excludeFolder url="file://$MODULE_DIR$/target/maven-archiver" /> - <excludeFolder url="file://$MODULE_DIR$/target/maven-status" /> - <excludeFolder url="file://$MODULE_DIR$/target/myrepo" /> - <excludeFolder url="file://$MODULE_DIR$/target/surefire" /> - </content> - <orderEntry type="inheritedJdk" /> - <orderEntry type="sourceFolder" forTests="false" /> - <orderEntry type="library" name="Maven: org.apache.maven:maven-core:3.0.5" level="project" /> - <orderEntry type="library" name="Maven: org.apache.maven:maven-settings:3.0.5" level="project" /> - <orderEntry type="library" name="Maven: org.apache.maven:maven-settings-builder:3.0.5" level="project" /> - <orderEntry type="library" name="Maven: org.apache.maven:maven-repository-metadata:3.0.5" level="project" /> - <orderEntry type="library" name="Maven: org.apache.maven:maven-artifact:3.0.5" level="project" /> - <orderEntry type="library" name="Maven: org.apache.maven:maven-model-builder:3.0.5" level="project" /> - <orderEntry type="library" name="Maven: org.apache.maven:maven-aether-provider:3.0.5" level="project" /> - <orderEntry type="library" name="Maven: org.sonatype.aether:aether-spi:1.13.1" level="project" /> - <orderEntry type="library" name="Maven: org.sonatype.aether:aether-impl:1.13.1" level="project" /> - <orderEntry type="library" name="Maven: org.sonatype.aether:aether-api:1.13.1" level="project" /> - <orderEntry type="library" name="Maven: org.sonatype.aether:aether-util:1.13.1" level="project" /> - <orderEntry type="library" name="Maven: org.sonatype.sisu:sisu-inject-plexus:2.3.0" level="project" /> - <orderEntry type="library" name="Maven: org.sonatype.sisu:sisu-inject-bean:2.3.0" level="project" /> - <orderEntry type="library" name="Maven: org.sonatype.sisu:sisu-guice:no_aop:3.1.0" level="project" /> - <orderEntry type="library" name="Maven: org.sonatype.sisu:sisu-guava:0.9.9" level="project" /> - <orderEntry type="library" name="Maven: org.codehaus.plexus:plexus-interpolation:1.14" level="project" /> - <orderEntry type="library" name="Maven: org.codehaus.plexus:plexus-classworlds:2.4" level="project" /> - <orderEntry type="library" name="Maven: org.codehaus.plexus:plexus-component-annotations:1.5.5" level="project" /> - <orderEntry type="library" name="Maven: org.sonatype.plexus:plexus-sec-dispatcher:1.3" level="project" /> - <orderEntry type="library" name="Maven: org.sonatype.plexus:plexus-cipher:1.4" level="project" /> - <orderEntry type="library" name="Maven: org.apache.maven:maven-model:3.0.5" level="project" /> - <orderEntry type="library" name="Maven: org.apache.maven:maven-plugin-api:3.0.5" level="project" /> - <orderEntry type="library" name="Maven: org.codehaus.plexus:plexus-utils:3.0.22" level="project" /> - <orderEntry type="library" name="Maven: org.apache.maven.plugin-tools:maven-plugin-annotations:3.4" level="project" /> - <orderEntry type="library" name="Maven: org.jetbrains.dokka:dokka-fatjar:0.0.1-SNAPSHOT" level="project" /> - <orderEntry type="library" scope="RUNTIME" name="Maven: org.fusesource.jansi:jansi:1.11" level="project" /> - </component> -</module>
\ No newline at end of file diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml deleted file mode 100644 index 59b8d5c1..00000000 --- a/maven-plugin/pom.xml +++ /dev/null @@ -1,181 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - <groupId>org.jetbrains.dokka</groupId> - <artifactId>dokka-maven-plugin</artifactId> - <version>0.9.9</version> - <packaging>maven-plugin</packaging> - <properties> - <maven-plugin-anno.version>1.4.1</maven-plugin-anno.version> - <maven.version>3.0.5</maven.version> - <plexus.version>3.0.22</plexus.version> - <kotlinVersion>1.0.3</kotlinVersion> - </properties> - <dependencies> - <dependency> - <groupId>org.apache.maven</groupId> - <artifactId>maven-core</artifactId> - <version>${maven.version}</version> - </dependency> - <dependency> - <groupId>org.apache.maven</groupId> - <artifactId>maven-model</artifactId> - <version>${maven.version}</version> - </dependency> - <dependency> - <groupId>org.apache.maven</groupId> - <artifactId>maven-plugin-api</artifactId> - <version>${maven.version}</version> - </dependency> - <dependency> - <groupId>org.apache.maven</groupId> - <artifactId>maven-archiver</artifactId> - <version>2.5</version> - </dependency> - <dependency> - <groupId>org.codehaus.plexus</groupId> - <artifactId>plexus-utils</artifactId> - <version>${plexus.version}</version> - </dependency> - <dependency> - <groupId>org.codehaus.plexus</groupId> - <artifactId>plexus-archiver</artifactId> - <version>2.5</version> - </dependency> - <dependency> - <groupId>org.apache.maven.plugin-tools</groupId> - <artifactId>maven-plugin-annotations</artifactId> - <version>3.4</version> - </dependency> - <dependency> - <groupId>org.jetbrains.dokka</groupId> - <artifactId>dokka-fatjar</artifactId> - <version>${version}</version> - <type>jar</type> - <scope>compile</scope> - </dependency> - <dependency> - <groupId>com.sun</groupId> - <artifactId>tools</artifactId> - <version>1.8.0</version> - <scope>system</scope> - <systemPath>${toolsjar}</systemPath> - </dependency> - </dependencies> - <build> - <sourceDirectory>src/main/kotlin</sourceDirectory> - <plugins> - <plugin> - <groupId>org.jetbrains.kotlin</groupId> - <artifactId>kotlin-maven-plugin</artifactId> - <version>${kotlinVersion}</version> - <executions> - <execution> - <id>compile</id> - <phase>compile</phase> - <goals> - <goal>compile</goal> - </goals> - </execution> - <execution> - <id>test-compile</id> - <phase>test-compile</phase> - <goals> - <goal>test-compile</goal> - </goals> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-plugin-plugin</artifactId> - <version>3.4</version> - <executions> - <execution> - <id>default-descriptor</id> - <goals> - <goal>descriptor</goal> - </goals> - <phase>process-classes</phase> - </execution> - <execution> - <id>help-descriptor</id> - <goals> - <goal>helpmojo</goal> - </goals> - <phase>process-classes</phase> - </execution> - </executions> - <configuration> - <goalPrefix>dokka</goalPrefix> - </configuration> - </plugin> - <plugin> - <artifactId>maven-source-plugin</artifactId> - <version>2.4</version> - <executions> - <execution> - <id>attach-sources</id> - <phase>verify</phase> - <goals> - <goal>jar-no-fork</goal> - </goals> - </execution> - </executions> - </plugin> - <plugin> - <artifactId>maven-jar-plugin</artifactId> - <version>2.6</version> - </plugin> - </plugins> - </build> - <pluginRepositories> - <pluginRepository> - <id>sonatype.oss.snapshots</id> - <name>Sonatype OSS Snapshot Repository</name> - <url>http://oss.sonatype.org/content/repositories/snapshots</url> - <releases> - <enabled>false</enabled> - </releases> - <snapshots> - <enabled>true</enabled> - </snapshots> - </pluginRepository> - <pluginRepository> - <id>kotlin.eap</id> - <name>Kotlin EAP</name> - <url>https://dl.bintray.com/kotlin/kotlin-eap</url> - <releases> - <enabled>true</enabled> - </releases> - <snapshots> - <enabled>false</enabled> - </snapshots> - </pluginRepository> - </pluginRepositories> - <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> -</project> diff --git a/maven-plugin/src/main/kotlin/DokkaMojo.kt b/maven-plugin/src/main/kotlin/DokkaMojo.kt deleted file mode 100644 index 899d2dde..00000000 --- a/maven-plugin/src/main/kotlin/DokkaMojo.kt +++ /dev/null @@ -1,179 +0,0 @@ -package org.jetbrains.dokka.maven - -import org.apache.maven.archiver.MavenArchiveConfiguration -import org.apache.maven.archiver.MavenArchiver -import org.apache.maven.execution.MavenSession -import org.apache.maven.plugin.AbstractMojo -import org.apache.maven.plugins.annotations.* -import org.apache.maven.project.MavenProject -import org.apache.maven.project.MavenProjectHelper -import org.jetbrains.dokka.DokkaGenerator -import org.jetbrains.dokka.SourceLinkDefinition -import org.jetbrains.dokka.DocumentationOptions -import org.codehaus.plexus.archiver.Archiver -import org.codehaus.plexus.archiver.jar.JarArchiver -import java.io.File - -class SourceLinkMapItem { - @Parameter(name = "dir", required = true) - var dir: String = "" - - @Parameter(name = "url", required = true) - var url: String = "" - - @Parameter(name = "urlSuffix") - var urlSuffix: String? = null -} - -abstract class AbstractDokkaMojo : AbstractMojo() { - @Parameter(required = true, defaultValue = "\${project.compileSourceRoots}") - var sourceDirectories: List<String> = emptyList() - - @Parameter - var samplesDirs: List<String> = emptyList() - - @Parameter - @Deprecated("Use <includes> instead") - var includeDirs: List<String> = emptyList() - - @Parameter - var includes: List<String> = emptyList() - - @Parameter(required = true, defaultValue = "\${project.compileClasspathElements}") - var classpath: List<String> = emptyList() - - @Parameter - var sourceLinks: Array<SourceLinkMapItem> = emptyArray() - - @Parameter(required = true, defaultValue = "\${project.artifactId}") - var moduleName: String = "" - - @Parameter(required = false, defaultValue = "false") - var skip: Boolean = false - - @Parameter(required = false, defaultValue = "6") - var jdkVersion: Int = 6 - - protected abstract fun getOutDir(): String - protected abstract fun getOutFormat(): String - - override fun execute() { - if (skip) { - log.info("Dokka skip parameter is true so no dokka output will be produced") - return - } - - val gen = DokkaGenerator( - MavenDokkaLogger(log), - classpath, - sourceDirectories, - samplesDirs, - includeDirs + includes, - moduleName, - DocumentationOptions(getOutDir(), getOutFormat(), - sourceLinks = sourceLinks.map { SourceLinkDefinition(it.dir, it.url, it.urlSuffix) }, - jdkVersion = jdkVersion - ) - ) - - gen.generate() - } -} - -@Mojo(name = "dokka", defaultPhase = LifecyclePhase.PRE_SITE, threadSafe = true, requiresDependencyResolution = ResolutionScope.COMPILE, requiresProject = true) -class DokkaMojo : AbstractDokkaMojo() { - @Parameter(required = true, defaultValue = "html") - var outputFormat: String = "html" - - @Parameter(required = true, defaultValue = "\${project.basedir}/target/dokka") - var outputDir: String = "" - - override fun getOutFormat() = outputFormat - override fun getOutDir() = outputDir -} - -@Mojo(name = "javadoc", defaultPhase = LifecyclePhase.PRE_SITE, threadSafe = true, requiresDependencyResolution = ResolutionScope.COMPILE, requiresProject = true) -class DokkaJavadocMojo : AbstractDokkaMojo() { - @Parameter(required = true, defaultValue = "\${project.basedir}/target/dokkaJavadoc") - var outputDir: String = "" - - override fun getOutFormat() = "javadoc" - override fun getOutDir() = outputDir -} - -@Mojo(name = "javadocJar", defaultPhase = LifecyclePhase.PRE_SITE, threadSafe = true, requiresDependencyResolution = ResolutionScope.COMPILE, requiresProject = true) -class DokkaJavadocJarMojo : AbstractDokkaMojo() { - @Parameter(required = true, defaultValue = "\${project.basedir}/target/dokkaJavadocJar") - var outputDir: String = "" - - /** - * Specifies the directory where the generated jar file will be put. - */ - @Parameter(property = "project.build.directory") - private var jarOutputDirectory: String? = null - - /** - * Specifies the filename that will be used for the generated jar file. Please note that `-javadoc` - * or `-test-javadoc` will be appended to the file name. - */ - @Parameter(property = "project.build.finalName") - private var finalName: String? = null - - /** - * Specifies whether to attach the generated artifact to the project helper. - */ - @Parameter(property = "attach", defaultValue = "true") - private val attach: Boolean = false - - /** - * The archive configuration to use. - * See [Maven Archiver Reference](http://maven.apache.org/shared/maven-archiver/index.html) - */ - @Parameter - private val archive = MavenArchiveConfiguration() - - @Parameter(property = "maven.javadoc.classifier", defaultValue = "javadoc", required = true) - private var classifier: String? = null - - @Parameter(defaultValue = "\${session}", readonly = true, required = true) - protected var session: MavenSession? = null - - @Parameter(defaultValue = "\${project}", readonly = true, required = true) - protected var project: MavenProject? = null - - @Component - private var projectHelper: MavenProjectHelper? = null - - @Component(role = Archiver::class, hint = "jar") - private var jarArchiver: JarArchiver? = null - - override fun getOutFormat() = "javadoc" - override fun getOutDir() = outputDir - - override fun execute() { - super.execute() - if(!File(outputDir).exists()) { - log.warn("No javadoc generated so no javadoc jar will be generated") - return - } - val outputFile = generateArchive("$finalName-$classifier.jar") - if (attach) { - projectHelper?.attachArtifact(project, "javadoc", classifier, outputFile) - } - } - - private fun generateArchive(jarFileName: String): File { - val javadocJar = File(jarOutputDirectory, jarFileName) - - val archiver = MavenArchiver() - archiver.setArchiver(jarArchiver) - archiver.setOutputFile(javadocJar) - archiver.archiver.addDirectory(File(outputDir), arrayOf("**/**"), arrayOf()) - - archive.setAddMavenDescriptor(false) - archiver.createArchive(session, project, archive) - - return javadocJar - } -} - diff --git a/maven-plugin/src/main/kotlin/MavenDokkaLogger.kt b/maven-plugin/src/main/kotlin/MavenDokkaLogger.kt deleted file mode 100644 index a535c807..00000000 --- a/maven-plugin/src/main/kotlin/MavenDokkaLogger.kt +++ /dev/null @@ -1,18 +0,0 @@ -package org.jetbrains.dokka.maven - -import org.apache.maven.plugin.logging.Log -import org.jetbrains.dokka.DokkaLogger - -class MavenDokkaLogger(val log: Log) : DokkaLogger { - override fun error(message: String) { - log.error(message) - } - - override fun info(message: String) { - log.info(message) - } - - override fun warn(message: String) { - log.warn(message) - } -}
\ No newline at end of file |