Skip to content

Commit 9e5b3c3

Browse files
eng, spec automation for cadl, update cadl-java to 0.2.2 (Azure#33097)
* eng, cadl, update cadl-java to 0.2.2 * update clean-up logic for mgmt; now all generated samples should be under generated namespace
1 parent 3f3fdd0 commit 9e5b3c3

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

eng/mgmt/automation/generate_data.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ def sdk_automation_cadl(config: dict) -> List[dict]:
6565
try:
6666
# install dependencies
6767
subprocess.run('npm install "@azure-tools/cadl-autorest@0.24.0" "@cadl-lang/eslint-config-cadl@0.5.0" "@cadl-lang/eslint-plugin@0.38.0" "@cadl-lang/library-linter@0.38.0"', shell=True, check=True)
68-
68+
6969
# install latest @azure-tools/cadl-java
70-
subprocess.run('npm install "@azure-tools/cadl-java@0.2.0"', shell=True, check=True)
71-
70+
subprocess.run('npm install "@azure-tools/cadl-java@0.2.2"', shell=True, check=True)
71+
7272
# check client.cadl
7373
cadl_source = '.'
7474
if os.path.exists(os.path.join(cadl_dir, 'client.cadl')):

eng/mgmt/automation/generate_utils.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,8 @@ def generate(
5454
shutil.rmtree(os.path.join(output_dir, 'src/main'), ignore_errors=True)
5555
shutil.rmtree(os.path.join(output_dir, 'src/test/java', namespace.replace('.', '/'), 'generated'),
5656
ignore_errors=True)
57-
if os.path.exists(os.path.join(output_dir, 'src/samples/README.md')):
58-
# samples contains hand-written code
59-
shutil.rmtree(os.path.join(output_dir, 'src/samples/java', namespace.replace('.', '/'), 'generated'),
60-
ignore_errors=True)
61-
else:
62-
shutil.rmtree(os.path.join(output_dir, 'src/samples'), ignore_errors=True)
57+
shutil.rmtree(os.path.join(output_dir, 'src/samples/java', namespace.replace('.', '/'), 'generated'),
58+
ignore_errors=True)
6359

6460
if re.match(r'https?://', spec_root):
6561
readme = urllib.parse.urljoin(spec_root, readme)

0 commit comments

Comments
 (0)