diff options
author | vmishenev <vad-mishenev@yandex.ru> | 2021-07-28 14:57:38 +0300 |
---|---|---|
committer | vmishenev <vad-mishenev@yandex.ru> | 2021-07-28 19:11:50 +0300 |
commit | f03083d7534209ad94dc3c4d7afd17f58e58127d (patch) | |
tree | 8160e6e8d376fc16ad559cfa59048c5447d2e2bd /examples/maven | |
parent | 2cd95b0828518dde751d039f4456dcf93e04dfc1 (diff) | |
download | dokka-f03083d7534209ad94dc3c4d7afd17f58e58127d.tar.gz dokka-f03083d7534209ad94dc3c4d7afd17f58e58127d.tar.bz2 dokka-f03083d7534209ad94dc3c4d7afd17f58e58127d.zip |
Migrate Dokka examples to Dokka repo (KT-47798) (#2030)
* Migrate Dokka examples to Dokka repo (KT-47798)
* Configure workflow of examples checking
* Add workflow to deploy examples
Diffstat (limited to 'examples/maven')
-rw-r--r-- | examples/maven/Module.md | 7 | ||||
-rw-r--r-- | examples/maven/pom.xml | 75 | ||||
-rw-r--r-- | examples/maven/src/main/kotlin/HelloWorld.kt | 20 |
3 files changed, 102 insertions, 0 deletions
diff --git a/examples/maven/Module.md b/examples/maven/Module.md new file mode 100644 index 00000000..f490749a --- /dev/null +++ b/examples/maven/Module.md @@ -0,0 +1,7 @@ +# Module dokka-maven-example + +This is an example of how you can write module documentation with Dokka. + +# Package demo + +This package contains a few examples of Dokka usage. diff --git a/examples/maven/pom.xml b/examples/maven/pom.xml new file mode 100644 index 00000000..18b36715 --- /dev/null +++ b/examples/maven/pom.xml @@ -0,0 +1,75 @@ +<?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.kotlin.examples</groupId> + <artifactId>kotlin-maven-example</artifactId> + <version>1.0-SNAPSHOT</version> + <properties> + <kotlin.version>1.4.32</kotlin.version> + <dokka.version>1.4.32</dokka.version> + </properties> + + <dependencies> + <dependency> + <groupId>org.jetbrains.kotlin</groupId> + <artifactId>kotlin-stdlib</artifactId> + <version>${kotlin.version}</version> + </dependency> + </dependencies> + + <build> + <sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory> + + <plugins> + <plugin> + <artifactId>kotlin-maven-plugin</artifactId> + <groupId>org.jetbrains.kotlin</groupId> + <version>${kotlin.version}</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.jetbrains.dokka</groupId> + <artifactId>dokka-maven-plugin</artifactId> + <version>${dokka.version}</version> + <executions> + <execution> + <phase>pre-site</phase> + <goals> + <goal>dokka</goal> + </goals> + </execution> + </executions> + <configuration> + <sourceLinks> + <link> + <path>${project.basedir}</path> + <url>https://github.com/JetBrains/kotlin-examples/blob/master/maven/dokka-maven-example</url> + <lineSuffix>#L</lineSuffix> + </link> + </sourceLinks> + </configuration> + </plugin> + </plugins> + </build> +</project> diff --git a/examples/maven/src/main/kotlin/HelloWorld.kt b/examples/maven/src/main/kotlin/HelloWorld.kt new file mode 100644 index 00000000..172e18f7 --- /dev/null +++ b/examples/maven/src/main/kotlin/HelloWorld.kt @@ -0,0 +1,20 @@ +package demo + +/** + * This class supports greeting people by name. + * + * @property name The name of the person to be greeted. + */ +class Greeter(val name: String) { + + /** + * Prints the greeting to the standard output. + */ + fun greet() { + println("Hello $name!") + } +} + +fun main(args: Array<String>) { + Greeter(args[0]).greet() +} |