You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/copilot-instructions.md
-1Lines changed: 0 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,6 @@ The Azure SDK for Java repository contains client libraries for Azure services,
27
27
ACTION: Use azure-sdk-java-mcp sdk tools to generate the SDK.
28
28
ACTION: Do not use pure `mvn` command to compile, build or package SDK, use `build_java_sdk` tool instead, it runs `mvn` command inside.
29
29
ACTION: Use azure-sdk-java-mcp sdk tool `update_client_name` to update client name.
30
-
ACTION: Do not clean Java source before generating the SDK because the generated code may have manual written customized code.
31
30
ACTION: Only update the manual written code or class when you fix compile errors. Manual written class does not have `// Code generated by Microsoft (R) TypeSpec Code Generator.` header. Manual written functions or properties do not have `@Generated` annotation.
Copy file name to clipboardExpand all lines: eng/tools/mcp/azure-sdk-java-mcp/README.md
+12-29Lines changed: 12 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,13 +8,12 @@ This MCP server provides the following tools:
8
8
9
9
1.**sync_typespec_source_files** - Synchronize/Download TypeSpec source files for Java SDK generation from local or remote sources
10
10
2.**generate_java_sdk** - Generate or update Java SDK code from TypeSpec definitions
11
-
3.**clean_java_source** - Clean and remove generated Java source files from SDK directory
12
-
4.**build_java_sdk** - Compile and build the Java SDK with Maven for Azure services
13
-
5.**get_java_sdk_changelog** - Generate and retrieve changelog information for the Java SDK
14
-
6.**update_java_sdk_changelog** - Update the CHANGELOG.md file for a Java SDK module
15
-
7.**instruction_migrate_typespec** - Provide step-by-step instructions for migrating from Swagger to TypeSpec
16
-
8.**update_client_name** - Guide through updating client class and property names in TypeSpec and Java SDK
17
-
9.**prepare_java_sdk_environment** - Provide environment setup instructions and dependency requirements
11
+
3.**build_java_sdk** - Compile and build the Java SDK with Maven for Azure services
12
+
4.**get_java_sdk_changelog** - Generate and retrieve changelog information for the Java SDK
13
+
5.**update_java_sdk_changelog** - Update the CHANGELOG.md file for a Java SDK module
14
+
6.**instruction_migrate_typespec** - Provide step-by-step instructions for migrating from Swagger to TypeSpec
15
+
7.**update_client_name** - Guide through updating client class and property names in TypeSpec and Java SDK
16
+
8.**prepare_java_sdk_environment** - Provide environment setup instructions and dependency requirements
18
17
19
18
## Prerequisites
20
19
@@ -58,7 +57,6 @@ Here are some example prompts you can use with GitHub Copilot to interact with t
58
57
59
58
### Environment and Tooling
60
59
-`prepare java sdk environment`
61
-
-`clean java source files for azure-ai-openai`
62
60
63
61
### Client Name Updates
64
62
-`update client name: EnableBatchJobOptions to BatchJobEnableOptions`
@@ -120,23 +118,8 @@ Generate SDK from TypeSpec source from 'TempTypeSpecFiles' for a target service
120
118
}
121
119
```
122
120
123
-
### 3. clean_java_source
124
-
Clean the Java source code for a module, removing all generated source files and directories.
125
121
126
-
**Parameters:**
127
-
-`cwd` (required): The absolute path to the directory where tsp-location.yaml is located
128
-
129
-
**Example:**
130
-
```json
131
-
{
132
-
"name": "clean_java_source",
133
-
"arguments": {
134
-
"cwd": "/path/to/java/sdk/module"
135
-
}
136
-
}
137
-
```
138
-
139
-
### 4. build_java_sdk
122
+
### 3. build_java_sdk
140
123
Build the Java SDK for a service sub module whose groupId starts with `com.azure`. The tool takes the module directory, root directory, groupId and artifactId as input parameters.
141
124
142
125
**Parameters:**
@@ -158,7 +141,7 @@ Build the Java SDK for a service sub module whose groupId starts with `com.azure
158
141
}
159
142
```
160
143
161
-
### 5. get_java_sdk_changelog
144
+
### 4. get_java_sdk_changelog
162
145
Get the changelog for a service sub module whose groupId starts with `com.azure`. The tool takes the jarPath, groupId and artifactId as input parameters.
163
146
164
147
**Parameters:**
@@ -178,7 +161,7 @@ Get the changelog for a service sub module whose groupId starts with `com.azure`
178
161
}
179
162
```
180
163
181
-
### 6. update_java_sdk_changelog
164
+
### 5. update_java_sdk_changelog
182
165
Update the CHANGELOG.md file for a service sub module whose groupId starts with `com.azure`. The tool takes the absolute path to the JAR file, groupId and artifactId as input parameters.
183
166
184
167
**Parameters:**
@@ -198,7 +181,7 @@ Update the CHANGELOG.md file for a service sub module whose groupId starts with
198
181
}
199
182
```
200
183
201
-
### 7. instruction_migrate_typespec
184
+
### 6. instruction_migrate_typespec
202
185
Get instructions for generating Java SDK after migrating from Swagger to TypeSpec.
203
186
204
187
**Parameters:**
@@ -212,7 +195,7 @@ Get instructions for generating Java SDK after migrating from Swagger to TypeSpe
212
195
}
213
196
```
214
197
215
-
### 8. update_client_name
198
+
### 7. update_client_name
216
199
Update client name for both client.tsp and the generated java sdk. Follow the returned instruction to update old client name to new client name, be sure to ask for old client name and new client name. e.g. MediaMessageContent.mediaUri to MediaMessageContent.mediaUrl
217
200
218
201
**Parameters:**
@@ -226,7 +209,7 @@ Update client name for both client.tsp and the generated java sdk. Follow the re
226
209
}
227
210
```
228
211
229
-
### 9. prepare_java_sdk_environment
212
+
### 8. prepare_java_sdk_environment
230
213
Prepare the development environment for Java SDK generation, including 3 main areas: Node.js/npm, Java environment, and TypeSpec tools.
constcookbook=`Follow the instructions below to migrate the Java SDK to generate from TypeSpec.
5
5
6
+
DO NOT SKIP STEP 3, IN ANY CONDITION.
7
+
6
8
1. Initiate the Java SDK with the given URL to the "tspconfig.yaml" file.
7
9
Use the tool to initiate the Java SDK, from tspconfig.yaml URL. This tool create a "tsp-location.yaml" file.
8
10
9
11
2. Find the path to SDK module and its "pom.xml" file.
10
12
Run "git status --porcelain" to find the "tsp-location.yaml" file. The path to the SDK module is the directory containing the "tsp-location.yaml" file. The "pom.xml" file is located in the same directory.
11
13
12
14
3. Clean the Java source in SDK module.
13
-
Use the tool to clean the Java source in the SDK module.
15
+
Delete folder "src/main" in the SDK module. Delete folder "src/samples/**/generated" and "src/test/**/generated" in the SDK module.
14
16
15
-
4. Synchronize the TypeSpec source for Java SDK.
16
-
Use the tool to synchronize the TypeSpec source for the Java SDK. This will download the the TypeSpec source specified in the "tsp-location.yaml" file.
17
+
4. Generate Java SDK from the TypeSpec source.
18
+
Use the tool to generate the Java SDK. This will generate the Java SDK from existing TypeSpec source in "TempTypeSpecFiles" folder.
17
19
18
20
5. Build the Java SDK.
19
21
Use the tool to build the Java SDK. This will compile the Java code and generate the necessary artifacts, e.g. JAR file.
@@ -28,7 +30,9 @@ export async function brownfieldMigration(): Promise<CallToolResult> {
28
30
If there is no such candidates, the migration is completed, and you can skip all the next steps.
29
31
30
32
8. Apply the changes to the TypeSpec source.
31
-
Use the tool to apply the rename changes to the TypeSpec source. Ask it to e.g. "Update client name, rename model from <old_name> to <new_name>".
33
+
Use the tool to apply the rename changes to the TypeSpec source, so that it can keep the original naming.
34
+
Ask it to e.g. "Update client name, rename model from <name_after_codegen> to <name_before_codegen>".
35
+
Java SDK is following the convention of e.g. "username", "hostname", "Ip", "Id". Hence, the tool should keep using these naming patterns.
"Remove all generated Java source files and directories for a given module. This tool is typically used to clean up the output of previous SDK generations before a new build. It should only be applied to packages with the prefix `azure-resourcemanager-*`.",
34
-
inputSchema: {
35
-
cwd: z
36
-
.string()
37
-
.describe(
38
-
"The absolute path to the module directory containing tsp-location.yaml. Example: C:\\workspace\\azure-sdk-for-java\\sdk\\devcenter\\azure-resourcemanager-devcenter",
39
-
),
40
-
},
41
-
annotations: {
42
-
title: "Clean Java Source",
43
-
},
44
-
},
45
-
async(args)=>{
46
-
logToolCall("clean_java_source");
47
-
returnawaitcleanJavaSource(args.cwd);
48
-
},
49
-
);
27
+
// // Tool: clean_java_source
28
+
// server.registerTool(
29
+
// "clean_java_source",
30
+
// {
31
+
// description:
32
+
// "Remove all generated Java source files and directories for a given module. This tool is typically used to clean up the output of previous SDK generations before a new build. It should only be applied to packages with the prefix `azure-resourcemanager-*`.",
33
+
// inputSchema: {
34
+
// cwd: z
35
+
// .string()
36
+
// .describe(
37
+
// "The absolute path to the module directory containing tsp-location.yaml. Example: C:\\workspace\\azure-sdk-for-java\\sdk\\devcenter\\azure-resourcemanager-devcenter",
0 commit comments