Skip to content

Commit

Permalink
PJF plugin supports the new PLUGIN_DIR/lib/*.jar structure (#617)
Browse files Browse the repository at this point in the history
palantir-java-format intellij plugin supports the new `PLUGIN_DIR/lib/*.jar` structure in addition to the old `PLUGIN_DIR/impl/*.jar` location
  • Loading branch information
carterkozak authored Jan 11, 2022
1 parent ecf9d01 commit ebbe0b1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
6 changes: 6 additions & 0 deletions changelog/@unreleased/pr-617.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
type: fix
fix:
description: palantir-java-format intellij plugin supports the new `PLUGIN_DIR/lib/*.jar`
structure in addition to the old `PLUGIN_DIR/impl/*.jar` location
links:
- https://github.com/palantir/palantir-java-format/pull/617
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,13 @@ private static List<Path> getProvidedImplementationUrls(List<URI> implementation

private static List<Path> getBundledImplementationUrls() {
// Load from the jars bundled with the plugin.
Path implDir = PalantirCodeStyleManager.PLUGIN.getPath().toPath().resolve("impl");
log.debug("Using palantir-java-format implementation bundled with plugin: {}", implDir);
return listDirAsUrlsUnchecked(implDir);
Path pluginPath = PalantirCodeStyleManager.PLUGIN.getPluginPath();
Path implDir = pluginPath.resolve("impl");
// Directory appears to have been renamed from 'impl' to 'lib' in recent idea releases
Path pathToUse = Files.isDirectory(implDir) ? implDir : pluginPath.resolve("lib");

log.debug("Using palantir-java-format implementation bundled with plugin: {}", pathToUse);
return listDirAsUrlsUnchecked(pathToUse);
}

private static List<Path> getImplementationUrls(
Expand Down

0 comments on commit ebbe0b1

Please sign in to comment.