You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What went wrong:
class com.google.protobuf.gradle.ProtobufConfiguratorExtsKt$plugins$1 tried to access private method org.gradle.kotlin.dsl.NamedDomainObjectContainerScope.(Lorg/gradle/api/NamedDomainObjectContainer;)V (com.google.protobuf.gradle.ProtobufConfiguratorExtsKt$plugins$1 is in unnamed module of loader org.gradle.internal.classloader.VisitableURLClassLoader @63d58557; org.gradle.kotlin.dsl.NamedDomainObjectContainerScope is in unnamed module of loader org.gradle.internal.classloader.VisitableURLClassLoader @4cc0edeb)
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
import com.google.protobuf.gradle.*
import org.gradle.kotlin.dsl.provider.gradleKotlinDslOf
plugins {
java
idea
application
kotlin("jvm") version "1.3.10"
id("com.google.protobuf") version "0.8.7"
}
group = "KotlinPOC"
version = "1.0-SNAPSHOT"
application {
mainClassName = "kotlin.poc.main"
}
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
repositories {
mavenCentral()
jcenter()
listOf("http://dl.bintray.com/kotlin/kotlin-eap",
"https://dl.bintray.com/kotlin/ktor",
"https://dl.bintray.com/kotlin/kotlinx",
"https://plugins.gradle.org/m2/")
.forEach { maven { url = uri(it) }
}
}
val kotlinVersion = "1.3.10"
val ktorVersion = "1.0.0-rc"
val junitVersion = "5.3.1"
val grpcVersion = "1.15.1"
val protobufVersion = "3.6.1"
val log4j2Version = "2.11.1"
dependencies {
compile(kotlin("stdlib-jdk8"))
compile("io.ktor:ktor-server-netty:${ktorVersion}")
compile("io.ktor:ktor-html-builder:${ktorVersion}")
compile("com.google.protobuf:protobuf-java:${protobufVersion}")
compile("io.grpc:grpc-netty:${grpcVersion}")
compile("io.grpc:grpc-protobuf:${grpcVersion}")
compile("io.grpc:grpc-stub:${grpcVersion}")
compile("com.zaxxer:HikariCP:3.2.0")
runtime("mysql:mysql-connector-java:8.0.13")
if (JavaVersion.current().isJava9Compatible) {
// Workaround for @javax.annotation.Generated
// see: https://github.com/grpc/grpc-java/issues/3633
compile("javax.annotation:javax.annotation-api:1.3.1")
}
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.0.1")
implementation("org.apache.logging.log4j:log4j-api:${log4j2Version}")
implementation("org.apache.logging.log4j:log4j-core:${log4j2Version}")
testCompile("org.junit.jupiter:junit-jupiter-api:${junitVersion}")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${junitVersion}")
}
protobuf {
protoc {
// The artifact spec for the Protobuf Compiler
artifact = "com.google.protobuf:protoc:3.6.1"
}
plugins {
// Optional: an artifact spec for a protoc plugin, with "grpc" as
// the identifier, which can be referred to in the "plugins"
// container of the "generateProtoTasks" closure.
id("grpc") {
artifact = "io.grpc:protoc-gen-grpc-java:1.15.1"
}
}
generateProtoTasks {
ofSourceSet("main").forEach {
it.plugins {
// Apply the "grpc" plugin whose spec is defined above, without
// options. Note the braces cannot be omitted, otherwise the
// plugin will not be added. This is because of the implicit way
// NamedDomainObjectContainer binds the methods.
id("grpc")
}
}
}
}
The text was updated successfully, but these errors were encountered:
Thanks for reporting this. I figured there would need to be changes to the api as Gradle 5.0 started nearing release. It looks like there have been some visibility changes between 4.10.2 and the latest rc. I’ll try to submit pr for updating the kotlin dsl version soon
I am building with the new Kotlin DSL and it works fine on
gradle-4.10.2
but when i switch to
gradle-5.0-rc-3
it fails with the following error:
FAILURE: Build failed with an exception.
Where:
Build file 'D:\repo\cls\kotlin.poc\build.gradle.kts' line: 76
What went wrong:
class com.google.protobuf.gradle.ProtobufConfiguratorExtsKt$plugins$1 tried to access private method org.gradle.kotlin.dsl.NamedDomainObjectContainerScope.(Lorg/gradle/api/NamedDomainObjectContainer;)V (com.google.protobuf.gradle.ProtobufConfiguratorExtsKt$plugins$1 is in unnamed module of loader org.gradle.internal.classloader.VisitableURLClassLoader @63d58557; org.gradle.kotlin.dsl.NamedDomainObjectContainerScope is in unnamed module of loader org.gradle.internal.classloader.VisitableURLClassLoader @4cc0edeb)
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Here is my whole settings.gradle.kts file:
and my build.gradle.kts file:
The text was updated successfully, but these errors were encountered: