-
Notifications
You must be signed in to change notification settings - Fork 467
Load Eclipse configuration from JAR classpath. #744
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
Comments
This is what I am currently trying to configure eclipse: java {
eclipse().configFile project.resources.text.fromUri(getClass().classLoader.getResource('ilm-format-default-configs/eclipse.xml')).asFile()
} ... which gives me the following error:
|
Eclipse can store its preferences in two different formats: as an xml file with a You can probably fix this by taking the File that |
So I've also tried to copy that file out of the JAR into the build directory, and pass the path to the resulting file to spotless without problem. That is, unless I clean the project as part of a chain of task targets (such as I've taken a look at blowdryer, but it seems to be heavily focused on pulling configurations from a web URL, mainly git. Does that plugin support pulling files from JAR files? |
|
On the last part, I see! I've dug a little more into the blowdryer plugin. It looks like it's basically using a simple URL request via HTTP in GitHub's example, but this does not account for auth. In my organization, we're using GitLab cloud with all private repositories, and by policy we aren't able to open up public repositories. I also don't want to force a configuration on every dev's workstation to configure HTTP credentials when we are already using SSH key auth. It should be easy enough to provide the gitlab raw URL with the I also see mention in the docs for blowdryer around the repo location that defaults to |
The issue linked above describes how to add that functionality. Happy to merge a PR for it, but no plans to implement ourselves. Adding support for the local Jar is pretty easy, adding support for http auth is a little harder. |
I've looked at another issue that was reported here regarding this topic, but I don't think there's a clear answer of how to include an Eclipse configuration from a JAR.
I am specifically trying to create a standard code formatting posture as a Gradle plugin that we can include in projects. The custom Gradle plugin will configure spotless and include a custom Eclipse config and a license header template. I've given options for consumers of the plugin to define their own custom configuration files, but if that configuration is not given, I want to use the default versions I've bundled in the plugin, which would come from the classpath.
I am not quite sure how to provide the default files included in the JAR as configuration to spotless. Is there a known way to do this, or is this even supported?
The text was updated successfully, but these errors were encountered: