Hey, I want to use the kotlin multiplatform plugin...
# multiplatform
j
Hey, I want to use the kotlin multiplatform plugin for gradle within a precompiled plugin (inside of the buildSrc folder) - but it does not work. Does this really just not work or is there a problem inside of my gradle script files?
j
I am using that plugin without problem
j
And this is the whole project (still with the jvm plugin): https://github.com/bluefireoly/SpamgourmetReloaded
j
have you added the kotlin Gradle plugin to your dependencies block in buildSrc?
j
Yes, is the code snippet I shared only visible for me?
j
I can see it
I see you are using kotlin("jvm") changing that to Multiplatform doesn't work?
j
Yes, if I change it just everything is not found.
j
you are using them inside kotlin { source sets { ... } }?
testImplementation doesn't exist in Multiplatform
j
Even this kotlin function is not found, so I cannot use that.
j
you have to use implementation(yourLib) in the whatever test source set you need it (example, jvmTest)
j
Okay, but the problem is that I can't even configure the multiplatform plugin as nothing is available.
j
Sorry I am on mobile and I can't crop them quickly
j
That is not possible, as everything regarding this plugin is missing.
j
if you sync it doesn't become highlighted?
j
Yes
j
but a sync without failures
j
https://kotlinlang.slack.com/archives/C3PQML5NU/p1608812820434000?thread_ts=1608812542.431800&cid=C3PQML5NU The above errors come up, but these are just a result of the missing plugin.
j
Above error are normal, testImplementation does not exist
in Multiplatform
j
Yes I know, but the others are not normal.
j
I don't know really, because some of them are java, maybe that is the problem
try to remove them until you get it working
j
Also, testImplementation missing should not break the whole possibility of configuring the multiplatform plugin.
j
it breaks the highlighting, but it is normal (at least for me it happens every time)
and it doesn't compile too if you try to use gradlew build
j
I don't know really, because some of them are java, maybe that is the problem
But I don't really want to comment out all of my scripts, that does not feel like the right way to switch to the multiplatform plugin.
j
but it has sense
j
and it doesn't compile too if you try to use gradlew build
Yeah, I tried that too
j
you are trying to use a function that doesn't exist, so it explodes
for kotlin compile use tasks.withType<KotlinCompile>() { ... }
java...Compability probably should fail too I think but I didn't use it so
tasks.test can be replaced with withType<Test> I think
j
Okay so I got it working by commenting out all of the possible non existent functionalities. Now I am trying to reimplement them one after another.
you are trying to use a function that doesn't exist, so it explodes
Actually this is a good explanation of what happens, but still weird that the plugin is not configurable because of an error later in the build script.
👌 1