File tree Expand file tree Collapse file tree 4 files changed +21
-9
lines changed
src/main/kotlin/com/tschuchort/compiletesting Expand file tree Collapse file tree 4 files changed +21
-9
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ Configure compilation
4747 sources = listOf (kotlinSource, javaSource)
4848
4949 // pass your own instance of an annotation processor
50- annotationProcessors = listOf (MyAnnotationProcessor ()))
50+ annotationProcessors = listOf (MyAnnotationProcessor ())
5151
5252 inheritClasspath = true
5353 messageOutputStream = System .out // see diagnostics in real time
@@ -98,7 +98,7 @@ Add dependency to your module `build.gradle` file:
9898``` Groovy
9999dependencies {
100100 // ...
101- implementation 'com.github.tschuchortdev:kotlin-compile-testing:1.1.0 '
101+ implementation 'com.github.tschuchortdev:kotlin-compile-testing:1.1.2 '
102102}
103103```
104104
Original file line number Diff line number Diff line change 11buildscript {
2- ext. kotlin_version = ' 1.3.21 '
2+ ext. kotlin_version = ' 1.3.31 '
33
44 repositories {
55 mavenCentral()
@@ -22,7 +22,7 @@ apply plugin: 'idea'
2222apply plugin : ' maven'
2323
2424group ' com.tschuchort'
25- version ' 1.1.0 '
25+ version ' 1.1.2 '
2626
2727sourceCompatibility = 1.8
2828
Original file line number Diff line number Diff line change @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33distributionPath =wrapper/dists
44zipStoreBase =GRADLE_USER_HOME
55zipStorePath =wrapper/dists
6- distributionUrl =https\://services.gradle.org/distributions/gradle-4.10-all.zip
6+ distributionUrl =https\://services.gradle.org/distributions/gradle-4.10.3 -all.zip
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ import org.jetbrains.kotlin.config.JvmTarget
3333import org.jetbrains.kotlin.config.Services
3434import java.io.*
3535import java.lang.RuntimeException
36+ import java.net.URI
3637import java.net.URLClassLoader
3738import java.nio.file.Files
3839import java.nio.file.Path
@@ -462,10 +463,21 @@ class KotlinCompilation {
462463 }
463464 }
464465
465- val resourcesPath = this ::class .java.classLoader
466- .getResource(" META-INF/services/org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar" ).path
467- .removeSuffix(" META-INF/services/org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar" )
468-
466+ val resourcesUri = URI .create(
467+ this ::class .java.classLoader
468+ .getResource(" META-INF/services/org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar" )
469+ .toString().removeSuffix(" /META-INF/services/org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar" )
470+ )
471+
472+ val resourcesPath = when (resourcesUri.scheme) {
473+ " jar" -> resourcesUri.schemeSpecificPart.removeSurrounding(" file:" , " !" )
474+ " file" -> resourcesUri.schemeSpecificPart
475+ else -> throw IllegalStateException (
476+ " Don't know how to handle protocol of ComponentRegistrar plugin. " +
477+ " Did you include this library in a weird way? Only jar and file path are supported."
478+ )
479+ }.removePrefix(" /" )
480+
469481 val k2JvmArgs = commonK2JVMArgs().also {
470482 it.freeArgs = sourcePaths
471483
You can’t perform that action at this time.
0 commit comments