Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a URL translator callback. #8

Closed
yogurtearl opened this issue Nov 28, 2022 · 1 comment
Closed

Provide a URL translator callback. #8

yogurtearl opened this issue Nov 28, 2022 · 1 comment
Assignees

Comments

@yogurtearl
Copy link

If the foojay disco API returns something like this in the JSON response: https://cdn.azul.com/zulu/bin/zulu11.56.19-ca-fx-jdk11.0.15-macosx_x64.dmg
I may need to translate that to https://internal-proxy.mycorp.com/azul-cdn/zulu/bin/zulu11.56.19-ca-fx-jdk11.0.15-macosx_x64.dmg before gradle tries to use that URI.

Please provide a plugin extenstion API that will allow me to add my own translation

Something like this:

foojayToolchains {
    translateDownloadUri { uri: URI -> 
         // custom logic for translating to https://internal-proxy.mycorp.com/
         return translatedUri
    } 
}
@jbartok jbartok self-assigned this Nov 29, 2022
@jbartok
Copy link
Member

jbartok commented Nov 29, 2022

@yogurtearl one thing you could do to have the functionality you describe is to just reuse the logic from FoojayApi.toUri() (it's at GAV coordinates org.gradle.toolchains:foojay-resolver:0.1 in the https://plugins.gradle.org/m2/ Maven repo) and then, based on that write your own Toolchain Resolver Plugin, which would add the URI translation you need.

I don't think we would implement the translation capability ourselves at the moment (primarily due to lack of resources). Even if we would, I think it would end up as a generic toolchain auto-provisioning feature and not specific to the Foojay resolver plugin. So, if you feel very strongly about it, then pls. file an issue on gradle/gradle.

@jbartok jbartok closed this as completed Nov 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants