GradleKotlinConverter
GradleKotlinConverter copied to clipboard
`id "idea"` gets converted to `id("ea")`
When running the script, id "idea"
gets converted to id("ea")
in the plugin section. It looks like a regex is looking inside of quoted strings when it shouldn't be.
Thanks for the script! :)
Uh oh, let me check my favorite maintainer.
@WhosNickDoglio do you have any idea?
Can you share a build.gradle snippet that can reproduce the issue? I tried adding tests for it in #55 and it converts the blocks correctly.
@WhosNickDoglio Here is the file I used. https://pastebin.com/XjXP9djb
There are several issues that came out of it, not just this one. Some of them took me a good minute to find. Some examples:
- Some of my dependencies have the word
api
in them so the script added a(
into the dependency string (this would be fixed if you ignore looking inside strings) - Under repositories, it didn't convert the maven dependencies from
maven { url = "https://maven.fabricmc.net/" }
tomaven("https://maven.fabricmc.net/")
- Under repositories, it didn't wrap the exclusiveContent's url's in
url(...)
. For exampleurl = "https://cursemaven.com"
should beurl = url("https://cursemaven.com")
-
tasks.withType(T).configureEach {
should betasks.withType<T> {
- Everywhere I was reading from gradle.properties didn't get converted. For example
project.maven_group
should becomemaven_group
andval maven_group: String by extra
should be added near the top of the file. - The nullability of build number was wrong. I had to change it from
val buildNumber: String
toval buildNumber: String?
- My script is for a Minecraft mod which has custom configurations and those were not handled for me. For example
modImplementation
is similar toimplementation
but the script didn't do anything to it
I'm sure there are more, for example the entire loom section I had to manually convert. Anyways, this script helped me get part way there so thanks for the help and the script! :)
Messing around with the file provided above and I can't reproduce the id("ea")
issue but I can reproduce many of the others listed above 😅
I'll start working through them this week to see how feasible it is to fix them, like it's called out in the script intro this is a helper tool and not meant to be perfect so as of right now I'm unsure if I'll get to all of them but I'll certainly try. 👍
Yup, no rush or anything, I got my build script converted. I just figured I would post the things I had to manually fix in case you want to try and handle them in the script. :)
When I did the conversion, I used the "clipboard" method. I don't know if that makes a difference or not for the "idea" issue.
Thanks for the script! :)