-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove support for the Kotlin JS plugin #271
Remove support for the Kotlin JS plugin #271
Conversation
configureProtokt(this, null, disableJava) { | ||
"$rootDir/protokt-codegen/build/install/$CODEGEN_NAME/bin/$CODEGEN_NAME" | ||
} | ||
configureProtokt(this, null, disableJava, "$rootDir/protokt-codegen/build/install/$CODEGEN_NAME/bin/$CODEGEN_NAME") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for deferred evaluation anymore and this was causing a problem in the plugin integration test as it tried to create the new _codegen_
configuration once per target.
@@ -73,6 +72,7 @@ kotlin { | |||
all { | |||
compilations.all { | |||
kotlinOptions { | |||
allWarningsAsErrors = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The suppression of OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE
itself throws a compilation warning that can't (as far as I can tell) be excluded with a compiler arg. Gets a shrug from me.
@@ -87,13 +87,6 @@ tasks.named<Test>("jvmTest") { | |||
useJUnitPlatform() | |||
} | |||
|
|||
// awkward that we have to apply the plugin after source sets are configured |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See code comment about determining Kotlin targets without afterEvaluate
.
@@ -63,14 +63,12 @@ private fun main(`in`: InputStream, out: OutputStream) { | |||
|
|||
val grpcKotlinFiles = generateGrpcKotlinStubs(params, req) | |||
|
|||
if (files.isNotEmpty() || grpcKotlinFiles.isNotEmpty()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you generate nothing and the input has a file that uses proto3 optional
, protoc fails since you didn't reply that you support the feature. We just didn't happen to trigger this. IIRC I added this check to handle an issue we had when trying to return no files, but clearly that's not a problem anymore.
addAnnotation( | ||
AnnotationSpec.builder(Suppress::class).apply { | ||
addMember("DEPRECATION".embed()) | ||
// Suppresses a failure due to usage of @JvmStatic in common code. It seems prudent to add this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This only actually triggered a problem in the multiplatform integration test project. So strange.
@@ -431,15 +430,14 @@ private class ServiceGenerator( | |||
} | |||
|
|||
private fun <T> pivotPlugin(jvm: T, js: T) = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that we have the concept of a generation target I want to clean this up, but it's complex logic and doesn't have to be cleaned up yet.
jsProcessResources?.excludeDuplicates() | ||
} | ||
|
||
// TODO: figure out how to get rid of this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't quite figure out what's going wrong here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note - this was already needed, I just forgot about it.
@@ -139,8 +179,11 @@ private fun Project.linkGenerateProtoTasksAndIncludeGeneratedSource(sourceSetNam | |||
|
|||
extension.generateProtoTasks.ofSourceSet(protoSourceSetRoot).forEach { genProtoTask -> | |||
configureSourceSets(sourceSetName, protoSourceSetRoot, genProtoTask) | |||
|
|||
// todo: it would be better to avoid this by making the outputs of genProtoTask an input of the correct compile task |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would also like to do this correctly if at all possible.
Reworks Kotlin JS and multiplatform support to run the protoc plugin one time per target, placing generated code in a separate directory per target.
Fixes #208.