Interface ModernizerBackend
public interface ModernizerBackend
Operations the terminal UI delegates to the modernizer
-
Method Summary
Modifier and TypeMethodDescriptionbooleanapplyRecipe(String recipe, String plugin, boolean dryRun) Apply a recipe to a plugin.doctor()Validate the configuration and describe the environment: Java, Maven, GitHub, cache and installed JDKs.booleandraft()expandPlugins(String value) Expand what a user typed for one plugin: a file lists plugins one per line (like--plugin-file), a directory is a local plugin (like--plugin-path) and anything else is a plugin name.booleanfetchMetadata(String plugin) Collect the metadata of a plugin.recipes()Directory holding the sources of a plugin: the directory itself for a local plugin, its clone in the cache otherwise.version()
-
Method Details
-
version
String version()- Returns:
- the version of the modernizer
-
recipes
List<RecipeInfo> recipes()- Returns:
- the available recipes
-
expandPlugins
Expand what a user typed for one plugin: a file lists plugins one per line (like--plugin-file), a directory is a local plugin (like--plugin-path) and anything else is a plugin name.- Parameters:
value- a plugin name, a directory or a file, as an absolute path for files and directories- Returns:
- the plugin names or paths to process
- Throws:
IllegalArgumentException- if a file cannot be read
-
fetchMetadata
-
applyRecipe
Apply a recipe to a plugin. Called from a task thread. -
sources
Directory holding the sources of a plugin: the directory itself for a local plugin, its clone in the cache otherwise. A remote plugin is only cloned once a task processes it.- Parameters:
plugin- plugin name or local plugin path- Returns:
- the absolute path of the sources, which may not exist yet
-
doctor
List<DoctorCheck> doctor()Validate the configuration and describe the environment: Java, Maven, GitHub, cache and installed JDKs. Called from a background thread.- Returns:
- the checks, grouped by section in display order
-
draft
boolean draft()- Returns:
- true if pull requests are opened as drafts
-