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 a function to configure dependencies and repositories in gradle-like manner #367

Closed
altavir opened this issue May 15, 2022 · 1 comment · Fixed by #382
Closed

Add a function to configure dependencies and repositories in gradle-like manner #367

altavir opened this issue May 15, 2022 · 1 comment · Fixed by #382

Comments

@altavir
Copy link
Contributor

altavir commented May 15, 2022

File-level annotations seem to be rather artificial for the notebook. I propose to add a configuration function that will contatin all necesary repositories and dependencies notations. So instead of writing

@file:Repository("https://repo.kotlin.link")
@file:DependsOn("space.kscience:plotlykt-jupyter:0.5.0")

we could do

notebook.configure{
  repositories{
    maven("https://repo.kotlin.link")
  }
  dependencies{
    implementation("space.kscience:plotlykt-jupyter:0.5.0")
  }
}

I specifically made the design exatly the same as gradle configuration. People could just copy configuration blocks from library descriptions or even from mavenCentral.

The configuration could be simplified with some shortcuts

notebook.repositories.maven("https://repo.kotlin.link")
notebook.dependencies += "space.kscience:plotlykt-jupyter:0.5.0"

Later some additional configuraion options could be added in the same configuration block.

@ileasile
Copy link
Member

Yes, it's doable

@ileasile ileasile added this to the 0.12.0 milestone May 17, 2022
ileasile added a commit that referenced this issue Aug 17, 2022
…ies code) via USE(). Add Gradle-like API for adding dependencies.

Fix #367
ileasile added a commit that referenced this issue Aug 24, 2022
…ies code) via USE(). Add Gradle-like API for adding dependencies.

Fix #367
ileasile added a commit that referenced this issue Aug 25, 2022
…ies code) via USE(). Add Gradle-like API for adding dependencies.

Fix #367
ileasile added a commit that referenced this issue Aug 25, 2022
…ies code) via USE(). Add Gradle-like API for adding dependencies.

Fix #367
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants