File tree 11 files changed +36
-24
lines changed
lib/src/main/kotlin/jupyter/kotlin
shared-compiler/src/main/kotlin/org/jetbrains/kotlinx/jupyter/dependencies
kotlin/org/jetbrains/kotlinx/jupyter
test/kotlin/org/jetbrains/kotlinx/jupyter/test
11 files changed +36
-24
lines changed Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ dependencies {
103
103
implKotlin(" scripting-compiler-impl-embeddable" )
104
104
implKotlin(" scripting-compiler-embeddable" )
105
105
implKotlin(" scripting-ide-services" )
106
- implKotlin(" main-kts " )
106
+ implKotlin(" scripting-dependencies-maven " )
107
107
implKotlin(" script-util" )
108
108
implKotlin(" scripting-common" )
109
109
Original file line number Diff line number Diff line change 8
8
9
9
# Kotlin kernel for IPython/Jupyter
10
10
11
- [ Kotlin] ( https://kotlinlang.org/ ) (1.5.30-dev-454 ) kernel for [ Jupyter] ( https://jupyter.org ) .
11
+ [ Kotlin] ( https://kotlinlang.org/ ) (1.5.30-dev-598 ) kernel for [ Jupyter] ( https://jupyter.org ) .
12
12
13
13
Beta version. Tested with Jupyter Notebook 6.0.3, Jupyter Lab 1.2.6 and Jupyter Console 6.1.0
14
14
on Windows, Ubuntu Linux and macOS.
Original file line number Diff line number Diff line change 1
1
# kotlinVersion=1.5.255-SNAPSHOT
2
- kotlinVersion =1.5.30-dev-454
2
+ kotlinVersion =1.5.30-dev-598
3
3
stableKotlinVersion =1.5.0
4
4
kotlinLanguageLevel =1.5
5
5
stableKotlinLanguageLevel =1.5
Original file line number Diff line number Diff line change 1
1
package jupyter.kotlin
2
2
3
- // in case of flat or direct resolvers the value should be a direct path or file name of a jar respectively
4
- // in case of maven resolver the maven coordinates string is accepted
3
+ /* *
4
+ * Describes the dependency
5
+ *
6
+ * @property value Can be one of the following:
7
+ * - Maven artifact coordinates in the following form:
8
+ * `<groupId>:<artifactId>[:<extension>[:<classifier>]]:<version>}`
9
+ * - Path to the JAR file (absolute or relative to the directory specified in [Repository])
10
+ */
5
11
@Target(AnnotationTarget .FILE )
6
12
@Repeatable
7
13
@Retention(AnnotationRetention .SOURCE )
8
14
annotation class DependsOn (val value : String = " " )
9
15
10
- // only flat directory repositories are supported now, so value should be a path to a directory with jars
16
+ /* *
17
+ * Describes the repository which is used for dependency resolution
18
+ *
19
+ * @property value Can be one of the following:
20
+ * - Maven repository URL
21
+ * - Local directory in which JARs are stored
22
+ */
11
23
@Target(AnnotationTarget .FILE )
12
24
@Repeatable
13
25
@Retention(AnnotationRetention .SOURCE )
14
26
annotation class Repository (val value : String = " " )
15
27
28
+ /* *
29
+ * Describes compilation arguments used for the compilation of this and all following snippets
30
+ *
31
+ * @property values List of free compiler arguments
32
+ */
16
33
@Target(AnnotationTarget .FILE )
17
34
@Repeatable
18
35
@Retention(AnnotationRetention .SOURCE )
Original file line number Diff line number Diff line change @@ -38,11 +38,9 @@ class RemoteResolverWrapper(private val remoteResolver: ExternalDependenciesReso
38
38
val path = " $HOME_PATH /.ivy2/cache"
39
39
path.toURLString()
40
40
},
41
- )
42
- .map {
43
- " $PREFIX${it.shortcut} " to it
44
- }
45
- .toMap()
41
+ ).associateBy {
42
+ " $PREFIX${it.shortcut} "
43
+ }
46
44
47
45
fun hasRepository (repository : RepositoryCoordinates ): Boolean {
48
46
return repositories.containsKey(repository.string)
Original file line number Diff line number Diff line change 1
1
{
2
2
"description" : " Kotlin multi-format reflection-less serialization" ,
3
3
"properties" : {
4
- "v" : " 1.0.1 "
4
+ "v" : " 1.1.0 "
5
5
},
6
6
"link" : " https://github.com/Kotlin/kotlinx.serialization" ,
7
7
"dependencies" : [
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ package org.jetbrains.kotlinx.jupyter.dependencies
3
3
import jupyter.kotlin.DependsOn
4
4
import jupyter.kotlin.Repository
5
5
import kotlinx.coroutines.runBlocking
6
- import org.jetbrains.kotlin.mainKts.impl.IvyResolver
7
6
import org.jetbrains.kotlinx.jupyter.config.getLogger
8
7
import java.io.File
9
8
import kotlin.script.dependencies.ScriptContents
@@ -18,6 +17,7 @@ import kotlin.script.experimental.dependencies.FileSystemDependenciesResolver
18
17
import kotlin.script.experimental.dependencies.RepositoryCoordinates
19
18
import kotlin.script.experimental.dependencies.impl.DependenciesResolverOptionsName
20
19
import kotlin.script.experimental.dependencies.impl.makeExternalDependenciesResolverOptions
20
+ import kotlin.script.experimental.dependencies.maven.MavenDependenciesResolver
21
21
22
22
open class JupyterScriptDependenciesResolverImpl (resolverConfig : ResolverConfig ? ) : JupyterScriptDependenciesResolver {
23
23
@@ -36,7 +36,7 @@ open class JupyterScriptDependenciesResolverImpl(resolverConfig: ResolverConfig?
36
36
init {
37
37
resolver = CompoundDependenciesResolver (
38
38
FileSystemDependenciesResolver (),
39
- RemoteResolverWrapper (IvyResolver ())
39
+ RemoteResolverWrapper (MavenDependenciesResolver ())
40
40
)
41
41
resolverConfig?.repositories?.forEach { addRepository(it) }
42
42
}
Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ import jupyter.kotlin.KotlinKernelHostProvider
7
7
import jupyter.kotlin.Repository
8
8
import org.jetbrains.kotlin.config.KotlinCompilerVersion
9
9
import org.jetbrains.kotlinx.jupyter.api.Code
10
- import org.jetbrains.kotlinx.jupyter.api.CodePreprocessor
11
10
import org.jetbrains.kotlinx.jupyter.api.ExecutionCallback
12
11
import org.jetbrains.kotlinx.jupyter.api.KotlinKernelHost
13
12
import org.jetbrains.kotlinx.jupyter.api.KotlinKernelVersion
@@ -59,7 +58,6 @@ import org.jetbrains.kotlinx.jupyter.repl.impl.SharedReplContext
59
58
import java.io.File
60
59
import java.net.URLClassLoader
61
60
import java.util.concurrent.atomic.AtomicReference
62
- import kotlin.jvm.JvmInline
63
61
import kotlin.script.experimental.api.ResultWithDiagnostics
64
62
import kotlin.script.experimental.api.ScriptCompilationConfiguration
65
63
import kotlin.script.experimental.api.ScriptConfigurationRefinementContext
Original file line number Diff line number Diff line change 11
11
<root level =" DEBUG" >
12
12
<appender-ref ref =" STDERR" />
13
13
</root >
14
+
15
+ <logger name =" org.apache" level =" ERROR" />
16
+ <logger name =" httpclient" level =" ERROR" />
17
+ <logger name =" org.eclipse.aether" level =" INFO" />
14
18
</configuration >
Original file line number Diff line number Diff line change 1
1
package org.jetbrains.kotlinx.jupyter.test
2
2
3
3
import kotlinx.coroutines.runBlocking
4
- import org.jetbrains.kotlin.mainKts.impl.IvyResolver
5
4
import org.junit.jupiter.api.Test
6
5
import org.slf4j.Logger
7
6
import org.slf4j.LoggerFactory
8
7
import java.io.File
9
8
import kotlin.script.experimental.api.ResultWithDiagnostics
10
9
import kotlin.script.experimental.dependencies.ExternalDependenciesResolver
10
+ import kotlin.script.experimental.dependencies.maven.MavenDependenciesResolver
11
11
import kotlin.test.assertTrue
12
12
13
13
class ResolverTests {
@@ -23,7 +23,7 @@ class ResolverTests {
23
23
24
24
@Test
25
25
fun resolveSparkMlLibTest () {
26
- val files = IvyResolver ().doResolve(" org.apache.spark:spark-mllib_2.11:2.4.4" )
26
+ val files = MavenDependenciesResolver ().doResolve(" org.apache.spark:spark-mllib_2.11:2.4.4" )
27
27
log.debug(" Downloaded files: ${files.count()} " )
28
28
files.forEach {
29
29
log.debug(it.toString())
Original file line number Diff line number Diff line change @@ -148,12 +148,7 @@ class ReplTests : AbstractSingleReplTest() {
148
148
val newClasspath = res.metadata.newClasspath
149
149
assertTrue(newClasspath.size >= 2 )
150
150
151
- val htmlLibPath = listOf (
152
- " org.jetbrains.kotlinx" ,
153
- " kotlinx-html-jvm" ,
154
- " jars" ,
155
- " kotlinx-html-jvm"
156
- ).joinToString(File .separator)
151
+ val htmlLibPath = " org/jetbrains/kotlinx/kotlinx-html-jvm/0.7.2/kotlinx-html-jvm" .replace(' /' , File .separatorChar)
157
152
assertTrue(newClasspath.any { htmlLibPath in it })
158
153
}
159
154
You can’t perform that action at this time.
0 commit comments