-
Notifications
You must be signed in to change notification settings - Fork 215
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
Add support for Kotlin installed by Scoop #486
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work 🙂 Let's give @fwcd a day or two before merging in case he wants to have a look.
I changed the method name of the classes & interface I've added. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, I've left some notes below. I think it's pretty cool to have support for Scoop, but am still a bit unsure if hardcoding paths for all major packaging tools is the way to go. On the other hand, I don't see a lot of great solutions to that if we can't deduce the Kotlin compiler location from the user's PATH
...
* @param name the name of the JAR | ||
* @return the candidate full paths to the JAR | ||
*/ | ||
fun candidateAlternativeLibraryLocations(name: String): Array<String> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if I really understand this abstraction.
While it's nice to have the implementation separated by OS, this is fundamentally pretty specific to a certain kind of (fallback) library resolution, that shouldn't (IMO) live under a name as generic as org.javacs.kt.util.OSContext
. I could imagine fitting ShellPathUtils
into an interface like this, but that's a different use-case.
I think, in this case specifically I would probably even drop the interface/classes entirely and just inline the when
-check over the OS with the corresponding paths into BackupClassPathResolver
's findAlternativeLibraryLocation
.
Alternatively, if the BackupClassPathResolver
is getting too large, we might want to add a SnapClassPathResolver
/ScoopClassPathResolver
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is fundamentally pretty specific to a certain kind of (fallback) library resolution, that shouldn't (IMO) live under a name as generic as org.javacs.kt.util.OSContext. I could imagine fitting ShellPathUtils into an interface like this, but that's a different use-case.
I thought other methods that depend on the type of OS may be added in the future. I'll have to change their names.
I think, in this case specifically I would probably even drop the interface/classes entirely and just inline the when-check over the OS with the corresponding paths into BackupClassPathResolver's findAlternativeLibraryLocation.
I oppose it if it's called more than once through the entire of the program. We have to choose the appropriate instance according to user's OS. That that wasn't chosen mustn't be loaded.
The USERPROFILE
value is used only in Windows, so it must be a state enclosed in the Windows class.
we might want to add a SnapClassPathResolver/ScoopClassPathResolver?
Do they mean singletons (object
s) that implement ClassPathResolver
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes #445