Skip to content

Commit 3a569d2

Browse files
committed
add global config
1 parent c86892a commit 3a569d2

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

cadl_to_sdk_config.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"dependencies": {
3+
"@azure-tools/cadl-python": "latest",
4+
"@azure-tools/cadl-autorest": "latest",
5+
"@azure-tools/cadl-azure-core": "latest",
6+
"@azure-tools/cadl-dpg": "latest",
7+
"@cadl-lang/compiler": "latest",
8+
"@cadl-lang/openapi": "latest",
9+
"@cadl-lang/openapi3": "latest",
10+
"@cadl-lang/prettier-plugin-cadl": "latest",
11+
"@cadl-lang/versioning": "latest",
12+
"@cadl-lang/rest": "latest",
13+
"prettier": "latest"
14+
}
15+
}

tools/azure-sdk-tools/packaging_tools/generate_utils.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import logging
44
import os
55
import re
6+
import shutil
67

78
from azure_devtools.ci_tools.git_tools import get_add_diff_file_list
89
from pathlib import Path
@@ -367,7 +368,10 @@ def gen_cadl(cadl_relative_path: str, spec_folder: str) -> Dict[str, Any]:
367368

368369
# npm install tool
369370
origin_path = os.getcwd()
371+
cadl_to_sdk_config = origin_path / "cadl_to_sdk_config.json"
370372
os.chdir(Path(spec_folder) / cadl_relative_path)
373+
if not Path("package.json").exists():
374+
shutil.copy(cadl_to_sdk_config, "package.json")
371375
check_call("npm install", shell=True)
372376

373377
# generate code

0 commit comments

Comments
 (0)