Yes, I can move `testShared` anywhere, actually. I...
# gradle
l
Yes, I can move
testShared
anywhere, actually. It’s quite a unique setup because I can only run it on JVM targets, so even having one depending on the other might be tricky because ArchUnit does not know about
kotlin-multiplatform
plugin
🧵 1
thanks Stefan! I’m not exactly pro on gradle, might followup with a question or two
v
Probably important to note, that this will only work with nightly, as
withVariantReselection()
is only added in 7.5. Or at least in 7.3.3 or 7.4 different code is necessary.
w
For the case above, you can also use a new configuration and set the appropriate attributes. I was also trying to do something else and ended up using
withVariantReselection()
.
👌 1
Something like this probably would work:
Copy code
configurations {
    create("archTestUpstreamClasses") {
        isCanBeConsumed = false
        attributes {
            attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage.JAVA_API))
            attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, objects.named(LibraryElements.CLASSES))
            attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.LIBRARY))

        }
    }
}
Then you’d need to add a dependency on the project containing your architecture tests. There probably feature variants would be the easiest way to get you started.
v
Aren't we then back to probably use test fixtures plugin?
w
Yeah, you can use test fixtures. What you need is to add the classes from the test fixture to the test task.
v
And that's what he was advised to do in the other two conversations around this that came into life due to not using threads. :-)