Skip to content

Commit

Permalink
test: improved testDokka.sh after review
Browse files Browse the repository at this point in the history
  • Loading branch information
berezinant committed Jan 15, 2024
1 parent d65da4b commit 6459dc1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 4 additions & 6 deletions testDokka.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -79,5 +79,3 @@ echo 'Start Python server in directory'
echo "$TEST_PROJECT_PATH/build/dokka/html"

python3 -m http.server $PORT


9 changes: 6 additions & 3 deletions testDokka.sh.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.

0 comments on commit 6459dc1

Please sign in to comment.