how do we expose dependencies brought in with cint...
# multiplatform
d
how do we expose dependencies brought in with cinterops to a test configuration?
In my MPP project I'm bringing in ocmockito this way:
Copy code
fromPreset(iosPreset, 'ios') {
            binaries {
                framework()
            }
            compilations.main {
                def productsDir = new File("").absolutePath
                linkerOpts "-F${productsDir}/common/libs"
                cinterops{
                    ocmockito {
                        includeDirs "${productsDir}/common/libs/OCMockitoIOS.framework/Headers"
                    }
                }
            }
        }
But I keep getting
error: unresolved reference: ocmockito
when I go to build the project
I had this working before updating to 1.3.20
o
@ilya.matveev
d
found a fix. Changing
compilations.main
to
compilations.all
seem to get me pass that issue.
👍 1
r
I think
compilations.test
would work if you only need it for tests
i
I think
compilations.test
would work if you only need it for tests
This is right. Also the
linkerOpts
property of a compilation affects only binaries created using the
compilation.outputKinds
method. If you declare a binary using the binaries DSL, you need to use
linkerOpts
of this binary:
Copy code
binaries {
    framework {
        linkerOpts += ["-F${productsDir}/common/libs"]
    }
}
d
Sorry all, I found the steam of my issue. While updating to 1.3.20, I accidentally deleted the
packageName
of ocmockito under cinterops. Yesterday I had started out with
compilations.test
but when that failed I went to
compilations.main
thinking that the test compilations was wrong. the error
error: unresolved reference: ocmockito
was right all alone, I had just overlooked a simple detail. Thanks again for all of your help @svyatoslav.scherbina @russhwolf
👍 1