Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

id "idea" gets converted to id("ea") #54

Open
ChristopherHaws opened this issue Jan 10, 2023 · 5 comments
Open

id "idea" gets converted to id("ea") #54

ChristopherHaws opened this issue Jan 10, 2023 · 5 comments

Comments

@ChristopherHaws
Copy link

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! :)

@bernaferrari
Copy link
Owner

Uh oh, let me check my favorite maintainer.

@WhosNickDoglio do you have any idea?

@WhosNickDoglio
Copy link
Contributor

WhosNickDoglio commented Jan 10, 2023

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.

@ChristopherHaws
Copy link
Author

@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/" } to maven("https://maven.fabricmc.net/")
  • Under repositories, it didn't wrap the exclusiveContent's url's in url(...). For example url = "https://cursemaven.com" should be url = url("https://cursemaven.com")
  • tasks.withType(T).configureEach { should be tasks.withType<T> {
  • Everywhere I was reading from gradle.properties didn't get converted. For example project.maven_group should become maven_group and val 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 to val 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 to implementation 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! :)

@WhosNickDoglio
Copy link
Contributor

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. 👍

@ChristopherHaws
Copy link
Author

ChristopherHaws commented Jan 16, 2023

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! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants