diff options
| author | Ignat Beresnev <ignat.beresnev@jetbrains.com> | 2023-11-10 11:46:54 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-10 11:46:54 +0100 |
| commit | 8e5c63d035ef44a269b8c43430f43f5c8eebfb63 (patch) | |
| tree | 1b915207b2b9f61951ddbf0ff2e687efd053d555 /dokka-integration-tests/maven/projects | |
| parent | a44efd4ba0c2e4ab921ff75e0f53fc9335aa79db (diff) | |
| download | dokka-8e5c63d035ef44a269b8c43430f43f5c8eebfb63.tar.gz dokka-8e5c63d035ef44a269b8c43430f43f5c8eebfb63.tar.bz2 dokka-8e5c63d035ef44a269b8c43430f43f5c8eebfb63.zip | |
Restructure the project to utilize included builds (#3174)
* Refactor and simplify artifact publishing
* Update Gradle to 8.4
* Refactor and simplify convention plugins and build scripts
Fixes #3132
---------
Co-authored-by: Adam <897017+aSemy@users.noreply.github.com>
Co-authored-by: Oleg Yukhnevich <whyoleg@gmail.com>
Diffstat (limited to 'dokka-integration-tests/maven/projects')
11 files changed, 356 insertions, 0 deletions
diff --git a/dokka-integration-tests/maven/projects/biojava/biojava b/dokka-integration-tests/maven/projects/biojava/biojava new file mode 160000 +Subproject 059fbf1403d0704801df1427b0ec925102a645c diff --git a/dokka-integration-tests/maven/projects/biojava/biojava.diff b/dokka-integration-tests/maven/projects/biojava/biojava.diff new file mode 100644 index 00000000..33082722 --- /dev/null +++ b/dokka-integration-tests/maven/projects/biojava/biojava.diff @@ -0,0 +1,37 @@ +diff --git a/pom.xml b/pom.xml +index 7e3e806d1..765b6dea3 100644 +--- a/pom.xml ++++ b/pom.xml +@@ -31,6 +31,12 @@ + <distribution>repo</distribution> + </license> + </licenses> ++ <pluginRepositories> ++ <pluginRepository> ++ <id>space</id> ++ <url>https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven/</url> ++ </pluginRepository> ++ </pluginRepositories> + <properties> + <!-- Notice: if using java 9 or 10 jres, it is possible to simply use here "8", "9" or "10". But if using java 8 jre, "8" is not an allowed value but only "1.8"--> + <jdk.version>1.8</jdk.version> +@@ -338,6 +356,19 @@ + + + <plugins> ++ <plugin> ++ <groupId>org.jetbrains.dokka</groupId> ++ <artifactId>dokka-maven-plugin</artifactId> ++ <version>${dokka_version}</version> ++ <executions> ++ <execution> ++ <phase>pre-site</phase> ++ <goals> ++ <goal>javadoc</goal> ++ </goals> ++ </execution> ++ </executions> ++ </plugin> + + <!-- give more memory for junit tests --> + <plugin> diff --git a/dokka-integration-tests/maven/projects/it-maven/customResources/custom-resource.svg b/dokka-integration-tests/maven/projects/it-maven/customResources/custom-resource.svg new file mode 100644 index 00000000..c4b95383 --- /dev/null +++ b/dokka-integration-tests/maven/projects/it-maven/customResources/custom-resource.svg @@ -0,0 +1,7 @@ +<!-- + - Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. + --> + +<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg"> + <path d="M18 9C18 14 14 18 9 18C4 18 0 14 0 9C0 4 4 0 9 0C14 0 18 4 18 9ZM14.2 6.2L12.8 4.8L7.5 10.1L5.3 7.8L3.8 9.2L7.5 13L14.2 6.2Z" fill="#4DBB5F"/> +</svg> diff --git a/dokka-integration-tests/maven/projects/it-maven/customResources/custom-style-to-add.css b/dokka-integration-tests/maven/projects/it-maven/customResources/custom-style-to-add.css new file mode 100644 index 00000000..f949ca1c --- /dev/null +++ b/dokka-integration-tests/maven/projects/it-maven/customResources/custom-style-to-add.css @@ -0,0 +1,5 @@ +/* + * Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. + */ + +/* custom stylesheet */ diff --git a/dokka-integration-tests/maven/projects/it-maven/customResources/logo-styles.css b/dokka-integration-tests/maven/projects/it-maven/customResources/logo-styles.css new file mode 100644 index 00000000..c7932753 --- /dev/null +++ b/dokka-integration-tests/maven/projects/it-maven/customResources/logo-styles.css @@ -0,0 +1,7 @@ +/* + * Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. + */ + +:root { + --dokka-logo-image-url: url('https://upload.wikimedia.org/wikipedia/commons/9/9d/Ubuntu_logo.svg'); +} diff --git a/dokka-integration-tests/maven/projects/it-maven/pom.xml b/dokka-integration-tests/maven/projects/it-maven/pom.xml new file mode 100644 index 00000000..6246e27a --- /dev/null +++ b/dokka-integration-tests/maven/projects/it-maven/pom.xml @@ -0,0 +1,192 @@ +<!-- + ~ Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. + --> + +<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>it-maven</artifactId> + <version>1.0-SNAPSHOT</version> + + <properties> + <kotlin.version>1.9.20</kotlin.version> + </properties> + <build> + <plugins> + <plugin> + <groupId>org.jetbrains.kotlin</groupId> + <artifactId>kotlin-maven-plugin</artifactId> + <version>${kotlin.version}</version> + <executions> + <execution> + <id>compile</id> + <goals> + <goal>compile</goal> + </goals> + <configuration> + <sourceDirs> + <sourceDir>${project.basedir}/src/main/kotlin</sourceDir> + <sourceDir>${project.basedir}/src/main/java</sourceDir> + </sourceDirs> + </configuration> + </execution> + <execution> + <id>test-compile</id> + <goals> + <goal>test-compile</goal> + </goals> + <configuration> + <sourceDirs> + <sourceDir>${project.basedir}/src/test/kotlin</sourceDir> + <sourceDir>${project.basedir}/src/test/java</sourceDir> + </sourceDirs> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>3.5.1</version> + <executions> + <!-- Replacing default-compile as it is treated specially by maven --> + <execution> + <id>default-compile</id> + <phase>none</phase> + </execution> + <!-- Replacing default-testCompile as it is treated specially by maven --> + <execution> + <id>default-testCompile</id> + <phase>none</phase> + </execution> + <execution> + <id>java-compile</id> + <phase>compile</phase> + <goals> + <goal>compile</goal> + </goals> + </execution> + <execution> + <id>java-test-compile</id> + <phase>test-compile</phase> + <goals> + <goal>testCompile</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> + + <!-- Set to true to skip dokka task, default: false --> + <skip>false</skip> + + <!-- Default: ${project.artifactId} --> + <moduleName>Maven Integration Test Module</moduleName> + + <!-- Default: ${project.basedir}/target/dokka --> + <outputDir>${project.basedir}/output</outputDir> + + <!-- Use default or set to custom path to cache directory to enable package-list caching. --> + <!-- When set to default, caches stored in $USER_HOME/.cache/dokka --> + <cacheRoot>default</cacheRoot> + + + <!-- Used for linking to JDK, default: 6 --> + <jdkVersion>8</jdkVersion> + + <!-- Do not output deprecated members, applies globally, can be overridden by packageOptions --> + <skipDeprecated>false</skipDeprecated> + <!-- Emit warnings about not documented members, applies globally, also can be overridden by packageOptions --> + <reportUndocumented>true</reportUndocumented> + <!-- Do not create index pages for empty packages --> + <skipEmptyPackages>true</skipEmptyPackages> + + <!-- Short form list of sourceRoots, by default, set to ${project.compileSourceRoots} --> + <sourceDirectories> + <dir>${project.basedir}/src/main/kotlin</dir> + <dir>${project.basedir}/src/main/java</dir> + </sourceDirectories> + + <documentedVisibilities> + <visibility>PUBLIC</visibility> + <visibility>PROTECTED</visibility> + </documentedVisibilities> + + <!-- Disable linking to online kotlin-stdlib documentation --> + <noStdlibLink>false</noStdlibLink> + + <!-- Disable linking to online JDK documentation --> + <noJdkLink>false</noJdkLink> + + <suppressObviousFunctions>false</suppressObviousFunctions> + + <!-- Allows to customize documentation generation options on a per-package basis --> + <perPackageOptions> + <packageOptions> + <!-- Will match kotlin and all sub-packages of it --> + <matchingRegex>kotlin</matchingRegex> + + <!-- All options are optional, default values are below: --> + <skipDeprecated>false</skipDeprecated> + <!-- Emit warnings about not documented members --> + <reportUndocumented>true</reportUndocumented> + <includeNonPublic>false</includeNonPublic> + </packageOptions> + + <packageOptions> + <matchingRegex>it.overriddenVisibility.*</matchingRegex> + <documentedVisibilities> + <visibility>PRIVATE</visibility> + </documentedVisibilities> + </packageOptions> + </perPackageOptions> + <pluginsConfiguration> + <org.jetbrains.dokka.base.DokkaBase> + <customAssets> + <customAsset>${project.basedir}/customResources/custom-resource.svg</customAsset> + </customAssets> + <customStyleSheets> + <customStyleSheet>${project.basedir}/customResources/logo-styles.css</customStyleSheet> + <customStyleSheet>${project.basedir}/customResources/custom-style-to-add.css</customStyleSheet> + </customStyleSheets> + </org.jetbrains.dokka.base.DokkaBase> + </pluginsConfiguration> + </configuration> + </plugin> + </plugins> + <sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory> + <testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory> + </build> + + <pluginRepositories> + <pluginRepository> + <id>Space</id> + <name>Space</name> + <url>https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven/</url> + </pluginRepository> + </pluginRepositories> + + <dependencies> + <dependency> + <groupId>org.jetbrains.kotlin</groupId> + <artifactId>kotlin-stdlib</artifactId> + <version>${kotlin.version}</version> + </dependency> + </dependencies> + + +</project> diff --git a/dokka-integration-tests/maven/projects/it-maven/src/main/java/it/basic/java/SampleJavaClass.java b/dokka-integration-tests/maven/projects/it-maven/src/main/java/it/basic/java/SampleJavaClass.java new file mode 100644 index 00000000..e08bb66a --- /dev/null +++ b/dokka-integration-tests/maven/projects/it-maven/src/main/java/it/basic/java/SampleJavaClass.java @@ -0,0 +1,22 @@ +package it.basic.java; + +import it.basic.PublicClass; + +/** + * This class is, unlike {@link PublicClass}, written in Java + */ +@SuppressWarnings("unused") +public class SampleJavaClass { + + /** + * @return Empty instance of {@link PublicClass} + */ + public PublicClass publicDocumentedFunction() { + return new PublicClass(); + } + + + public PublicClass publicUndocumentedFunction() { + return new PublicClass(); + } +} diff --git a/dokka-integration-tests/maven/projects/it-maven/src/main/kotlin/it/basic/PublicClass.kt b/dokka-integration-tests/maven/projects/it-maven/src/main/kotlin/it/basic/PublicClass.kt new file mode 100644 index 00000000..d7a72392 --- /dev/null +++ b/dokka-integration-tests/maven/projects/it-maven/src/main/kotlin/it/basic/PublicClass.kt @@ -0,0 +1,57 @@ +@file:Suppress("unused") + +package it.basic + +/** + * §PUBLIC§ (marker for asserts) + */ +class PublicClass { + /** + * This function is public and documented + */ + fun publicDocumentedFunction(): String = "" + + fun publicUndocumentedFunction(): String = "" + + /** + * This function is internal and documented + */ + internal fun internalDocumentedFunction(): String = "" + + internal fun internalUndocumentedFunction(): String = "" + + /** + * This function is private and documented + */ + private fun privateDocumentedFunction(): String = "" + + private fun privateUndocumentedFunction(): String = "" + + /** + * This function is protected and documented + */ + protected fun protectedDocumentedFunction(): String = "" + + protected fun protectedUndocumentedFunction(): String = "" + + /** + * This property is public and documented + */ + val publicDocumentedProperty: Int = 0 + + val publicUndocumentedProperty: Int = 0 + + /** + * This property internal and documented + */ + val internalDocumentedProperty: Int = 0 + + val internalUndocumentedProperty: Int = 0 + + /** + * This property private and documented + */ + private val privateDocumentedProperty: Int = 0 + + private val privateUndocumentedProperty: Int = 0 +} diff --git a/dokka-integration-tests/maven/projects/it-maven/src/main/kotlin/it/internal/InternalClass.kt b/dokka-integration-tests/maven/projects/it-maven/src/main/kotlin/it/internal/InternalClass.kt new file mode 100644 index 00000000..6173d239 --- /dev/null +++ b/dokka-integration-tests/maven/projects/it-maven/src/main/kotlin/it/internal/InternalClass.kt @@ -0,0 +1,7 @@ +package it.internal + +/** + * §INTERNAL§ (marker for asserts) + * This class is internal and should not be rendered + */ +internal class InternalClass diff --git a/dokka-integration-tests/maven/projects/it-maven/src/main/kotlin/it/overriddenVisibility/VisiblePrivateClass.kt b/dokka-integration-tests/maven/projects/it-maven/src/main/kotlin/it/overriddenVisibility/VisiblePrivateClass.kt new file mode 100644 index 00000000..230f5e0b --- /dev/null +++ b/dokka-integration-tests/maven/projects/it-maven/src/main/kotlin/it/overriddenVisibility/VisiblePrivateClass.kt @@ -0,0 +1,12 @@ +package it.overriddenVisibility + +/** + * Private classes and methods generally should not be visible, but [documentedVisibilities] + * are overriden for this specific package to include private code + * + * §PRIVATE§ (marker for asserts) + */ +private class VisiblePrivateClass { + private val privateVal: Int = 0 + private fun privateMethod() {} +}
\ No newline at end of file diff --git a/dokka-integration-tests/maven/projects/it-maven/src/main/kotlin/it/protected/ProtectedClass.kt b/dokka-integration-tests/maven/projects/it-maven/src/main/kotlin/it/protected/ProtectedClass.kt new file mode 100644 index 00000000..ad19f1a1 --- /dev/null +++ b/dokka-integration-tests/maven/projects/it-maven/src/main/kotlin/it/protected/ProtectedClass.kt @@ -0,0 +1,10 @@ +package it.protected + +/** + * Protected class should be visible because it's included in documentedVisibilities + * + * §PROTECTED§ (marker for asserts) + */ +protected class ProtectedClass { + protected fun protectedFun(): String = "protected" +} |
