|
23 | 23 | from model.Library import Library
|
24 | 24 |
|
25 | 25 | script_dir = os.path.dirname(os.path.realpath(__file__))
|
| 26 | +MONOREPO_NAME = 'google-cloud-java' |
26 | 27 |
|
27 | 28 | """
|
28 | 29 | Main function in charge of generating libraries composed of more than one
|
@@ -64,23 +65,24 @@ def generate_composed_library(
|
64 | 65 | print('downloading googleapis')
|
65 | 66 | util.sh_util(f'download_googleapis_files_and_folders "{output_folder}" "{googleapis_commitish}"')
|
66 | 67 |
|
| 68 | + is_monorepo = config.destination_path == MONOREPO_NAME |
67 | 69 |
|
68 | 70 | base_arguments = []
|
69 | 71 | base_arguments += util.create_argument('gapic_generator_version', config)
|
70 | 72 | base_arguments += util.create_argument('grpc_version', config)
|
71 | 73 | base_arguments += util.create_argument('protobuf_version', config)
|
72 | 74 |
|
73 | 75 | destination_path = f'java-{library.api_shortname}'
|
74 |
| - if config.destination_path == 'google-cloud-java': |
| 76 | + if is_monorepo: |
75 | 77 | destination_path = config.destination_path + '/' + destination_path
|
76 | 78 |
|
77 | 79 | versions_file = ''
|
78 |
| - if 'google-cloud-java' in destination_path: |
| 80 | + if is_monorepo: |
79 | 81 | print('this is a monorepo library')
|
80 | 82 | library_folder = destination_path.split('/')[-1]
|
81 | 83 | if repository_path is None:
|
82 |
| - repository_path = f'{output_folder}/google-cloud-java' |
83 |
| - clone_out = util.sh_util(f'sparse_clone "https://github.com/googleapis/google-cloud-java.git" "{library_folder} google-cloud-pom-parent google-cloud-jar-parent versions.txt .github"', cwd=output_folder) |
| 84 | + repository_path = f'{output_folder}/{MONOREPO_NAME}' |
| 85 | + clone_out = util.sh_util(f'sparse_clone "https://github.com/googleapis/{MONOREPO_NAME}.git" "{library_folder} google-cloud-pom-parent google-cloud-jar-parent versions.txt .github"', cwd=output_folder) |
84 | 86 | print(clone_out)
|
85 | 87 | versions_file = f'{repository_path}/versions.txt'
|
86 | 88 | else:
|
|
0 commit comments