jbang icon indicating copy to clipboard operation
jbang copied to clipboard

allow resolve properties on aliasrefs

Open maxandersen opened this issue 5 months ago • 2 comments

in //DEPS we allow use of property replacement to support things like autodetected properties like ${os.detected.*} and user specified config ${quarkus.version}.

But we don't apply those when running as a scriptref.

Making

jbang https://github.com/HanSolo/jarkanoid/releases/download/17.0.17/jarkanoid-${os.detected.jfxname}-17.0.17.jar not work....when it would be nice it could.

see https://github.com/HanSolo/jarkanoid/releases/download/17.0.17/jarkanoid-${os.detected.jfxname}-17.0.17.jar for the standard naming patterns

note, its not just https, jbang org.openjfx:javafx-graphics:11.0.2:${os.detected.jfxname} fails too ...which it shouldn't imo given //DEPS works.

writing this out i'm thinking more and more that on scriptref's we should apply property replacement before we pass it further down...though we don't want to loose the original value either - which is where i'm currently stomped.

maxandersen avatar Aug 09 '25 07:08 maxandersen

@quintesse i'm thinking we could probably put this into resourceResolvers - add a call to PropertiesValueResolver.replaceProperties(item, ...) in select places.

I think we didn't do that in start as a) resourceresolvers weren't around then b) resourceresolvers don't have access to the current build context so can't access relevant properties.

But maybe we should enable them to have that access? wdyt?

maxandersen avatar Aug 09 '25 07:08 maxandersen

FOr me the question is more: why do you want to keep the original value around? That's normally not how property replacement works. You do it early so lower pieces of code don't need to deal with it, right?

And then there'd be no need to pass things (even deeper) down.

quintesse avatar Aug 09 '25 11:08 quintesse