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

replacement for getFullPathIndex? #29

Open
123Haynes opened this issue Aug 19, 2019 · 3 comments
Open

replacement for getFullPathIndex? #29

123Haynes opened this issue Aug 19, 2019 · 3 comments

Comments

@123Haynes
Copy link

123Haynes commented Aug 19, 2019

Hi,

I saw that you removed the method getFullPathIndex from the WebJarAssetLocator in 60f01fb#diff-91255789c37eabd7e53b4647bc611bd0L98

Is there a replacement for this method?
I'm currently using this method in the libsass-maven-plugin. Before Release 0.39, I could pass in something like
"susy/sass/susy/_math.scss"
and get back a path like
META-INF/resources/webjars/susy/2.1.1/sass/susy/_math.scss

See https://gitlab.com/haynes/libsass-maven-plugin/blob/master/src/main/java/wrm/libsass/WebJarTranslator.java for how it's currently used in the plugin.

It would be awesome if you could add back support for a similar method. 😃

@jamesward
Copy link
Member

jamesward commented Aug 19, 2019

Thanks for reaching out! Sorry about the hassle. In your case can you use:

locator.getFullPathExact("susy", "sass/susy/_math.scss");

For reference:
https://javadoccentral.herokuapp.com/org.webjars/webjars-locator-core/0.39/org/webjars/WebJarAssetLocator.html

@123Haynes
Copy link
Author

@jamesward Thanks for your reply 😄
I'll have to rewrite stuff a little bit and extract the name from the uri, but that works for me.

That being said, I think 0.39 removed a bit of flexibility because now you don't have a function anymore where you can pass a custom regex matcher anymore.
It might be worth adding that back.

@jamesward
Copy link
Member

Yeah, I think we should be able to add more flexible filtering / params for ClassGraph (which now does the underlying classpath scanning).

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