ballerina-platform / ballerina-library

The Ballerina Library
https://ballerina.io/learn/api-docs/ballerina/
Apache License 2.0
136 stars 64 forks source link

Using `bal run` command in a project where `ballerinax/mi` is imported generates the connector zip file #7392

Open poorna2152 opened 1 day ago

poorna2152 commented 1 day ago

Description

When the ballerinax/mi is imported the connector for MI should be generated only when the bal tool mi command is run. But even when the bal run command is invoked in a project where the ballerinax/mi is imported this generates the zip file.

Steps to Reproduce

  1. Create a ballerina project
  2. Add the following content to a ballerina file.
    
    import ballerinax/mi;

@mi:ConnectorInfo public function calculateTotal(xml invoice) returns xml { xml prices = invoice/**/; int total = from xml:Element element in prices let int|error price = int:fromString(element.data()) where price is int collect sum(price); return xml <total>${total}</total>; }



3. Run the `bal run` command. 
This would generate the zip file.

### Version

v0.1.2

### Environment Details (with versions)

_No response_