-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bug that haven't allowed to execute any code (including dependenc…
…ies code) via USE(). Add Gradle-like API for adding dependencies. Fix #367
- Loading branch information
Showing
4 changed files
with
85 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
jupyter-lib/api/src/main/kotlin/org/jetbrains/kotlinx/jupyter/api/libraries/gradleLike.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package org.jetbrains.kotlinx.jupyter.api.libraries | ||
|
||
import java.io.File | ||
|
||
interface DependenciesConfigurator { | ||
fun dependencies(action: DependencyHandlerScope.() -> Unit) | ||
fun repositories(action: RepositoryHandlerScope.() -> Unit) | ||
} | ||
|
||
interface RepositoryHandlerScope { | ||
fun maven(url: String) | ||
fun dir(dir: File) | ||
} | ||
|
||
interface DependencyHandlerScope { | ||
fun implementation(coordinates: String) | ||
fun implementation(group: String, artifact: String, version: String) | ||
} | ||
|
||
fun RepositoryHandlerScope.mavenCentral() = maven("https://repo.maven.apache.org/maven2/") | ||
fun RepositoryHandlerScope.google() = maven("https://dl.google.com/dl/android/maven2/") | ||
fun RepositoryHandlerScope.mavenLocal() = maven("*mavenLocal") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters