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

Integrate with kotlin gradle plugin #196

Merged
merged 2 commits into from
Dec 20, 2017
Merged

Integrate with kotlin gradle plugin #196

merged 2 commits into from
Dec 20, 2017

Conversation

zpencer
Copy link
Contributor

@zpencer zpencer commented Dec 5, 2017

This tries to be generic wrt language build tasks, and specifically tests against kotlin. If users want to enable additional unsupported languages, they can set the project property protobuf_gradle_plugin_additional_languages as a List<String> of more languages.

Test projects are now created programmatically by repeatedly copying overlay directories into a temp directory.
Updated tests and examples:

  • testProjectKotlin is a kotlin only project
  • testProjectJavaAndKotlin is a java+kotlin project

This only tests a plain kotlin project. A follow up PR will address Android.

@zpencer zpencer requested a review from zhangkun83 December 5, 2017 03:44
Copy link
Collaborator

@zhangkun83 zhangkun83 left a comment

Choose a reason for hiding this comment

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

Generally LGTM with minor comments.

@@ -59,6 +60,23 @@ class ProtobufPlugin implements Plugin<Project> {
'android-library',
]

private static final String USER_LANG_PROP = 'protobuf_gradle_plugin_additional_languages'
Copy link
Collaborator

Choose a reason for hiding this comment

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

gRPC use lower camelcase for its project property names. A quick search on the internet also shows such pattern:
http://mrhaki.blogspot.com/2016/05/gradle-goodness-get-property-or-default.html
We should probably follow.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

javaCompileTask.dependsOn(generateProtoTask)
generateProtoTask.getAllOutputDirs().each { dir ->
javaCompileTask.source project.fileTree([dir:dir])
project.sourceSets.each { SourceSet sourceSet ->
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you have plan to add support for Android projects?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I have a PR that's ready to be posted after this one is merged.

@zpencer zpencer merged commit 041a06a into google:master Dec 20, 2017
@zpencer zpencer deleted the kotlin branch December 20, 2017 18:24
@hartmut-co-uk
Copy link

any plans for this to get released? Is there a snapshot version available that can/should be used?

@zpencer
Copy link
Contributor Author

zpencer commented Jan 29, 2018

Since #208 is now resolved, I think we can release what we have on master branch @zhangkun83

zhangkun83 pushed a commit to zhangkun83/protobuf-gradle-plugin-1 that referenced this pull request Nov 7, 2018
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.

3 participants