Skip to content

Commit

Permalink
test: made testDokka start server event with option set -e
Browse files Browse the repository at this point in the history
  • Loading branch information
berezinant committed Jan 16, 2024
1 parent e6bd35a commit e6235f5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
9 changes: 5 additions & 4 deletions testDokka.sh
Original file line number Diff line number Diff line change
@@ -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.
#
Expand Down Expand Up @@ -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"
Expand All @@ -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
Expand All @@ -71,11 +71,12 @@ 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"

echo 'Start Python server in directory'
echo "$TEST_PROJECT_PATH/build/dokka/html"

python3 -m http.server $PORT

echo "Done"
5 changes: 5 additions & 0 deletions testDokka.sh.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

0 comments on commit e6235f5

Please sign in to comment.