Skip to content

Commit

Permalink
Add Dokka documentation (#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
05nelsonm authored Dec 15, 2024
1 parent a681df9 commit 2138732
Show file tree
Hide file tree
Showing 12 changed files with 140 additions and 37 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,6 @@ google-services.json

# Android Profiling
*.hprof

gh-pages/*
!gh-pages/publish.sh
68 changes: 34 additions & 34 deletions .kotlin-js-store/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -288,40 +288,40 @@ js-yaml@4.1.0:
dependencies:
argparse "^2.0.1"

kmp-tor.resource-exec-tor.all@408.12.0:
version "408.12.0"
resolved "https://registry.yarnpkg.com/kmp-tor.resource-exec-tor.all/-/kmp-tor.resource-exec-tor.all-408.12.0.tgz#10c365fb3452ba8f5dd8f5be5a9a68ae8d813d81"
integrity sha512-mproBhkmswFep755NswyxBwQjBu+Trn8eML2oTXq+6z3fdu1n+fPhhnoak1gWJOTIizLpxnvO5hHHmH0ag3cOg==
dependencies:
kmp-tor.resource-exec-tor.linux-android "408.12.0"
kmp-tor.resource-exec-tor.linux-libc "408.12.0"
kmp-tor.resource-exec-tor.macos "408.12.0"
kmp-tor.resource-exec-tor.mingw "408.12.0"

kmp-tor.resource-exec-tor.linux-android@408.12.0:
version "408.12.0"
resolved "https://registry.yarnpkg.com/kmp-tor.resource-exec-tor.linux-android/-/kmp-tor.resource-exec-tor.linux-android-408.12.0.tgz#55cb915f8976ae53c965b91e1e81338c769814b4"
integrity sha512-T6uSnvpr7woLt86V1rYElLS1t6cVX4Uzvq2K3twlScI9WvrKNk+8579eLB63uYIRmT8XG+65mqp2uZqy4rIiNg==

kmp-tor.resource-exec-tor.linux-libc@408.12.0:
version "408.12.0"
resolved "https://registry.yarnpkg.com/kmp-tor.resource-exec-tor.linux-libc/-/kmp-tor.resource-exec-tor.linux-libc-408.12.0.tgz#174247250eec49b94ff53d23328c0be823cd1fc2"
integrity sha512-bhRQAK/+z9xtyeKWdVNdcLbothr4qRyhAcTsuJEVhS1rMUo0nfQ+ScbJUoE4LDDXQCg0kiZE3qPK6qZxk1DuCw==

kmp-tor.resource-exec-tor.macos@408.12.0:
version "408.12.0"
resolved "https://registry.yarnpkg.com/kmp-tor.resource-exec-tor.macos/-/kmp-tor.resource-exec-tor.macos-408.12.0.tgz#bdddb7add33af2763da87940a4f234cc42d828a1"
integrity sha512-q45vZwiii9Yu6ql80YezM6E82HSD8Og9vUvGNP+oIr97wnHe6WoAxOk9oaSMMOExi0ZkQG6YXntqfcJS5hj4KQ==

kmp-tor.resource-exec-tor.mingw@408.12.0:
version "408.12.0"
resolved "https://registry.yarnpkg.com/kmp-tor.resource-exec-tor.mingw/-/kmp-tor.resource-exec-tor.mingw-408.12.0.tgz#5ad4fb58eddcb71207e1ab4b052f9b7b1f8bdc45"
integrity sha512-ycvSEwG7snWCOtfC2jU6mP3n1mTpqFTOyiNjs1FlwYhZRiSDWE+bR0DgZdyRDkwKPlyLioQGbl/x5zjBnS0acw==

kmp-tor.resource-geoip@408.12.0:
version "408.12.0"
resolved "https://registry.yarnpkg.com/kmp-tor.resource-geoip/-/kmp-tor.resource-geoip-408.12.0.tgz#02c15bb53a174658add7b38dea5d45731535cfbd"
integrity sha512-Sg/mmEo58a6oNo9+W1ygDyIS8KH+1JXTv78Wiyed7D8gIQx4Bn2QXC7jpSH6pN69/OG/CBC7YMRDXTpdACczEA==
kmp-tor.resource-exec-tor.all@408.13.0:
version "408.13.0"
resolved "https://registry.yarnpkg.com/kmp-tor.resource-exec-tor.all/-/kmp-tor.resource-exec-tor.all-408.13.0.tgz#6e37151c29ff286fcf59a34db2b764ab2561dfa7"
integrity sha512-7oOKoAhllo6xP947ygXgulycZBnTnRf9p9/9eLvScwS5AMcR2MTQYjGIL+a+iUXQs4xKTfa9mMCf3Ei8JSJLPg==
dependencies:
kmp-tor.resource-exec-tor.linux-android "408.13.0"
kmp-tor.resource-exec-tor.linux-libc "408.13.0"
kmp-tor.resource-exec-tor.macos "408.13.0"
kmp-tor.resource-exec-tor.mingw "408.13.0"

kmp-tor.resource-exec-tor.linux-android@408.13.0:
version "408.13.0"
resolved "https://registry.yarnpkg.com/kmp-tor.resource-exec-tor.linux-android/-/kmp-tor.resource-exec-tor.linux-android-408.13.0.tgz#32b39c6c0b41ec8a02aa14aeb46f26648547e817"
integrity sha512-XDOipQAQJxtt41B8bRsk/nGDYJ1ItqFi++xSQKlfSkzZRbfh+ZIjyAWbe+EIOSTe1SzWgKRMGQVTV3Yq0sPSvw==

kmp-tor.resource-exec-tor.linux-libc@408.13.0:
version "408.13.0"
resolved "https://registry.yarnpkg.com/kmp-tor.resource-exec-tor.linux-libc/-/kmp-tor.resource-exec-tor.linux-libc-408.13.0.tgz#de75df9042ef29408cf417d3a8bec9aea3789859"
integrity sha512-K7E9/bSE85VyeaPjuZVfxWvVzYeEMTFNvmNwnOk/1CeT/gJYgNTkh7OThX2TTmmHGAEGpXYhr22pLA76dxP8Bw==

kmp-tor.resource-exec-tor.macos@408.13.0:
version "408.13.0"
resolved "https://registry.yarnpkg.com/kmp-tor.resource-exec-tor.macos/-/kmp-tor.resource-exec-tor.macos-408.13.0.tgz#44bc56cbf559c8bed4ab163604ddd7c91f570511"
integrity sha512-JGsd24e4SoMBf5cMYJFAbZG4D66AODG9fCEwdF7xqfjgmsUVmNbzUyR0W3kFeHz4n1AdymnhxcE3kptEhSAGPg==

kmp-tor.resource-exec-tor.mingw@408.13.0:
version "408.13.0"
resolved "https://registry.yarnpkg.com/kmp-tor.resource-exec-tor.mingw/-/kmp-tor.resource-exec-tor.mingw-408.13.0.tgz#df4e5acf63b2ca14c005aecfe2aa52275597e4e0"
integrity sha512-1Aeyl09Tp+629xFOQlPoULxNEIZlVoY9z/dG4QG270Qmss+QLpaWbHJ1IMIeqzSZmrTg73rvFjLSwuYDm3muSg==

kmp-tor.resource-geoip@408.13.0:
version "408.13.0"
resolved "https://registry.yarnpkg.com/kmp-tor.resource-geoip/-/kmp-tor.resource-geoip-408.13.0.tgz#57f94a356782c2372a7ba67bd05148b6db0f42eb"
integrity sha512-6lxdb86o7J91sl8qcJn6e/VeGPtbgUG+IPRaw+1gALCTKdpjGpUrKDYY2Nk23bo+DOAGmgg24Pv9nTv9AcH4Jg==

locate-path@^6.0.0:
version "6.0.0"
Expand Down
5 changes: 5 additions & 0 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,9 @@

See [KotlinCrypto/documentation/RELEASING.md][url-kotlincrypto-releasing]

Additionally, publish dokka documentation updates
```bash
./gh-pages/publish.sh
```

[url-kotlincrypto-releasing]: https://github.com/KotlinCrypto/documentation/blob/master/RELEASING.md
1 change: 1 addition & 0 deletions build-logic/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ plugins {

dependencies {
implementation(libs.gradle.android)
implementation(libs.gradle.dokka)
implementation(libs.gradle.kmp.configuration)
implementation(libs.gradle.kotlin)
implementation(libs.gradle.publish.maven)
Expand Down
2 changes: 1 addition & 1 deletion build-logic/src/main/kotlin/-KmpConfigurationExtension.kt
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ fun KmpConfigurationExtension.configureShared(
// watchosAll()

common {
if (publish) pluginIds("publication")
if (publish) pluginIds("publication", "dokka")

sourceSetTest {
dependencies {
Expand Down
46 changes: 46 additions & 0 deletions build-logic/src/main/kotlin/dokka.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* Copyright (c) 2024 Matthew Nelson
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**/
import org.jetbrains.dokka.DokkaConfiguration.Visibility
import org.jetbrains.dokka.gradle.DokkaTaskPartial
import java.net.URI

plugins {
id("org.jetbrains.dokka")
}

tasks.withType<DokkaTaskPartial>().configureEach {
suppressInheritedMembers = true

dokkaSourceSets.configureEach {
includes.from("README.md")
noStdlibLink = true

externalDocumentationLink {
url = URI("https://kmp-file.matthewnelson.io/").toURL()
}

sourceLink {
localDirectory = rootDir
remoteUrl = URI("https://github.com/05nelsonm/kmp-process/tree/master").toURL()
remoteLineSuffix = "#L"
}

documentedVisibilities.set(setOf(
Visibility.PUBLIC,
Visibility.PROTECTED,
))
}
}
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import org.jetbrains.kotlin.gradle.targets.js.yarn.YarnRootExtension
plugins {
alias(libs.plugins.android.library) apply(false)
alias(libs.plugins.binary.compat)
alias(libs.plugins.dokka)
alias(libs.plugins.kotlin.multiplatform) apply(false)
}

Expand Down
36 changes: 36 additions & 0 deletions gh-pages/publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env bash
# Copyright (c) 2024 Matthew Nelson
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -e

readonly DIR_SCRIPT="$( cd "$( dirname "$0" )" >/dev/null && pwd )"

trap 'rm -rf "$DIR_SCRIPT/kmp-process"' EXIT

cd "$DIR_SCRIPT"
git clone -b gh-pages --single-branch https://github.com/05nelsonm/kmp-process.git
rm -rf "$DIR_SCRIPT/kmp-process/"*
echo "kmp-process.matthewnelson.io" > "$DIR_SCRIPT/kmp-process/CNAME"

cd ..
./gradlew clean -DKMP_TARGETS_ALL
./gradlew dokkaHtmlMultiModule --no-build-cache -DKMP_TARGETS_ALL
cp -aR build/dokka/htmlMultiModule/* gh-pages/kmp-process

cd "$DIR_SCRIPT/kmp-process"
sed -i "s|module:process|module:library/process|g" "package-list"

git add --all
git commit -S --message "Update dokka docs"
git push
5 changes: 4 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[versions]
gradle-android = "8.2.2"
gradle-binary-compat = "0.16.3"
gradle-dokka = "1.9.20"
gradle-kmp-configuration = "0.3.2"
gradle-kotlin = "1.9.24"
gradle-publish-maven = "0.29.0"
Expand All @@ -14,10 +15,11 @@ kotlinx-coroutines = "1.8.1"
# tests
androidx-test-core = "1.5.0"
androidx-test-runner = "1.5.2"
kmp-tor-resource = "408.12.0"
kmp-tor-resource = "408.13.0"

[libraries]
gradle-android = { module = "com.android.tools.build:gradle", version.ref = "gradle-android" }
gradle-dokka = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "gradle-dokka" }
gradle-kmp-configuration = { module = "io.matthewnelson:gradle-kmp-configuration-plugin", version.ref = "gradle-kmp-configuration" }
gradle-kotlin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "gradle-kotlin" }
gradle-publish-maven = { module = "com.vanniktech:gradle-maven-publish-plugin", version.ref = "gradle-publish-maven" }
Expand All @@ -38,4 +40,5 @@ kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-t
[plugins]
android-library = { id = "com.android.library", version.ref = "gradle-android" }
binary-compat = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "gradle-binary-compat" }
dokka = { id = "org.jetbrains.dokka", version.ref = "gradle-dokka" }
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "gradle-kotlin" }
3 changes: 3 additions & 0 deletions library/process/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Module process

`Process` implementation for Kotlin Multiplatform.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ package io.matthewnelson.kmp.process.internal

import io.matthewnelson.kmp.process.InternalProcessApi

/** [docs](https://nodejs.org/api/events.html#class-eventemitter) */
/**
* [docs](https://nodejs.org/api/events.html#class-eventemitter)
* @suppress
* */
@InternalProcessApi
@JsName("EventEmitter")
public open external class events_EventEmitter {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ internal inline fun ArrayBufferView.fill() {
}
}

/** @suppress */
@InternalProcessApi
@Suppress("NOTHING_TO_INLINE")
public inline fun <T: events_EventEmitter> T.onError(
Expand All @@ -84,6 +85,7 @@ public inline fun <T: events_EventEmitter> T.onError(
return this
}

/** @suppress */
@InternalProcessApi
@Suppress("NOTHING_TO_INLINE")
public inline fun <T: events_EventEmitter> T.onceError(
Expand Down

0 comments on commit 2138732

Please sign in to comment.