Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow overriding a Dokka version in integration tests #3585

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

whyoleg
Copy link
Contributor

@whyoleg whyoleg commented Apr 25, 2024

An addition for #3583.

For UI showcase project, after PR is merged, it will be possible to run it like this:

./gradlew :dokka-integration-tests:gradle:testUiShowcaseProject -Porg.jetbrains.dokka.integration_test.dokkaVersionOverride=2.0.0-dev-329

It's also possible to add org.jetbrains.dokka.integration_test.dokkaVersionOverride=2.0.0-dev-329 to dokka-integration-tests/gradle.properties (but, it's less recommended, as it could be unnoticed and affect tests behaviour)

Note: PR is based on master and not ui-test-project branch, so testUiShowcaseProject will be not available.

Note regarding implementation:

  • it's easier to allow overriding version for all integration tests and not just for single ui-showcase project. Additionally it could be useful for reproducing bugs with older versions if needed via just property;
  • it's possible to use project.version to override DOKKA_VERSION and then do the logic based on it - but it will cause rebuilding of all artefacts (because of devMavenPublish). It's possible to overcome this, but I didn't want to change a lot of code;
  • additionally using DOKKA_VERSION for detecting some override could cause some unknown issues;
  • so I've decided that separate property and separate env variable will be more safe, clear and additive change for this specific use case.

Copy link
Member

@IgnatBeresnev IgnatBeresnev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can indeed come in handy 👍

dokkaBuild.androidSdkDir.orNull?.let { androidSdkDir ->
environment("ANDROID_HOME", androidSdkDir.invariantSeparatorsPath)
fun environmentProvider(name: String, provider: Provider<out Any>) {
inputs.property(name, provider)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adam-enko FYI, without adding properties which are passed to environment to inputs tasks will always stay up-to-date when those properties are changed

Copy link
Contributor

@berezinant berezinant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested it, works well both with published and local versions of Dokka 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants