-
Notifications
You must be signed in to change notification settings - Fork 170
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
Transfer the source file encoding from Gradle to Eclipse #344
Comments
Related: gradle/gradle#898 What workaround could be applied until this is solved? |
Not really at the moment, however, we'll soon implement new APIs that might be useful for you. We're going enable clients to hook into the project synchronization and to access the Tooling APIs to query arbitrary configuration from the Gradle build. |
@spoenemann Our workaround is this:
Unfortunately, the setting is not in effect by only a Buildship project import. It seems you need to also run the gradle eclipse task and then refresh the project in Eclipse. |
Any news on this? |
+1 |
1 similar comment
+1 |
I have (sort of a) workaround. I've implemented a sample Buildship extension that reads the encoding from the Java compile options and sets it the corresponding Eclipse workspace project. It's not production-ready (no test coverage, etc.), but it should do the job. Please try it out and give me feedback. If it works fine, I might be able to merge it into the Buildship core. |
Is this fix part of the next release? |
The sample extension did not work for me |
I'm the original reporter of this feature request in Eclipse Bugzilla back in March 2016. I still think this is a really important feature as soon as you work in a mixed-OS environment and/or you don't use a default text file encoding. This feature was present in the old Gradle-Eclipse plugin from SpringSource and it's surprising that it's not yet in Buildship, where a recurring motto is that the build script should be "the truth". |
Since Eclipse 2022-06, Eclipse warns if the encoding of the project is not set. Warn when a project does not have the encoding set |
From @onmishkin
|
Since this is a requirement now, the feature should be prioritized. |
Good news :-) |
We observed failing tests on CI verifying that the Gradle tasks view refreshes when workspace projects open and close. The test started to fail for Eclipse versions 4.24 and above. The root cause was that the event listener checked for project open events with an equals operation: delta.getFlags() == IResourceDelta.OPEN It can happen, though, that the delta contains other flags. The proper check uses byte manipulation: 0 != (delta.getFlags() & IResourceDelta.OPEN) The tests started to fail only for Eclipse 4.24 because that’s the first version that requires an encoding configured for all workspace projects. Buildship does not do that yet (see issue #344). The missing configuration is visualized with a warning marker that’s also observed in the resource delta: delta.getFlags() == IResourceDelta.OPEN && IResourceDelta.MARKERS
@donat any update on this? |
Original post: https://bugs.eclipse.org/bugs/show_bug.cgi?id=488947
The text was updated successfully, but these errors were encountered: