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

Refactoring ProtobufGen to use SimpleCodeGen. #1613

Conversation

gmalmquist
Copy link
Contributor

At jsirois's suggestion, the python code-gen sections of ProtobufGen
were dropped due to disuse and poor semantics (since it was
generating python code from java_protobuf_libraries).

Test-cases were modified to accomodate modified output due to
generating fewer languages.

I had to modify jar_publish slightly to pass an integration test in
jar_publish_integration that was publishing jars created from protoc
libraries.

@coveralls
Copy link

Coverage Status

Coverage decreased (-2.37%) to 66.98% when pulling 329cabf on gmalmquist:gmalmquist/protobuf-simple-codegen into 70b92c7 on pantsbuild:master.

@@ -103,55 +86,44 @@ def resolve_deps(self, deps_list, key):
.format(message=e, key=key))
return deps

def invalidate_for_files(self):
return [self.protobuf_binary]

@property
def javadeps(self):
return self.resolve_deps(self.get_options().javadeps, 'javadeps')
Copy link
Member

Choose a reason for hiding this comment

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

nit: I think it might have been important to make this a property when javadeps was stored as a local attribute and the resolve logic was more extensive

self._javadeps = ...

but now the code is so concise, maybe we should just inline it into synthetic_target_extra_dependencies (unless there is a reason you want to unit test it)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just left it in because test_protobuf_gen already had working unit tests for it, and I didn't see a reason to break that.

@ericzundel
Copy link
Member

The only major thing is the issue in simple_codegen_task.py, go ahead and put up the public review!

self.context.log.debug('Jar already extracted at {jar_path}.'.format(jar_path=jar_path))
return outdir
def execute_codegen(self, targets):
if not targets:
Copy link
Member

Choose a reason for hiding this comment

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

Is this an important change? For some reason I thought that sometimes this task might get called with no targets. In any case, do we really want to error out? Maybe just print a log message and return. It isn't anything wrong with this task (maybe the execution engine.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

okay

@gmalmquist gmalmquist force-pushed the gmalmquist/protobuf-simple-codegen branch 3 times, most recently from 277593f to 8a4fa29 Compare June 1, 2015 20:02
@coveralls
Copy link

Coverage Status

Coverage increased (+2.43%) to 69.34% when pulling 69faee8 on gmalmquist:gmalmquist/protobuf-simple-codegen into b7aceaa on pantsbuild:master.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 8a4fa29 on gmalmquist:gmalmquist/protobuf-simple-codegen into * on pantsbuild:master*.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 69.34% when pulling 8a4fa29 on gmalmquist:gmalmquist/protobuf-simple-codegen into 5a587cb on pantsbuild:master.

@gmalmquist gmalmquist force-pushed the gmalmquist/protobuf-simple-codegen branch from 8a4fa29 to 23ae942 Compare June 2, 2015 14:52
At jsirois's suggestion, the python code-gen sections of ProtobufGen
were dropped due to disuse and poor semantics (since it was
generating python code from java_protobuf_libraries).

Test-cases were modified to accomodate modified output due to
generating fewer languages.

I had to modify jar_publish slightly to pass an integration test in
jar_publish_integration that was publishing jars created from protoc
libraries.
@gmalmquist gmalmquist force-pushed the gmalmquist/protobuf-simple-codegen branch from 23ae942 to 452358a Compare June 2, 2015 15:51
@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 69.38% when pulling 23ae942 on gmalmquist:gmalmquist/protobuf-simple-codegen into 87d9faf on pantsbuild:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.05%) to 69.51% when pulling 452358a on gmalmquist:gmalmquist/protobuf-simple-codegen into f7f9ee9 on pantsbuild:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+0.05%) to 69.51% when pulling 452358a on gmalmquist:gmalmquist/protobuf-simple-codegen into f7f9ee9 on pantsbuild:master.

@gmalmquist gmalmquist closed this Jun 9, 2015
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