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 adding a new repository available to %use line magics #466

Open
cmelchior opened this issue Aug 22, 2024 · 1 comment
Open

Comments

@cmelchior
Copy link
Contributor

See https://kotlinlang.slack.com/archives/C05333T208Y/p1724308760303349

Sometimes, you want to combine the ease of use with e.g%use kandy, but pull artifacts from a private repository.

For custom libraries, people can define their own library definition, but this gets clunky for 3rd party libraries.

Off the top of my head, I see two options, but it probably requires a bit of thought. Especially around which order repositories should be checked.


Possible API's:

Take into account USE if it was defined in a previous cell, e.g.:

// Cell 1
USE {
    repositories {
        maven {
            url = "<repo1-url>"
            credentials {
                username = "auth-username"
                password = "auth-token"
            }
        }
    }
}

Cell 2
// Will use repo1 before checking default repositories
// Should probably check repo1 after any repository defined in kandy.json
%use kandy

Introduce a new line magic that does it:

%repository maven(url = "repo1-url", username = "auth-username", password = "auth-token") 
%use kandy
@ileasile
Copy link
Contributor

Approach (1) should already work. Order of repositories doesn't matter until you publish the same version to 2 different repos with different content (which is shooting in your own knee)

Approach (2) seems to be not needed unless we already have @repository annotation

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