andreasmattsson08/13/2019, 7:39 AM
in the Android app modules of my MPP in cases where the disambiguity appears to only be in "comments" for the resolution of typealiases, see example snippet. It compiles fine with gradle, however it would be nice to get syntax highlighting and autocomplete etc on these types... Any suggestions for ways to resolve this?
Overload Resolution Ambiguity
louiscad08/13/2019, 8:01 AM
andreasmattsson08/13/2019, 8:43 AM
Android Studio 3.4.2 Build #AI-183.622.214.171.12492245, built on June 27, 2019 JRE: 1.8.0_152-release-1343-b01 amd64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Windows 10 10.0
louiscad08/13/2019, 8:46 AM
andreasmattsson08/13/2019, 8:48 AM
louiscad08/13/2019, 8:49 AM
andreasmattsson08/13/2019, 9:02 AM
Cannot choose among the following candidates without completing type inference: public fun <T : Any> rxObservableOf(value: Float): RxObservable<Float> defined in se.sdg12.deedster.concurrency.rx public fun <T : Any> rxObservableOf(value: Float): RxObservable<Float> /* = Flowable<Float> */ defined in se.sdg12.deedster.concurrency.rx
louiscad08/13/2019, 9:03 AM
andreasmattsson08/13/2019, 9:06 AM
type which i have typealiased to RxJava2's
for my java/android projects
louiscad08/13/2019, 9:08 AM
andreasmattsson08/13/2019, 9:16 AM
). @louiscad are you aware of if there are any existing issues related to IDE and including same file in multiple sourcesets, or should I still create a new one?
louiscad08/13/2019, 9:18 AM
andreasmattsson08/13/2019, 9:18 AM
louiscad08/13/2019, 9:19 AM
andreasmattsson08/13/2019, 9:20 AM
louiscad08/13/2019, 9:20 AM
andreasmattsson08/13/2019, 9:26 AM
with different impls for pure/android (with the android versions needing access to the application context for example). I could get around it with a more dependency injection-like approach (having just an interface in the common module and "injecting" the different impls in consuming platform-specific modules) but that would require pretty significant work, whereas different
impls seemed much easier.
louiscad08/13/2019, 9:59 AM
intermediate source set. It'll not delete existing directories, so it's safe to use on existing structure. Be sure to launch the script from the directory of your project's root using
. https://github.com/LouisCAD/Splitties/blob/develop/scripts/Add-Kotlin-Targets.kts#L27 Then, you'll need to make an edited (and probably simpler) version of this
kotlin -script path/to/the/script/dir/Add-Kotlin-Targets.kts
code I made to make the IDE point to the symlinked directories for each target: https://github.com/LouisCAD/Splitties/blob/0318f6047059ef5e97fb7bd53bd363420ad5fdf9/buildSrc/src/main/kotlin/config/KotlinSourceSetsConfig.kt#L35 It targets Kotlin/Native, but you can add support for Kotlin/JVM and Android too. After you made this and renamed the function (since it no longer targets native source sets only if at all), you can simply call it after you define the targets in your build.gradle(.kts). Note that after this is setup, symlinked files need to be manually saved (using cmd/ctrl + S), and the IDE might be a little slow to propagate files creations to other symlinked targets. Let me know if you need further help.
andreasmattsson08/13/2019, 10:04 AM
louiscad08/13/2019, 10:05 AM