Hi, Just created a mpp prohect using gradle in IDE...
# announcements
o
Hi, Just created a mpp prohect using gradle in IDEA. How do i add another module named "common" module?
I added a "commonMain" folder under src. But it doesnt show up as a module. How do i set it as a module?
Ok I managed to create a jvm module in the src directory. But the kotlinlang.com page says that there is a commonMain sourceset made by default. How do i add it to my project?
r
just guessing: try right click on project folder(root folder) -> New -> Module Havn't use mpp, but gradle on JVM project is created so. guess maybe mostly the same.
o
nott module, its a sourceset
like the commonMain sourceset added to all projects by default. like one you add for jvm() and linuxX64() targets
temp.gif
the commonMain i show in the hilight, it needs to add up like i added the jvmMain
r
well, I just created a mpp project using IDEA and it works fine. as said in https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html#default-project-layout these two soucesets are automatically set. my
build.gradle
:
Copy code
sourceSets {
    commonMain {
        dependencies {
            implementation kotlin('stdlib-common')
        }
    }
    commonTest {
        dependencies {
            implementation kotlin('test-common')
            implementation kotlin('test-annotations-common')
        }
    }
}
may you should config it manually.
o
how do i see it in the project layout? its not showing up
r
in my case it's automatically shown. emm... if configuration is properly set, maybe it's IDEA's fault... I have experience that changing my build script leads to a somewhat bug of IDEA, need to delete all IDEA-related staff and reconstruct the project. But, again, im absolutely not a mpp expert, all my experience is on jvm side only. so im just guessing.
o
its happening to me always whenever i try to create a new project using idea and mpp it doesnt show up