-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add jbang and gav output formats
Closes #306
- Loading branch information
1 parent
980371e
commit 4b84a0c
Showing
7 changed files
with
46 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
src/main/java/it/mulders/mcs/search/printer/GavOutput.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package it.mulders.mcs.search.printer; | ||
|
||
public final class GavOutput implements CoordinatePrinter { | ||
@Override | ||
public String provideCoordinates(final String group, final String artifact, final String version, String packaging) { | ||
if("jar".equals(packaging)) | ||
return "%s:%s:%s".formatted(group, artifact, version); | ||
else | ||
return "%s:%s:%s@%s".formatted(group, artifact, version, packaging); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/main/java/it/mulders/mcs/search/printer/JBangOutput.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package it.mulders.mcs.search.printer; | ||
|
||
public final class JBangOutput implements CoordinatePrinter { | ||
@Override | ||
public String provideCoordinates(final String group, final String artifact, final String version, String packaging) { | ||
if("jar".equals(packaging)) | ||
return "//DEPS %s:%s:%s".formatted(group, artifact, version); | ||
else | ||
return "//DEPS %s:%s:%s@%s".formatted(group, artifact, version, packaging); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters