https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
w

wakingrufus

02/05/2019, 2:07 PM
hmm ok. well if anyone has a couple minutes to look over my setup, i would appreciate it: https://github.com/wakingrufus/text-adventure I am trying to get the jvm project
my-game-jvm-terminal
to depend on the mpp
text-adventure-terminal
and I am getting
Copy code
e: /home/rufus/code/text-adventure/my-game-jvm-terminal/src/main/kotlin/com/github/wakingrufus/mygame/Main.kt: (5, 5): Unresolved reference: playInTerminal
i

ian.shaun.thomas

02/05/2019, 2:09 PM
probably wont help you solve your issue but I actually created a somewhat similar style 'game' as a demonstration for my state machine library https://github.com/ToxicBakery/kfin-state-machine/tree/master/samples/dungeon MPP is used for the common/jvm code and the game is pure jvm
w

wakingrufus

02/05/2019, 2:14 PM
nice! yeah there is a lot of similarity here. i notice you are specifying specific configurations in your project dependencies, I wonder if I have to do something similar
i

ian.shaun.thomas

02/05/2019, 2:21 PM
nice!
s

Sabrina Namur

02/05/2019, 2:23 PM
I don't know exacly how to archive this in the gradle file, but if you go to project structure -> modules -> 'my-game-jvm-terminal' -> 'main', dependencies and than add module dependencies (right side with a +) and choose 'text-adventure-terminal.commonMain it should work. (I assume you are using Intellij IDEA)
i

ian.shaun.thomas

02/05/2019, 2:24 PM
I'm guessing what you are suggesting @Sabrina Namur is a way to allow specifying which configuration of the dependency to use. You can accomplish it the same way you do with normal maven dependencies.
implementation project(path: ':common', configuration: 'jvmRxRuntimeElements')
w

wakingrufus

02/06/2019, 1:39 AM
Adding the configuration parameter worked, thanks
🎉 1
2 Views