jlleitschuh
09/07/2017, 3:35 AM[main] ERROR main - Error: Supertypes of the following classes cannot be resolved. Please make sure you have the required dependencies in the classpath:
class api.GradleProject, unresolved supertypes: Object
Exception in thread "main" java.lang.IllegalStateException: Internal error: unable to compile script, see log for details
at compiler.KotlinCompilerKt.compileKotlinScriptToDirectory(KotlinCompiler.kt:49)
at compiler.Main.main(Main.kt:45)
Object
should be on the classpath?!
class Resolver : DependenciesResolver {
override fun resolve(scriptContents: ScriptContents, environment: Environment): DependenciesResolver.ResolveResult =
DependenciesResolver.ResolveResult.Success(
ScriptDependencies(classpath = classPath, imports = listOf("api.*", "compiler.*")))
private
val classPath: List<File>
get() {
println("Getting Classpath")
val classPath = listOf(
api.Action::class,
kotlin.PublishedApi::class,
kotlin.reflect.KClass::class,
Resolver::class
).map {
it.java.protectionDomain.codeSource.location.toURI()
}.map {
File(it)
} + PathUtil.getJdkClassesRootsFromCurrentJre()
println("Got classpath: $classPath")
return classPath
}
}