Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-5540

Replace the use of the optional plugin

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • Java Drivers

      The optional plugin doesn't work well with kotlin gradle scripts.

      In JAVA-5239 I added an optional dependency but can't mark it as optional with the current plugin.

      See: https://blog.gradle.org/optional-dependencies

      Using "features" optional feature dependencies can be declared eg:

      java {
          registerFeature("jsonSupport") {
              usingSourceSet(sourceSets["main"])
          }
      }
      

      Then used like so:

      dependencies {
          "jsonSupportImplementation"("org.jetbrains.kotlinx:kotlinx-serialization-json")
      }
      

            Assignee:
            Unassigned Unassigned
            Reporter:
            ross@mongodb.com Ross Lawley
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: