From e6bd35a2c8c68bad41dcda31bbbf996147486ef0 Mon Sep 17 00:00:00 2001 From: berezinant Date: Mon, 15 Jan 2024 16:10:45 +0100 Subject: [PATCH] test: improved testDokka.sh after review --- CONTRIBUTING.md | 2 ++ testDokka.sh | 10 ++++------ testDokka.sh.md | 9 ++++++--- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1dba67f59ec..cff2b217a70 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -70,6 +70,8 @@ visit [Workflow](https://kotlin.github.io/dokka/1.9.10/developer_guide/workflow/ repository (`mavenLocal()`) 4. Update your Dokka dependency to the version you've just published: +There is an automation script for this routine, see [testDokka.sh.md](./testDokka.sh.md) for details. + ```kotlin plugins { id("org.jetbrains.dokka") version "1.9.10-my-fix-SNAPSHOT" diff --git a/testDokka.sh b/testDokka.sh index ba1c99d0608..e9267689514 100755 --- a/testDokka.sh +++ b/testDokka.sh @@ -5,7 +5,7 @@ # # New version to be published -NEW_VERSION="1.9.20-SNAPSHOT" +NEW_VERSION="1.9.20-my-fix-SNAPSHOT" # Path to test project TEST_PROJECT_PATH="./examples/gradle/dokka-gradle-example" @@ -44,12 +44,12 @@ echo "Dokka path: $DOKKA_REPO_PATH" echo "Port: $PORT" # 1. Publish to local Maven repository -cd $DOKKA_REPO_PATH +cd "$DOKKA_REPO_PATH" ./gradlew publishToMavenLocal -Pversion=$NEW_VERSION # 2. Update Dokka version in test project -cd $TEST_PROJECT_PATH -sed -i "" "s/id(\"org.jetbrains.dokka\") version \"\(.*\)\"/id(\"org.jetbrains.dokka\") version \"$NEW_VERSION\"/" build.gradle.kts +cd "$TEST_PROJECT_PATH" +sed -i "" "s/\(id(\"org\.jetbrains\.dokka\") version\) \".*\"/\1 \"$NEW_VERSION\"/" build.gradle.kts # 3. Build and generate documentation ./gradlew clean && ./gradlew dokkaHTML @@ -79,5 +79,3 @@ echo 'Start Python server in directory' echo "$TEST_PROJECT_PATH/build/dokka/html" python3 -m http.server $PORT - - diff --git a/testDokka.sh.md b/testDokka.sh.md index cea943c6013..a6d23f36f97 100644 --- a/testDokka.sh.md +++ b/testDokka.sh.md @@ -18,13 +18,13 @@ By default it applied to the `./examples/gradle/dokka-gradle-example` project ### Specify test project path ```bash -./testDokka.sh -d './examples/gradle/dokka-gradle-example' +./testDokka.sh -d ./examples/gradle/dokka-gradle-example ``` ### Specify Dokka version ```bash -./testDokka.sh -v "1.9.20-SNAPSHOT" +./testDokka.sh -v 1.9.20-my-fix-SNAPSHOT ``` ### Specify port @@ -36,7 +36,10 @@ By default it applied to the `./examples/gradle/dokka-gradle-example` project ### All together ```bash -./testDokka.sh -d './examples/gradle/dokka-gradle-example' -v "1.9.20-SNAPSHOT" -p 8001 +./testDokka.sh -d ./examples/gradle/dokka-gradle-example -v 1.9.20-my-fix-SNAPSHOT -p 8001 ``` +## Requirements +To run the server you need to have Python 3 installed. +