Skip to content

Commit

Permalink
Use conditional compile (#24374)
Browse files Browse the repository at this point in the history
* Add conditional compile of client.tsp

* Always execute from main.tsp, always check client.tsp

* Fix script

* Remove yaml reference

* Update specification/cognitiveservices/HealthInsights/healthinsights.oncophenotype/tspconfig.yaml

---------

Co-authored-by: Mike Harder <[email protected]>
  • Loading branch information
markcowl and mikeharder authored Jun 8, 2023
1 parent 1290a9d commit 601e3d4
Show file tree
Hide file tree
Showing 10 changed files with 69 additions and 45 deletions.
9 changes: 8 additions & 1 deletion eng/pipelines/templates/steps/typespec-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@ steps:
pushd ${{parameters.Folder}}
# Pass "--no" to ensure npx does not install anything (TypeSpec compiler should already be installed)
npx --no tsp compile . --warn-as-error || exit_code=1
if test -f main.tsp; then
npx --no tsp compile . --warn-as-error || exit_code=1
fi
if test -f client.tsp; then
npx --no tsp compile client.tsp --no-emit --warn-as-error || exit_code=1
fi
# Format parent folder to include shared files (disabled until formatting diffs are fixed)
# npx tsp format ../**/*.tsp
Expand Down
10 changes: 10 additions & 0 deletions eng/pipelines/typespec-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,16 @@ jobs:
Folder: specification/cognitiveservices/HealthInsights/healthinsights.openapi
DisplayName: healthinsights.openapi

- template: templates/steps/typespec-ci.yml
parameters:
Folder: specification/cognitiveservices/HealthInsights/healthinsights.oncophenotype
DisplayName: healthinsights.oncophenotype

- template: templates/steps/typespec-ci.yml
parameters:
Folder: specification/cognitiveservices/HealthInsights/healthinsights.trialmatcher
DisplayName: healthinsights.trialmatcher

- template: templates/steps/typespec-ci.yml
parameters:
Folder: specification/cognitiveservices/OpenAI.Inference
Expand Down
19 changes: 19 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"@azure-tools/typespec-azure-core": "0.31.0",
"@azure-tools/typespec-azure-resource-manager": "0.31.0",
"@azure-tools/typespec-providerhub": "0.31.0",
"@azure-tools/typespec-client-generator-core": "0.31.0",
"@typespec/compiler": "0.45.0",
"@azure/avocado": "^0.8.4",
"@types/prettier": "^2.7.2",
Expand Down
2 changes: 1 addition & 1 deletion specification/cognitiveservices/AnomalyDetector/client.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ import "./main.tsp";

using Azure.ClientGenerator.Core;

@@convenientAPI(AnomalyDetector.Univariate.DetectUnivariateEntireSeries, false)
@@convenientAPI(AnomalyDetector.Univariate.detectUnivariateEntireSeries, false)
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ namespace ClientForAzureHealthInsights;
service: AzureHealthInsights
})
interface CancerProfilingClient {
InferCancerProfile is AzureHealthInsights.OncoPhenotype.createJob;
#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "https://github.com/microsoft/typespec/issues/2037"
inferCancerProfile is AzureHealthInsights.OncoPhenotype.createJob;
}
Original file line number Diff line number Diff line change
@@ -1,25 +1,19 @@
emit: [
"@azure-tools/typespec-csharp",
# "@azure-tools/cadl-python",
# "@azure-tools/typespec-java",
# "@azure-tools/cadl-typescript",
]

emit: []
options:
"@azure-tools/typespec-csharp":
namespace : "Azure.Health.Insights.CancerProfiling"
clear-output-folder : true
new-project : false
model-namespace : false
# "@azure-tools/typespec-java":
# namespace: "Com.Azure.Health.Insights.CancerProfiling"
# clear-output-folder: true
# new-project: false
# model-namespace: false
# "@azure-tools/cadl-python":
# package-mode: "dataplane"
# package-name: "azure-healthinsights-cancerprofiling"
# "@azure-tools/cadl-typescript":
# packageDetails:
# name: "@azure-rest/health-insights-cancerprofiling"
# description: "Azure Health Insights CancerProfiling"
"@azure-tools/typespec-java":
namespace: "Com.Azure.Health.Insights.CancerProfiling"
clear-output-folder: true
new-project: false
model-namespace: false
"@azure-tools/cadl-python":
package-mode: "dataplane"
package-name: "azure-healthinsights-cancerprofiling"
"@azure-tools/cadl-typescript":
packageDetails:
name: "@azure-rest/health-insights-cancerprofiling"
description: "Azure Health Insights CancerProfiling"
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
emit: [
"@azure-tools/typespec-autorest",
# "@azure-tools/cadl-apiview"
]


options:
"@azure-tools/typespec-autorest":
azure-resource-provider-folder: "data-plane"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ namespace ClientForAzureHealthInsights;
service: AzureHealthInsights
})
interface ClinicalMatchingClient {
MatchTrials is AzureHealthInsights.TrialMatcher.createJob;
#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "https://github.com/microsoft/typespec/issues/2037"
matchTrials is AzureHealthInsights.TrialMatcher.createJob;
}
Original file line number Diff line number Diff line change
@@ -1,25 +1,19 @@
emit: [
"@azure-tools/typespec-csharp",
# "@azure-tools/cadl-python",
# "@azure-tools/typespec-java",
# "@azure-tools/cadl-typescript",
]

emit: []
options:
"@azure-tools/typespec-csharp":
namespace : "Azure.Health.Insights.ClinicalMatching"
clear-output-folder : true
new-project : false
model-namespace : false
# "@azure-tools/typespec-java":
# namespace: "Com.Azure.Health.Insights.ClinicalMatching"
# clear-output-folder: true
# new-project: false
# model-namespace: false
# "@azure-tools/cadl-python":
# package-mode: "dataplane"
# package-name: "azure-healthinsights-clinicalmatching"
# "@azure-tools/cadl-typescript":
# packageDetails:
# name: "@azure-rest/health-insights-clinicalmatching"
# description: "Azure Health Insights ClinicalMatching"
"@azure-tools/typespec-java":
namespace: "Com.Azure.Health.Insights.ClinicalMatching"
clear-output-folder: true
new-project: false
model-namespace: false
"@azure-tools/cadl-python":
package-mode: "dataplane"
package-name: "azure-healthinsights-clinicalmatching"
"@azure-tools/cadl-typescript":
packageDetails:
name: "@azure-rest/health-insights-clinicalmatching"
description: "Azure Health Insights ClinicalMatching"

0 comments on commit 601e3d4

Please sign in to comment.