Skip to content

Extracting config files from resources in jars on the classpath #217

Closed
@muryoh

Description

@muryoh

Hey, thanks for the plugin 👍

I like the idea, however I am unable to achieve what I would expect to be achievable.
Typically, my company uses a global import order configuration and code formatter configuration.

What we usually do is try to use opensource plugins over which we apply "standard" (as in company standard) configuration.

So typically, I would like to be able to create a plugin that applies and configures this very plugin. However, the configuration can only be done using File instances. But when you're in a JAR, you don't have a File

A possible workaround would have been to do something like
spotlessApply.doFirst {
...
}

And, there, create the files before the tasks run. However:

  • the tasks are only created in an afterEvaluate{} block which forces me to put that doFirst {} in another afterEvaluate {} block
  • tasks are not configured lazily: the files provided in the configuration are loaded as soon as the tasks are created

Do you have any pointers as to how you'd do that?

Cheers

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions