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

generated start scripts get "destroyed" #12

Closed
Vampire opened this issue Mar 9, 2018 · 2 comments
Closed

generated start scripts get "destroyed" #12

Vampire opened this issue Mar 9, 2018 · 2 comments
Labels

Comments

@Vampire
Copy link

Vampire commented Mar 9, 2018

You manipulate the generated start scripts and thereby destroy their line endings.
The windows start script must have windows style line endings, the unix start script must have unix style line endings.
With your code, you read in all lines of the scripts and then write it out with the current platform line ending.
This either destroys the line endings of the windows start script if you build on *nix or the line endings of the unix start script if you build on Windows.
You must save the start scripts with the correct line ending.
If you don't want to hard-code them, you can use org.gradle.util.TextUtil.getWindowsLineSeparator() and org.gradle.util.TextUtil.getUnixLineSeparator().
Or you could maybe just read the whole file into one String, do the replace on the whole String and then write out the String to the file again.
Would also be more performant, as it doesn't make too much sense to do the replace on each line.
Besides that in this case you should pre-compile the regex instead of using String#replaceFirst which requires to compile the regex for each and every single line and thus cost pretty much performance.

@zyxist
Copy link
Owner

zyxist commented Mar 11, 2018

Regarding #12, #13, and #14 - the piece of code for generating startup scripts is mostly inherited from experimental-jigsaw and I did not do any improvements in this area. I see that this functionality is important for you, so I'll focus on it in the next days to fix the issues you have found. Thanks for your contributions :).

@Vampire
Copy link
Author

Vampire commented Mar 12, 2018

I didn't imply it was your fault, I just reported it to you as you actively maintain your plugin. :-)
I'll report to Gradle guys also in case they revive their stuff.
Thanks for taking care.

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

No branches or pull requests

2 participants