From e6235f5b62ce7409d632a4b3f1ebf2a460169f6a Mon Sep 17 00:00:00 2001 From: berezinant Date: Tue, 16 Jan 2024 19:47:14 +0100 Subject: [PATCH] test: made testDokka start server event with option set -e --- testDokka.sh | 9 +++++---- testDokka.sh.md | 5 +++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/testDokka.sh b/testDokka.sh index e9267689514..1d20dbb076a 100755 --- a/testDokka.sh +++ b/testDokka.sh @@ -1,5 +1,5 @@ #!/bin/bash - +set -e # # Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. # @@ -45,7 +45,7 @@ echo "Port: $PORT" # 1. Publish to local Maven repository cd "$DOKKA_REPO_PATH" -./gradlew publishToMavenLocal -Pversion=$NEW_VERSION +./gradlew publishToMavenLocal -Pversion="$NEW_VERSION" # 2. Update Dokka version in test project cd "$TEST_PROJECT_PATH" @@ -58,7 +58,7 @@ wait # 4 Vacate port # Find PID of process listening on port -PID=$(lsof -t -i :$PORT) +PID=$(lsof -t -i :"$PORT" || true) # Check that PID is not empty if [ -n "$PID" ]; then @@ -71,7 +71,6 @@ fi # 5.1 Echo link to documentation echo "Open http://localhost:$PORT in browser" - # 5.2 Start Python server to view results cd "./build/dokka/html" @@ -79,3 +78,5 @@ echo 'Start Python server in directory' echo "$TEST_PROJECT_PATH/build/dokka/html" python3 -m http.server $PORT + +echo "Done" \ No newline at end of file diff --git a/testDokka.sh.md b/testDokka.sh.md index a6d23f36f97..a4a85652e81 100644 --- a/testDokka.sh.md +++ b/testDokka.sh.md @@ -43,3 +43,8 @@ By default it applied to the `./examples/gradle/dokka-gradle-example` project ## Requirements To run the server you need to have Python 3 installed. +## Troubleshooting + +* If occurs `Could not resolve all files for configuration ':dokkaHtmlPlugin'` error, + * then make sure that `mavenLocal()` is added to the `repositories` section of the `build.gradle` file of the project you are testing against. + It is not automated and should be done manually.