dokka icon indicating copy to clipboard operation
dokka copied to clipboard

KT-64377 Maven dev publish

Open adam-enko opened this issue 1 year ago • 2 comments

Use project-local Maven dev repos for integration testing.

Impact

Using a Maven Repo is useful for integration tests, because it verifies that the artifacts are published correctly with the expected coordinates. It is also useful for Gradle Plugins, because we can verify that the plugin marker was correctly published.

Removing the dependency on Maven Local is one of the last steps before Dokka's build logic (just the build logic, not Dokka Gradle Plugin!) can be made fully Config Cache compatible.

Verification

To test locally, you can use configuration cache:

./gradlew :dokka-integration-tests:check --configuration-cache --configuration-cache-problems=warn

(Although there will be warnings, they can be ignored - Dokka build scripts (not DGP!) will be made CC compatible in upcoming PRs.)

Summary

  • Plugin dev.adamko.dev-publish publishes subprojects to a project-local directory.

    Benefits:

    • compatible with: config cache, build cache, isolated projects
    • Unlike the standard Gradle publication, snapshot versions will not constantly be re-published. (publishToMavenLocal will also not constantly republish snapshot versions, but it's not easily possible to change the location of Maven Local)
    • doesn't use Maven Local, so there's no chance of cross-contamination with outdated artifacts or other projects
  • Dynamically inject the local Maven dir:

    • Gradle projects: find/replace /* %{PROJECT_LOCAL_MAVEN_DIR}% */ with an exclusive Maven repo
    • Maven projects: provide a settings.xml with the local plugin repo.

adam-enko avatar Dec 20 '23 17:12 adam-enko