Skip to content

Commit

Permalink
dpg, script adapt for directly use readme.java.md (Azure#28843)
Browse files Browse the repository at this point in the history
* adapt for readme.java.md

* Update parameters.py
  • Loading branch information
weidongxu-microsoft authored May 13, 2022
1 parent ecb9fbd commit 54f2f64
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions eng/mgmt/automation/generate_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def generate(
sdk_root,
'sdk', service, module
)
shutil.rmtree(os.path.join(output_dir, 'src/main'), ignore_errors=True)
# shutil.rmtree(os.path.join(output_dir, 'src/main'), ignore_errors=True)
shutil.rmtree(os.path.join(output_dir, 'src/samples/java', namespace.replace('.', '/'), 'generated'),
ignore_errors=True)
shutil.rmtree(os.path.join(output_dir, 'src/tests/java', namespace.replace('.', '/'), 'generated'),
Expand All @@ -161,7 +161,7 @@ def generate(
# use readme from spec repo
readme_file_path = readme

require_sdk_integration = not os.path.exists(output_dir)
require_sdk_integration = not os.path.exists(path.join(output_dir, 'src'))

logging.info('[GENERATE] Autorest from README {}'.format(readme_file_path))

Expand Down Expand Up @@ -269,7 +269,9 @@ def get_generate_parameters(
if readme_file_path:
# try readme.java.md, it must contain 'output-folder' and
# match pattern $(java-sdks-folder)/sdk/<service>/<module>
java_readme_file_path = readme_file_path.replace('.md', '.java.md')
java_readme_file_path = readme_file_path
if not java_readme_file_path.endswith('.java.md'):
java_readme_file_path = readme_file_path.replace('.md', '.java.md')
if uri_file_exists(java_readme_file_path):
content = uri_file_read(java_readme_file_path)
if content:
Expand Down
2 changes: 1 addition & 1 deletion eng/mgmt/automation/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

SDK_ROOT = '../../../' # related to file dir
AUTOREST_CORE_VERSION = '3.8.1'
AUTOREST_JAVA = '@autorest/java@4.0.57'
AUTOREST_JAVA = '@autorest/java@4.0.58'
DEFAULT_VERSION = '1.0.0-beta.1'
GROUP_ID = 'com.azure.resourcemanager'
API_SPECS_FILE = 'api-specs.yaml'
Expand Down

0 comments on commit 54f2f64

Please sign in to comment.