Repository navigation
feat: add info source-jar and source-path commands - #2668
arnabnandy7 wants to merge 7 commits into
Conversation
Signed-off-by: Arnab Nandy <arnab_nandy7@yahoo.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one) (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
this works good for GAV's but it fails on aliases/scripts.
|
Signed-off-by: Arnab Nandy <arnab_nandy7@yahoo.com>
Currently We could definitely support this! Similar to how @maxandersen would you like me to include that script source-jar packaging in this PR, or should we keep this PR focused on GAVs / JARs and follow up with script source-jar generation in a separate PR? |
|
About source jar for scripts then let's do that separately - I might be a bit more gnarly to do :) |
Signed-off-by: Arnab Nandy <arnab_nandy7@yahoo.com>
right, let's keep this PR focused on JARs and GAVs and tackle script source-JAR generation in a follow-up. |
Signed-off-by: Arnab Nandy <arnab_nandy7@yahoo.com>
3e72365 to
d4f5a36
Compare
maxandersen
left a comment
There was a problem hiding this comment.
finding a few nits/bugs:
- returning wrong source jar when sources dont exist:
jbang info source-jar io.netty:netty-tcnative-boringssl-static:2.0.61.Final /Users/max/.m2/repository/io/netty/netty-tcnative-classes/2.0.61.Final/netty-tcnative-classes-2.0.61.Final-sources.jar
it should be empty. instead it seems to be first transitive source jar?
-
mixed casing in cache file - could just use "sources-file" and "sources-checked" or maybe just presence of "sources-file": null is enough?
-
above made me also realising there aren't actually any tests for this feature (incl. no source available) so lets fix that first.
Signed-off-by: Arnab Nandy <arnab_nandy7@yahoo.com>
@maxandersen that happened because I updated Running
Standardized the keys to "sources-file" and "sources-checked". I looked into doing The deserializer also still handles the older camelCase keys (sourceFile, sourcesChecked) so existing cache files continue to work without issue.
Added tests for the both:
|
Signed-off-by: Arnab Nandy <arnab_nandy7@yahoo.com>
|
Realizing that return artifacts.stream().map(ar -> {
if (downloadSources) sourcePath = downloadSources(ar.getArtifact())...So
Your previous method avoided that so probably better to return that as otherwise source-jar gets to be very slow even when it do not have to be. |
Signed-off-by: Arnab Nandy <arnab_nandy7@yahoo.com>
@maxandersen Reverted the changes. |
Description
Implemented
jbang info source-jarandjbang info source-pathto resolve and print source JARs for archives, dependencies, and scripts, complementing the existingjbang info jarandjbang info classpathcommands:jbang info source-jar <scriptOrJar>: Resolves and prints the path to the source JAR for a specified JAR file, archive, or Maven GAV coordinate (via sibling check, embedded pom metadata, or Maven repository resolution). Fails with a non-zero exit code when no source JAR is available.jbang info source-path <scriptOrJar>: Resolves and prints the operating-system-specific separated path (:on Unix,;on Windows) of source JARs for project dependencies, with--deps-onlyoption support to omit the application source archive.jbang info tools: Added--download-sourcesflag and populatedapplicationSourceJarandresolvedSourceDependenciesfields inScriptInfo(also triggered automatically when querying source fields via--select).ArtifactResolver,DependencyCache,DependencyUtil, andModularClassPathto resolve, track, and cache source JAR paths alongside binary artifacts.jbang-info-source-jar.adocandjbang-info-source-path.adoc, updatedtroubleshooting.adocand CLI navigation docs, and added unit tests inTestInfo.Fixes #2663