I cannot figure out where to put Java source code to build it in Kotlin MPP.
gradle-8.1
kotlin 1.9.20
In Idea java looks properly linked, but when I am trying to run it, it fails with ‘no class found’
I have tryed to put java source in Java folder under jvmMain - no luck either:
Parent build script:
buildscript {
repositories {
mavenCentral()
mavenLocal()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$KOTLIN_VER"
}
}
plugins {
id 'org.jetbrains.kotlin.multiplatform' version "$KOTLIN_VER"
id 'maven-publish'
}
allprojects {
repositories {
mavenCentral()
mavenLocal()
maven{ url "https://dl.bintray.com/kotlin/kotlin-eap"}
maven{ url "https://kotlin.bintray.com/kotlinx" }
}
tasks.register('listAllDependencies', DependencyReportTask) {}
}
subprojects {
// maven publication
apply plugin: 'maven-publish'
apply plugin: 'org.jetbrains.kotlin.multiplatform'
version '1.0'
group 'kotlin_bugs'
publishing {
repositories {
mavenLocal()
}
}
kotlin {
js {
browser {
testTask {
enabled = false
}
}
binaries.executable()
}.compilations.configureEach {
kotlinOptions.noStdlib = "false"
kotlinOptions.sourceMap = "true"
kotlinOptions.sourceMapEmbedSources = "always"
kotlinOptions.metaInfo = true
//kotlinOptions.outputFile = "out/production/${Project.name}/${Project.name}.js"
}
jvm().compilations.configureEach {
kotlinOptions.jvmTarget = "1.8"
}
sourceSets {
commonMain {
dependencies {
implementation kotlin('stdlib')
}
}
commonTest {
dependencies {
implementation kotlin("test")
}
}
}
}
}
kotlin {
jvm()
}
Module build script:
kotlin {
sourceSets {
commonMain {
dependencies {
implementation project(':Utils')
}
}
}
}