Given a KMP gradle subproject moduleA with depende...
# multiplatform
j
Given a KMP gradle subproject moduleA with dependencyA (current state of my library), I'm looking for the best way to configure a gradle subproject moduleB that has the following requirements: 1. Add additional code to *moduleA*'s API, both additional classes as well as functions and properties on existing classes (may be achieved via extension functions). 2. Replace dependencyA with dependencyB, which contains *dependencyA*'s API with additions (dependency A and B already exist). 3. Must have access to
internal
API of moduleA in moduleB. 4. moduleA and moduleB produce unique published artifacts. I considered adding moduleA as a dependency to moduleB with
exclude
for dependencyA, but #3 isn't possible this way. Next I considered adding *moduleA*'s source directories to *moduleB*'s such that the same source files would be compiled along with *moduleB*'s API additions. But I ran into this IDE restriction, where "duplicate content root" error causes the source directories to be removed from moduleB. As a workaround, I've added symlinks from moduleB to *moduleA*'s source directories. While this seems to work, I'm not convinced this is the best way to achieve the goals listed above. Are there other project configuration options I could consider?