Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into fix/maven_plugin_help
Browse files Browse the repository at this point in the history
# Conflicts:
#	runners/maven-plugin/build.gradle.kts
  • Loading branch information
aSemy committed Sep 3, 2023
2 parents a0b6a43 + 61619d5 commit 571b44d
Show file tree
Hide file tree
Showing 1,052 changed files with 21,418 additions and 9,363 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
name: Deploy MkDocs to GitHub Pages
name: Deploy developer docs to GitHub Pages

on:
workflow_dispatch:
push:
branches:
- master
paths:
- 'mkdocs/**'
- 'docs-developer/**'
release:
types: [ published ]

Expand All @@ -25,7 +26,7 @@ jobs:
- uses: gradle/gradle-build-action@v2
with:
gradle-home-cache-cleanup: true
- name: Get current dokka version
- name: Get current Dokka version
run: echo "DOKKA_VERSION=`./gradlew :properties | grep '^version:.*' | cut -d ' ' -f 2`" >> $GITHUB_ENV
working-directory: ./dokka
- name: Build docs
Expand All @@ -35,6 +36,6 @@ jobs:
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dokka/mkdocs/build/mkdocs
publish_dir: ./dokka/docs-developer/build/mkdocs
keep_files: true
full_commit_message: Publish ${{ env.DOKKA_VERSION }} documentation
14 changes: 10 additions & 4 deletions .github/workflows/tests-smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true

env:
JAVA_TEST_VERSION: 11

jobs:
test-matrix:
strategy:
Expand All @@ -21,15 +24,18 @@ jobs:
java-version: 17
cache: 'maven'
- uses: gradle/gradle-build-action@v2
env:
ORG_GRADLE_PROJECT_org.jetbrains.dokka.javaToolchain.test: 11
with:
gradle-home-cache-cleanup: true
- name: Run tests under Windows
if: matrix.os == 'windows-latest'
# Running tests with the Gradle daemon on windows agents leads to some very strange
# JVM crashes for some reason. Most likely a problem of Gradle/GitHub/Windows server
run: ./gradlew clean test --stacktrace --no-daemon --no-parallel "-Dorg.gradle.jvmargs=-Xmx1g -XX:MaxMetaspaceSize=500m"
run: >
./gradlew clean test --stacktrace --no-daemon --no-parallel
"-Dorg.gradle.jvmargs=-Xmx1g -XX:MaxMetaspaceSize=500m"
"-Porg.jetbrains.dokka.javaToolchain.testLauncher=${{ env.JAVA_TEST_VERSION }}"
- name: Run tests under Ubuntu
if: matrix.os != 'windows-latest'
run: ./gradlew clean test --stacktrace
run: >
./gradlew clean test --stacktrace
"-Porg.jetbrains.dokka.javaToolchain.testLauncher=${{ env.JAVA_TEST_VERSION }}"
11 changes: 7 additions & 4 deletions .github/workflows/tests-thorough.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,18 @@ jobs:
java-version: 17
cache: 'maven'
- uses: gradle/gradle-build-action@v2
env:
ORG_GRADLE_PROJECT_org.jetbrains.dokka.javaToolchain.test: ${{ matrix.javaVersion }}
with:
gradle-home-cache-cleanup: true
- name: Run tests under Windows
if: matrix.os == 'windows-latest'
# Running tests with the Gradle daemon on windows agents leads to some very strange
# JVM crashes for some reason. Most likely a problem of Gradle/GitHub/Windows server
run: ./gradlew clean test --stacktrace --no-daemon --no-parallel "-Dorg.gradle.jvmargs=-Xmx1g -XX:MaxMetaspaceSize=500m"
run: >
./gradlew clean test --stacktrace --no-daemon --no-parallel
"-Dorg.gradle.jvmargs=-Xmx1g -XX:MaxMetaspaceSize=500m"
"-Porg.jetbrains.dokka.javaToolchain.testLauncher=${{ matrix.javaVersion }}"
- name: Run tests under Ubuntu/Macos
if: matrix.os != 'windows-latest'
run: ./gradlew clean test --stacktrace
run: >
./gradlew clean test --stacktrace
"-Porg.jetbrains.dokka.javaToolchain.testLauncher=${{ matrix.javaVersion }}"
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
hs_err_pid*

### IntelliJ

.idea/
.idea/*
!.idea/copyright
!.idea/codeStyles
**/.idea
/out/

## File-based project format:
Expand Down
10 changes: 10 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/copyright/Dokka.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .idea/copyright/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion .run/it-multiplatform-0_dokka.run.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<!--
~ Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
-->

<component name="ProjectRunConfigurationManager">
<configuration default="false" name="it-multiplatform-0:dokka" type="GradleRunConfiguration" factoryName="Gradle" folderName="sample-projects">
<ExternalSystemSettings>
Expand All @@ -21,4 +25,4 @@
<option name="Gradle.BeforeRunTask" enabled="false" tasks="publishToMavenLocal" externalProjectPath="$PROJECT_DIR$" vmOptions="" scriptParameters="" />
</method>
</configuration>
</component>
</component>
12 changes: 6 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ Bug reports, feature requests and questions are welcome. Submit issues [here](ht

## Submitting PRs

Dokka has extensive [Developer Guides](https://kotlin.github.io/dokka/1.8.20/developer_guide/introduction/) documentation
which goes over the development [Workflow](https://kotlin.github.io/dokka/1.8.20/developer_guide/workflow/) and
[Dokka's architecture](https://kotlin.github.io/dokka/1.8.20/developer_guide/architecture/architecture_overview/),
Dokka has extensive [Developer Guides](https://kotlin.github.io/dokka/1.9.0/developer_guide/introduction/) documentation
which goes over the development [Workflow](https://kotlin.github.io/dokka/1.9.0/developer_guide/workflow/) and
[Dokka's architecture](https://kotlin.github.io/dokka/1.9.0/developer_guide/architecture/architecture_overview/),
which can help you understand how to achieve what you want and where to look.

All development (both new features and bugfixes) takes place in the `master` branch, it contains sources for the next
Expand Down Expand Up @@ -61,18 +61,18 @@ Unit tests which are run as part of `build` should not take much time, but you c
### Use/test locally built Dokka

Below you will find a bare-bones instruction on how to use and test locally built Dokka. For more details and examples,
visit [Workflow](https://kotlin.github.io/dokka/1.8.20/developer_guide/workflow/) topic.
visit [Workflow](https://kotlin.github.io/dokka/1.9.0/developer_guide/workflow/) topic.

1. Change `dokka_version` in `gradle.properties` to something that you will use later on as the dependency version.
For instance, you can set it to something like `1.8.20-my-fix-SNAPSHOT`.
For instance, you can set it to something like `1.9.0-my-fix-SNAPSHOT`.
2. Publish it to Maven Local (`./gradlew publishToMavenLocal`)
3. In the project for which you want to generate documentation add Maven Local as a buildscript/dependency
repository (`mavenLocal()`)
4. Update your Dokka dependency to the version you've just published:

```kotlin
plugins {
id("org.jetbrains.dokka") version "1.8.20-my-fix-SNAPSHOT"
id("org.jetbrains.dokka") version "1.9.0-my-fix-SNAPSHOT"
}
```

Expand Down
File renamed without changes.
7 changes: 7 additions & 0 deletions NOTICE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
=======================================================================================
== NOTICE file corresponding to the section 4 d of the Apache License, Version 2.0, ==
== in this case for the Dokka project. ==
=======================================================================================

Dokka project
Copyright 2014-2023 JetBrains s.r.o
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Some libraries that use Dokka for their API reference documentation:
* [Hexagon](https://hexagonkt.com/api/index.html)
* [Ktor](https://api.ktor.io/)
* [OkHttp](https://square.github.io/okhttp/4.x/okhttp/okhttp3/) (Markdown)
* [Gradle](https://docs.gradle.org/current/kotlin-dsl/index.html)

You can run Dokka using [Gradle](https://kotlinlang.org/docs/dokka-gradle.html),
[Maven](https://kotlinlang.org/docs/dokka-maven.html) or from the [command line](https://kotlinlang.org/docs/dokka-cli.html).
Expand All @@ -42,7 +43,7 @@ Apply the Gradle plugin for Dokka in the root build script of your project:

```kotlin
plugins {
id("org.jetbrains.dokka") version "1.8.20"
id("org.jetbrains.dokka") version "1.9.0"
}
```

Expand All @@ -64,7 +65,7 @@ Apply Gradle plugin for Dokka in the root project:

```groovy
plugins {
id 'org.jetbrains.dokka' version '1.8.20'
id 'org.jetbrains.dokka' version '1.9.0'
}
```

Expand Down Expand Up @@ -98,7 +99,7 @@ Add the Dokka Maven plugin to the `plugins` section of your POM file:
<plugin>
<groupId>org.jetbrains.dokka</groupId>
<artifactId>dokka-maven-plugin</artifactId>
<version>1.8.20</version>
<version>1.9.0</version>
<executions>
<execution>
<phase>pre-site</phase>
Expand Down Expand Up @@ -137,7 +138,7 @@ Android platform:

```kotlin
dependencies {
dokkaPlugin("org.jetbrains.dokka:android-documentation-plugin:1.8.20")
dokkaPlugin("org.jetbrains.dokka:android-documentation-plugin:1.9.0")
}
```

Expand All @@ -148,7 +149,7 @@ dependencies {

```groovy
dependencies {
dokkaPlugin 'org.jetbrains.dokka:android-documentation-plugin:1.8.20'
dokkaPlugin 'org.jetbrains.dokka:android-documentation-plugin:1.9.0'
}
```

Expand All @@ -167,7 +168,7 @@ dependencies {
<plugin>
<groupId>org.jetbrains.dokka</groupId>
<artifactId>android-documentation-plugin</artifactId>
<version>1.8.20</version>
<version>1.9.0</version>
</plugin>
</dokkaPlugins>
</configuration>
Expand Down Expand Up @@ -214,7 +215,7 @@ implement plugins for missing or very specific features that are not provided ou
Learn more about Dokka plugins and their configuration in [Dokka plugins](https://kotlinlang.org/docs/dokka-plugins.html).

If you want to learn how to develop Dokka plugins, see
[Developer guides](https://kotlin.github.io/dokka/1.8.20/developer_guide/introduction/).
[Developer guides](https://kotlin.github.io/dokka/1.9.0/developer_guide/introduction/).

## Community

Expand Down
8 changes: 8 additions & 0 deletions build-logic/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
*/

import org.gradle.kotlin.dsl.support.expectedKotlinDslPluginsVersion

plugins {
`kotlin-dsl`
}
Expand All @@ -12,6 +18,8 @@ dependencies {
implementation(libs.gradlePlugin.dokka)
implementation(libs.gradlePlugin.kotlin)
implementation(libs.gradlePlugin.shadow)
implementation("org.gradle.kotlin:gradle-kotlin-dsl-plugins:$expectedKotlinDslPluginsVersion")
implementation(libs.gradlePlugin.gradlePublish)

// workaround for accessing version-catalog in convention plugins
// https://github.com/gradle/gradle/issues/15383#issuecomment-779893192
Expand Down
4 changes: 4 additions & 0 deletions build-logic/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
*/

rootProject.name = "build-logic"

pluginManagement {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
*/

package org.jetbrains

import org.gradle.api.provider.Provider
Expand All @@ -12,7 +16,7 @@ import javax.inject.Inject
* This is an extension created by the [org.jetbrains.conventions.Base_gradle] convention plugin.
*
* Default values are set in the root `gradle.properties`, and can be overridden via
* [CLI args, system properties, and environment variables](https://docs.gradle.org/current/userguide/build_environment.html#sec:project_properties)
* [project properties](https://docs.gradle.org/current/userguide/build_environment.html#sec:project_properties)
*/
abstract class DokkaBuildProperties @Inject constructor(
private val providers: ProviderFactory,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
*/

@file:Suppress("LocalVariableName")

package org.jetbrains
Expand Down
4 changes: 4 additions & 0 deletions build-logic/src/main/kotlin/org/jetbrains/DokkaVersion.kt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
*/

package org.jetbrains

import org.gradle.api.Project
Expand Down
4 changes: 4 additions & 0 deletions build-logic/src/main/kotlin/org/jetbrains/DokkaVersionType.kt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
*/

package org.jetbrains

enum class DokkaVersionType(val suffix: Regex) {
Expand Down
38 changes: 4 additions & 34 deletions build-logic/src/main/kotlin/org/jetbrains/ValidatePublications.kt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
*/

package org.jetbrains

import org.gradle.api.DefaultTask
Expand Down Expand Up @@ -27,39 +31,11 @@ open class ValidatePublications : DefaultTask() {
.filterIsInstance<MavenPublication>()
.filter { it.version == project.dokkaVersion }
.forEach { _ ->
checkProjectDependenciesArePublished(subProject)
subProject.assertPublicationVersion()
}
}
}

private fun checkProjectDependenciesArePublished(project: Project) {
val implementationDependencies = project.findDependenciesByName("implementation")
val apiDependencies = project.findDependenciesByName("api")

val allDependencies = implementationDependencies + apiDependencies

allDependencies
.filterIsInstance<ProjectDependency>()
.forEach { projectDependency ->
val publishing = projectDependency.dependencyProject.extensions.findByType<PublishingExtension>()
?: throw UnpublishedProjectDependencyException(
project = project, dependencyProject = projectDependency.dependencyProject
)

val isPublished = publishing.publications.filterIsInstance<MavenPublication>()
.any { it.version == project.dokkaVersion }

if (!isPublished) {
throw UnpublishedProjectDependencyException(project, projectDependency.dependencyProject)
}
}
}

private fun Project.findDependenciesByName(name: String): Set<Dependency> {
return configurations.findByName(name)?.allDependencies.orEmpty()
}

private fun Project.assertPublicationVersion() {
val versionTypeMatchesPublicationChannels = publicationChannels.all { publicationChannel ->
publicationChannel.acceptedDokkaVersionTypes.any { acceptedVersionType ->
Expand All @@ -70,10 +46,4 @@ open class ValidatePublications : DefaultTask() {
throw AssertionError("Wrong version $dokkaVersion for configured publication channels $publicationChannels")
}
}

private class UnpublishedProjectDependencyException(
project: Project, dependencyProject: Project
): GradleException(
"Published project ${project.path} cannot depend on unpublished project ${dependencyProject.path}"
)
}
Loading

0 comments on commit 571b44d

Please sign in to comment.