Skip to content
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

Update package mapping to include wildcards protoc task #240

Draft
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

Dogacel
Copy link
Contributor

@Dogacel Dogacel commented Nov 8, 2022

No description provided.

@@ -26,6 +30,7 @@ open class KotlinProtocTask : ProtocTask() {
it.resolve("bin/protoc-gen-pbandk" + ".bat".takeIf { OperatingSystem.current().isWindows }.orEmpty())
}))
pluginOptions.add(kotlinPackage.map { "kotlin_package" to it })
pluginOptions.add(kotlinPackageMapping.map { "kotlin_package_mapping" to it })
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a guess about why it's failing (I haven't tested this yet): I suspect that when kotlinPackageMapping is empty, this code will still add a null value to the pluginOptions list. When ProtocTask then runs protoc, it ends up passing a bogus value on the command line for the protoc-gen-pbandk plugin options.

This bug has always been here, even with the kotlinPackage line above this one. But it was never noticed because even though kotlinPackage is @Optional, every existing use of KotlinProtocTask provides a value for kotlinPackage.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can be dumb but how about providing an empty string as the default value? I think it should convert to an empty list behind the curtains.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@garyp we are releasing 0.14.2 without this protoc task, would that be OK? What should we do for new proto options?

@Dogacel Dogacel force-pushed the update-package-mapping-to-include-wildcards-protoc-task branch from 2423750 to f1fd6f4 Compare November 9, 2022 07:11
@Dogacel Dogacel force-pushed the update-package-mapping-to-include-wildcards-protoc-task branch from f1fd6f4 to ffb90ea Compare November 9, 2022 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants