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

Add support for Kotlin installed by Scoop #486

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tats-u
Copy link

@tats-u tats-u commented Aug 27, 2023

Fixes #445

image

Copy link
Collaborator

@themkat themkat left a 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.

@tats-u
Copy link
Author

tats-u commented Aug 31, 2023

I changed the method name of the classes & interface I've added.

Copy link
Owner

@fwcd fwcd left a 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>
Copy link
Owner

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?

Copy link
Author

@tats-u tats-u Sep 3, 2023

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 (objects) that implement ClassPathResolver?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tats-u , I see that you have not been getting a reply here 🙁 I'm pretty sure that @fwcd meant creating singletons like you are asking.

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

Successfully merging this pull request may close these issues.

Support Windows Kotlin installed via Scoop
3 participants