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

build: update groovy wrapper #5141

Merged
merged 4 commits into from
Sep 25, 2023
Merged

build: update groovy wrapper #5141

merged 4 commits into from
Sep 25, 2023

Conversation

jdrueckert
Copy link
Member

@jdrueckert jdrueckert commented Sep 24, 2023

What this PR does

Consume https://github.com/MovingBlocks/groovy-wrapper/releases/tag/v2.2.0 as documented in https://github.com/MovingBlocks/groovy-wrapper#to-use

ToDo before merge

  • Figure out what I'm doing wrong and fixing it 🙄

Attempt 1:
What I did: Follow the "download, extract and place" approach (plus chmod +x).
What's going wrong: Locally running ./groovyw usage currently fails with /usr/bin/env: ‘sh\r’: No such file or directory.

Attempt 2:
What I did: Follow the "just grab and add" (copy + paste) approach.
What's going wrong: Locally running ./groovyw usage currently fails with

Caught: java.io.FileNotFoundException: /path/to/ts/workspace/usage (/path/to/ts/workspace/usage)
java.io.FileNotFoundException: /path/to/ts/workspace/usage (/path/to/ts/workspace/usage)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at org.gradle.wrapper.GroovyBootstrapMainStarter.start(GroovyBootstrapMainStarter.java:36)
	at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:103)
	at org.gradle.wrapper.GroovyWrapperMain.main(GroovyWrapperMain.java:60)

@github-actions github-actions bot added the Category: Build/CI Requests, Issues and Changes targeting gradle, groovy, Jenkins, etc. label Sep 24, 2023
@BenjaminAmos
Copy link
Contributor

Locally running ./groovyw usage currently fails with /usr/bin/env: ‘sh\r’: No such file or directory.

On Windows I got the following after cloning 51187f7:

Caught: java.io.FileNotFoundException: <workspace path>\Terasology\module (<workspace path>\Terasology\module)
java.io.FileNotFoundException: <workspace path>\Terasology\module (<workspace path>\Terasology\module)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at org.gradle.wrapper.GroovyBootstrapMainStarter.start(GroovyBootstrapMainStarter.java:36)
        at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:103)
        at org.gradle.wrapper.GroovyWrapperMain.main(GroovyWrapperMain.java:60)

@jdrueckert
Copy link
Member Author

jdrueckert commented Sep 24, 2023

Locally running ./groovyw usage currently fails with /usr/bin/env: ‘sh\r’: No such file or directory.

On Windows I got the following after cloning 51187f7:

Caught: java.io.FileNotFoundException: <workspace path>\Terasology\module (<workspace path>\Terasology\module)
java.io.FileNotFoundException: <workspace path>\Terasology\module (<workspace path>\Terasology\module)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at org.gradle.wrapper.GroovyBootstrapMainStarter.start(GroovyBootstrapMainStarter.java:36)
        at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:103)
        at org.gradle.wrapper.GroovyWrapperMain.main(GroovyWrapperMain.java:60)

Yup, that's the same I get now too after copy/pasting the files rather than taking them from the extracted release zip... not entirely sure whether I'm doing something wrong or the documentation in the repo readme is out of date or whatever..

Interesting, though, that you got this already with my first attempt.

groovyw.bat Outdated Show resolved Hide resolved
groovyw Outdated Show resolved Hide resolved
@jdrueckert
Copy link
Member Author

@BenjaminAmos thanks for the hint, works now.

@jdrueckert jdrueckert marked this pull request as ready for review September 24, 2023 20:30
Copy link
Member

@Cervator Cervator left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can validate that this works now. I submitted MovingBlocks/groovy-wrapper@e9ee667 to better document the customization of the Groovy Wrapper for a given project.

Still left out is another curiosity that might be a thing for another day: when the wrapper's base Gradle changes and the gradlew + gradlew.bat files get modified in theory those changes should be replicated in the groovyw + groovyw.bat files - but it seems unlikely that the thinner scope of simply running Groovy scripts will be affected every time, and this time it clearly isn't since, well, it works! I guess it sometimes is more about edge cases. Having upgraded the wrapper so rarely it just isn't something I've had much of a chance to think on, and really the number one thing is "Does it work" so ... it does!

@Cervator Cervator dismissed BenjaminAmos’s stale review September 25, 2023 03:50

Issue / change was resolved, dunno why GitHub doesn't recognize that

@Cervator Cervator merged commit 5957641 into develop Sep 25, 2023
9 checks passed
@Cervator Cervator deleted the build/update-groovy-wrapper branch September 25, 2023 04:06
@jdrueckert jdrueckert added this to the 2023 Revive - Milestone 2 milestone Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Build/CI Requests, Issues and Changes targeting gradle, groovy, Jenkins, etc.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants