-
Notifications
You must be signed in to change notification settings - Fork 322
Description
How to reproduce
- Get my cadl project
npm installnpx cadl compile . --emit @azure-tools/cadl-java --arg "java-sdk-folder=/tmp/java"
Result
Encounter Error:
error import-not-found: Couldn't resolve import "@azure-tools/cadl-python"
error emitter-not-found: Emitter with name @azure-tools/cadl-python is not found.
Found 2 errors.
Expect
Generate java sdk succesfully.
Root cause analysis:
The package.json's dependencies doesn't include emitter @azure-tools/cadl-python, which is defined in cadl-project.yaml.
As discussed with @weshaggard and @allenjzhang , package.json doesn't include any sdk emitters by default. When running in sdk automation pipeline, we only install the target sdk emitter in package.json. For example, I want to generate java sdk and I have installed @azure-tools/cadl-java in package.json, and then run command npx cadl compile . --emit @azure-tools/cadl-java --arg "java-sdk-folder=/tmp/java", cadl should generate java sdk and don't check whether @azure-tools/cadl-python exist or not when I specify the java emitter in command.
I also test this issue in cadl v0.37.* and it works well. So this issue only exists in v0.38.*.