Skip to content
This repository has been archived by the owner on Mar 1, 2022. It is now read-only.

Creating aspect option (ALL, CODE, PACKAGE) #475

Merged
merged 2 commits into from
Jul 26, 2018

Conversation

garrettjonesgoogle
Copy link
Member

This will only work for C# so far; after googleapis/gapic-generator#2166 , it will work for Java too.

Copy link
Contributor

@vam-google vam-google left a comment

Choose a reason for hiding this comment

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

In general looks good, with several comments.


def get_tasks(self, **kwargs):
tasks = self.get_grpc_codegen_tasks(**kwargs)
tasks += self._get_publish_tasks(**kwargs)
return task_utils.instantiate_tasks(tasks, kwargs)

def get_grpc_codegen_tasks(self, **kwargs):
if self.language == 'java':

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@@ -179,6 +179,11 @@ def parse_args(*args):
type=str,
help='[Required] Name of the artifact for artman to generate. Must '
'match an artifact in the artman config yaml.')
parser_generate.add_argument(
'--aspect',

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@@ -116,8 +117,19 @@ def execute(self, language, toolkit_path, descriptor_set, service_yaml,
if service_yaml:
args = args + ['--service_yaml=' + os.path.abspath(service_yaml)]
args = args + gapic_args

gapic_artifact = ''
if aspect == 'ALL':

This comment was marked as spam.

This comment was marked as spam.

@@ -54,7 +54,7 @@
}


def load_artifact_config(artman_config_path, artifact_name):
def load_artifact_config(artman_config_path, artifact_name, aspect=None):

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

Copy link
Contributor

@vam-google vam-google left a comment

Choose a reason for hiding this comment

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

LGTM, but I still don't like the huge get_grpc_codegen_tasks method.

@@ -179,6 +179,11 @@ def parse_args(*args):
type=str,
help='[Required] Name of the artifact for artman to generate. Must '
'match an artifact in the artman config yaml.')
parser_generate.add_argument(
'--aspect',

This comment was marked as spam.


def get_tasks(self, **kwargs):
tasks = self.get_grpc_codegen_tasks(**kwargs)
tasks += self._get_publish_tasks(**kwargs)
return task_utils.instantiate_tasks(tasks, kwargs)

def get_grpc_codegen_tasks(self, **kwargs):
if self.language == 'java':

This comment was marked as spam.

@garrettjonesgoogle
Copy link
Member Author

ALL vs CODE_AND_PACKAGE: I considered the second, but I wanted to allow for adding a third item, and the default should be to include everything I think.

@garrettjonesgoogle
Copy link
Member Author

I split apart the long function, PTAL

@garrettjonesgoogle garrettjonesgoogle merged commit 8662dfe into googleapis:master Jul 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants