Skip to content

Add support for adding a new repository available to %use line magics #466

Open
@cmelchior

Description

@cmelchior

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions